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

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

#include <TransmittedPackets.hpp>

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

Public Member Functions

 ZC_ADD_EXCHANGE_ITEM (std::shared_ptr< ZoneSession > s)
 
virtual ~ZC_ADD_EXCHANGE_ITEM ()
 
void deliver (s_zc_add_exchange_item item)
 ZC_ADD_EXCHANGE_ITEM. 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

s_zc_add_exchange_item _item
 

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_EXCHANGE_ITEM.

Constructor & Destructor Documentation

◆ ZC_ADD_EXCHANGE_ITEM()

Horizon::Zone::ZC_ADD_EXCHANGE_ITEM::ZC_ADD_EXCHANGE_ITEM ( std::shared_ptr< ZoneSession s)
inline
19004 : NetworkPacket<ZoneSession>(ID_ZC_ADD_EXCHANGE_ITEM, s)
19005 {}
@ ID_ZC_ADD_EXCHANGE_ITEM
Definition: TransmittedPackets.hpp:18973

◆ ~ZC_ADD_EXCHANGE_ITEM()

virtual Horizon::Zone::ZC_ADD_EXCHANGE_ITEM::~ZC_ADD_EXCHANGE_ITEM ( )
inlinevirtual
19006{}

Member Function Documentation

◆ deliver()

void ZC_ADD_EXCHANGE_ITEM::deliver ( s_zc_add_exchange_item  item)

ZC_ADD_EXCHANGE_ITEM.

626{
627 _item = item;
628
629 serialize();
630 transmit();
631}
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:633
s_zc_add_exchange_item _item
Definition: TransmittedPackets.hpp:19011

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

+ Here is the call graph for this function:

◆ serialize()

ByteBuffer & ZC_ADD_EXCHANGE_ITEM::serialize ( )
634{
635 buf() << _packet_id;
636 buf() << _item.item_id;
637 buf() << _item.item_type;
638 buf() << _item.amount;
639 buf() << _item.identified;
640 buf() << _item.damaged;
641 buf() << _item.refine;
642 for (int i = 0; i < MAX_ITEM_SLOTS; i++)
643 buf() << _item.cards.item_id[i];
644#if PACKET_VERSION >= 20150226
645 for (int i = 0; i < MAX_ITEM_OPTIONS; i++) {
646 buf() << _item.option_data[i].index;
647 buf() << _item.option_data[i].value;
648 buf() << _item.option_data[i].param;
649 }
650#endif
651
652#if (CLIENT_TYPE == 'M' && PACKET_VERSION >= 20161102) || \
653 (CLIENT_TYPE == 'R' && PACKET_VERSION >= 20161026) || \
654 (CILENT_TYPE == 'Z')
655 buf() << _item.location;
656 buf() << _item.look;
657#endif // PACKETVER_MAIN_NUM >= 20161102 || PACKETVER_RE_NUM >= 20161026 || defined(PACKETVER_ZERO)
658#if (CLIENT_TYPE == 'M' && PACKET_VERSION >= 20200916) || \
659 (CLIENT_TYPE == 'R' && PACKET_VERSION >= 20200723) || \
660 (CLIENT_TYPE == 'Z' && PACKET_VERSION >= 20221024)
661 buf() << _item.refine;
662 buf() << _item.grade;
663#endif // PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200723 || PACKETVER_ZERO_NUM >= 20221024
664
665 return buf();
666}
#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
uint32 item_id[MAX_ITEM_SLOTS]
Definition: ItemDefinitions.hpp:584
uint8_t identified
Definition: ClientDefinitions.hpp:202
uint8_t item_type
Definition: ClientDefinitions.hpp:195
int16_t value
Definition: ClientDefinitions.hpp:213
uint32_t item_id
Definition: ClientDefinitions.hpp:194
int16_t param
Definition: ClientDefinitions.hpp:214
struct s_zc_add_exchange_item::@123 option_data[MAX_ITEM_OPTIONS]
uint8_t damaged
Definition: ClientDefinitions.hpp:203
int16_t index
Definition: ClientDefinitions.hpp:212
item_slot cards
Definition: ClientDefinitions.hpp:209
int32_t amount
Definition: ClientDefinitions.hpp:196
uint16_t look
Definition: ClientDefinitions.hpp:221
uint8_t refine
Definition: ClientDefinitions.hpp:207
uint32_t location
Definition: ClientDefinitions.hpp:220

References _item, Horizon::Base::NetworkPacket< ZoneSession >::_packet_id, s_zc_add_exchange_item::amount, Horizon::Base::NetworkPacket< ZoneSession >::buf(), s_zc_add_exchange_item::cards, s_zc_add_exchange_item::damaged, s_zc_add_exchange_item::identified, s_zc_add_exchange_item::index, s_zc_add_exchange_item::item_id, item_slot::item_id, s_zc_add_exchange_item::item_type, s_zc_add_exchange_item::location, s_zc_add_exchange_item::look, MAX_ITEM_OPTIONS, MAX_ITEM_SLOTS, s_zc_add_exchange_item::option_data, s_zc_add_exchange_item::param, s_zc_add_exchange_item::refine, and s_zc_add_exchange_item::value.

Referenced by deliver().

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

Member Data Documentation

◆ _item

s_zc_add_exchange_item Horizon::Zone::ZC_ADD_EXCHANGE_ITEM::_item

Referenced by deliver(), and serialize().


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