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

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

#include <HandledPackets.hpp>

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

Public Member Functions

 CZ_PC_PURCHASE_ITEMLIST_FROMMC (std::shared_ptr< ZoneSession > s)
 
virtual ~CZ_PC_PURCHASE_ITEMLIST_FROMMC ()
 
void handle (ByteBuffer &&buf)
 CZ_PC_PURCHASE_ITEMLIST_FROMMC. 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 }
 
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_FROMMC.

Constructor & Destructor Documentation

◆ CZ_PC_PURCHASE_ITEMLIST_FROMMC()

Horizon::Zone::CZ_PC_PURCHASE_ITEMLIST_FROMMC::CZ_PC_PURCHASE_ITEMLIST_FROMMC ( std::shared_ptr< ZoneSession s)
inline
17638 : NetworkPacket<ZoneSession>(ID_CZ_PC_PURCHASE_ITEMLIST_FROMMC, s)
17639 {}
@ ID_CZ_PC_PURCHASE_ITEMLIST_FROMMC
Definition: HandledPackets.hpp:17611

◆ ~CZ_PC_PURCHASE_ITEMLIST_FROMMC()

virtual Horizon::Zone::CZ_PC_PURCHASE_ITEMLIST_FROMMC::~CZ_PC_PURCHASE_ITEMLIST_FROMMC ( )
inlinevirtual
17640{}

Member Function Documentation

◆ deserialize()

void CZ_PC_PURCHASE_ITEMLIST_FROMMC::deserialize ( ByteBuffer buf)
virtual

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

871{
872 buf >> _packet_id;
874 buf >> _account_id;
875 for (int i = 0; i < ((_packet_length - 8) / sizeof(cz_pc_purchase_itemlist)); i++) {
877 buf >> item.amount;
878 buf >> item.item_id;
879 _items.push_back(item);
880 }
881}
uint16_t _packet_id
ID of the network packet.
Definition: NetworkPacket.hpp:87
ByteBuffer & buf()
Definition: NetworkPacket.hpp:59
std::vector< cz_pc_purchase_itemlist > _items
Definition: HandledPackets.hpp:17648
int16_t _packet_length
Definition: HandledPackets.hpp:17646
int _account_id
Definition: HandledPackets.hpp:17647
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, 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_FROMMC::handle ( ByteBuffer &&  buf)
virtual

CZ_PC_PURCHASE_ITEMLIST_FROMMC.

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

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

References _account_id, _items, 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_FROMMC::_account_id { 0 }

Referenced by deserialize(), and handle().

◆ _items

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

Referenced by deserialize(), and handle().

◆ _packet_length

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

Referenced by deserialize().


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