Horizon Official Technical Documentation
Horizon::Zone::ZC_ADD_ITEM_TO_STORE3 Class Reference

Main object for the aegis packet: ZC_ADD_ITEM_TO_STORE3. More...

#include <TransmittedPackets.hpp>

+ Inheritance diagram for Horizon::Zone::ZC_ADD_ITEM_TO_STORE3:
+ Collaboration diagram for Horizon::Zone::ZC_ADD_ITEM_TO_STORE3:

Public Member Functions

 ZC_ADD_ITEM_TO_STORE3 (std::shared_ptr< ZoneSession > s)
 
virtual ~ZC_ADD_ITEM_TO_STORE3 ()
 
void deliver (std::shared_ptr< const item_entry_data > entry, int amount)
 ZC_ADD_ITEM_TO_STORE3. More...
 
ByteBufferserialize ()
 
- Public Member Functions inherited from Horizon::Base::NetworkPacket< ZoneSession >
 NetworkPacket (uint16_t packet_id, std::shared_ptr< ZoneSession > s)
 
virtual ~NetworkPacket ()
 
void set_packet_id (uint16_t id)
 
uint16_t get_packet_id ()
 
ByteBufferbuf ()
 
std::shared_ptr< ZoneSession > get_session ()
 Retrieves the session from this handler instance. More...
 
virtual void handle (ByteBuffer &&buf)
 
virtual void deserialize (ByteBuffer &buf)
 
void transmit ()
 Send an Asynchronous packet by queueing a buffer of a particular size to the connected session. More...
 
void transmit (std::size_t size)
 Send an Asynchronous packet by queueing a buffer of a particular size to the connected session. More...
 

Public Attributes

std::shared_ptr< const item_entry_data_entry
 
int _amount
 

Additional Inherited Members

- Protected Attributes inherited from Horizon::Base::NetworkPacket< ZoneSession >
ByteBuffer _buffer
 Buffer storage facility for the packet stream. More...
 
uint16_t _packet_id
 ID of the network packet. More...
 

Detailed Description

Main object for the aegis packet: ZC_ADD_ITEM_TO_STORE3.

Constructor & Destructor Documentation

◆ ZC_ADD_ITEM_TO_STORE3()

Horizon::Zone::ZC_ADD_ITEM_TO_STORE3::ZC_ADD_ITEM_TO_STORE3 ( std::shared_ptr< ZoneSession s)
inline
19450 : NetworkPacket<ZoneSession>(ID_ZC_ADD_ITEM_TO_STORE3, s)
19451 {}
@ ID_ZC_ADD_ITEM_TO_STORE3
Definition: TransmittedPackets.hpp:19426

◆ ~ZC_ADD_ITEM_TO_STORE3()

virtual Horizon::Zone::ZC_ADD_ITEM_TO_STORE3::~ZC_ADD_ITEM_TO_STORE3 ( )
inlinevirtual
19452{}

Member Function Documentation

◆ deliver()

void ZC_ADD_ITEM_TO_STORE3::deliver ( std::shared_ptr< const item_entry_data entry,
int  amount 
)

ZC_ADD_ITEM_TO_STORE3.

5511{
5512 _entry = entry;
5513 _amount = amount;
5514 serialize();
5515 transmit();
5516}
void transmit()
Send an Asynchronous packet by queueing a buffer of a particular size to the connected session.
Definition: NetworkPacket.hpp:94
ByteBuffer & serialize()
Definition: TransmittedPackets.cpp:5517
std::shared_ptr< const item_entry_data > _entry
Definition: TransmittedPackets.hpp:19458
int _amount
Definition: TransmittedPackets.hpp:19459

References _amount, _entry, serialize(), and Horizon::Base::NetworkPacket< ZoneSession >::transmit().

Referenced by Horizon::Zone::ZoneClientInterface::notify_storage_add_item().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ serialize()

ByteBuffer & ZC_ADD_ITEM_TO_STORE3::serialize ( )
5518{
5519 buf() << _packet_id;
5520 buf() << _entry->index.storage;
5521 buf() << _amount;
5522 buf() << _entry->item_id;
5523 buf() << (int8_t) _entry->type;
5524 buf() << (int8_t) _entry->info.is_identified;
5525 buf() << (int8_t) _entry->info.is_broken;
5526 buf() << _entry->refine_level; // 14
5527 for (int i = 0; i < MAX_ITEM_SLOTS; i++)
5528 buf() << _entry->slot_item_id[i]; // 14 + 8 = 22
5529 for (int i = 0; i < MAX_ITEM_OPTIONS; i++) {
5530 buf() << _entry->option_data[i].index;
5531 buf() << _entry->option_data[i].value;
5532 buf() << _entry->option_data[i].param; // 22 + 25 = 47
5533 }
5534 return buf();
5535}
#define MAX_ITEM_SLOTS
Definition: ItemDefinitions.hpp:42
#define MAX_ITEM_OPTIONS
Definition: ItemDefinitions.hpp:41
uint16_t _packet_id
ID of the network packet.
Definition: NetworkPacket.hpp:87
ByteBuffer & buf()
Definition: NetworkPacket.hpp:59

References _amount, _entry, Horizon::Base::NetworkPacket< ZoneSession >::_packet_id, Horizon::Base::NetworkPacket< ZoneSession >::buf(), MAX_ITEM_OPTIONS, and MAX_ITEM_SLOTS.

Referenced by deliver().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ _amount

int Horizon::Zone::ZC_ADD_ITEM_TO_STORE3::_amount

Referenced by deliver(), and serialize().

◆ _entry

std::shared_ptr<const item_entry_data> Horizon::Zone::ZC_ADD_ITEM_TO_STORE3::_entry

Referenced by deliver(), and serialize().


The documentation for this class was generated from the following files: