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

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

#include <HandledPackets.hpp>

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

Public Member Functions

 CZ_PC_PURCHASE_ITEMLIST_FROMMC2 (std::shared_ptr< ZoneSession > s)
 
virtual ~CZ_PC_PURCHASE_ITEMLIST_FROMMC2 ()
 
void handle (ByteBuffer &&buf)
 CZ_PC_PURCHASE_ITEMLIST_FROMMC2. More...
 
void deserialize (ByteBuffer &buf)
 
- 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

int16_t _packet_length { 0 }
 
int _account_id { 0 }
 
int _unique_id { 0 }
 
std::vector< cz_pc_purchase_itemlist_items { 0 }
 

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: CZ_PC_PURCHASE_ITEMLIST_FROMMC2.

Constructor & Destructor Documentation

◆ CZ_PC_PURCHASE_ITEMLIST_FROMMC2()

Horizon::Zone::CZ_PC_PURCHASE_ITEMLIST_FROMMC2::CZ_PC_PURCHASE_ITEMLIST_FROMMC2 ( std::shared_ptr< ZoneSession s)
inline
17681 : NetworkPacket<ZoneSession>(ID_CZ_PC_PURCHASE_ITEMLIST_FROMMC2, s)
17682 {}
@ ID_CZ_PC_PURCHASE_ITEMLIST_FROMMC2
Definition: HandledPackets.hpp:17657

◆ ~CZ_PC_PURCHASE_ITEMLIST_FROMMC2()

virtual Horizon::Zone::CZ_PC_PURCHASE_ITEMLIST_FROMMC2::~CZ_PC_PURCHASE_ITEMLIST_FROMMC2 ( )
inlinevirtual
17683{}

Member Function Documentation

◆ deserialize()

void CZ_PC_PURCHASE_ITEMLIST_FROMMC2::deserialize ( ByteBuffer buf)
virtual

Reimplemented from Horizon::Base::NetworkPacket< ZoneSession >.

3336{
3337 buf >> _packet_id;
3339 buf >> _account_id;
3340 buf >> _unique_id;
3341 for (int i = 0; i < ((_packet_length - 12) / sizeof(cz_pc_purchase_itemlist)); i++) {
3343 buf >> item.amount;
3344 buf >> item.item_id;
3345 _items.push_back(item);
3346 }
3347}
uint16_t _packet_id
ID of the network packet.
Definition: NetworkPacket.hpp:87
ByteBuffer & buf()
Definition: NetworkPacket.hpp:59
int _unique_id
Definition: HandledPackets.hpp:17691
std::vector< cz_pc_purchase_itemlist > _items
Definition: HandledPackets.hpp:17692
int16_t _packet_length
Definition: HandledPackets.hpp:17689
int _account_id
Definition: HandledPackets.hpp:17690
Definition: ClientDefinitions.hpp:694
int16_t item_id
Definition: ClientDefinitions.hpp:694
int16_t amount
Definition: ClientDefinitions.hpp:694

References _account_id, _items, Horizon::Base::NetworkPacket< ZoneSession >::_packet_id, _packet_length, _unique_id, cz_pc_purchase_itemlist::amount, Horizon::Base::NetworkPacket< ZoneSession >::buf(), and cz_pc_purchase_itemlist::item_id.

Referenced by handle().

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

◆ handle()

void CZ_PC_PURCHASE_ITEMLIST_FROMMC2::handle ( ByteBuffer &&  buf)
virtual

CZ_PC_PURCHASE_ITEMLIST_FROMMC2.

Reimplemented from Horizon::Base::NetworkPacket< ZoneSession >.

3331{
3333 get_session()->clif()->vending_purchase_items(_account_id, _unique_id, _items);
3334}
std::shared_ptr< ZoneSession > get_session()
Retrieves the session from this handler instance.
Definition: NetworkPacket.hpp:65
void deserialize(ByteBuffer &buf)
Definition: HandledPackets.cpp:3335

References _account_id, _items, _unique_id, Horizon::Base::NetworkPacket< ZoneSession >::buf(), deserialize(), and Horizon::Base::NetworkPacket< ZoneSession >::get_session().

+ Here is the call graph for this function:

Member Data Documentation

◆ _account_id

int Horizon::Zone::CZ_PC_PURCHASE_ITEMLIST_FROMMC2::_account_id { 0 }

Referenced by deserialize(), and handle().

◆ _items

std::vector<cz_pc_purchase_itemlist> Horizon::Zone::CZ_PC_PURCHASE_ITEMLIST_FROMMC2::_items { 0 }

Referenced by deserialize(), and handle().

◆ _packet_length

int16_t Horizon::Zone::CZ_PC_PURCHASE_ITEMLIST_FROMMC2::_packet_length { 0 }

Referenced by deserialize().

◆ _unique_id

int Horizon::Zone::CZ_PC_PURCHASE_ITEMLIST_FROMMC2::_unique_id { 0 }

Referenced by deserialize(), and handle().


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