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

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

#include <HandledPackets.hpp>

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

Public Member Functions

 CZ_PC_PURCHASE_ITEMLIST (std::shared_ptr< ZoneSession > s)
 
virtual ~CZ_PC_PURCHASE_ITEMLIST ()
 
void handle (ByteBuffer &&buf)
 CZ_PC_PURCHASE_ITEMLIST. 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
 
std::vector< cz_pc_purchase_itemlist_items
 

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.

Constructor & Destructor Documentation

◆ CZ_PC_PURCHASE_ITEMLIST()

Horizon::Zone::CZ_PC_PURCHASE_ITEMLIST::CZ_PC_PURCHASE_ITEMLIST ( std::shared_ptr< ZoneSession s)
inline
17590 : NetworkPacket<ZoneSession>(ID_CZ_PC_PURCHASE_ITEMLIST, s)
17591 {}
@ ID_CZ_PC_PURCHASE_ITEMLIST
Definition: HandledPackets.hpp:17563

◆ ~CZ_PC_PURCHASE_ITEMLIST()

virtual Horizon::Zone::CZ_PC_PURCHASE_ITEMLIST::~CZ_PC_PURCHASE_ITEMLIST ( )
inlinevirtual
17592{}

Member Function Documentation

◆ deserialize()

void CZ_PC_PURCHASE_ITEMLIST::deserialize ( ByteBuffer buf)
virtual

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

852{
853 buf >> _packet_id;
855 for (int i = 0; i < ((_packet_length - 4) / sizeof(cz_pc_purchase_itemlist)); i++) {
857 buf >> item.amount;
858 buf >> item.item_id;
859 _items.push_back(item);
860 }
861}
uint16_t _packet_id
ID of the network packet.
Definition: NetworkPacket.hpp:87
ByteBuffer & buf()
Definition: NetworkPacket.hpp:59
int16_t _packet_length
Definition: HandledPackets.hpp:17598
std::vector< cz_pc_purchase_itemlist > _items
Definition: HandledPackets.hpp:17599
Definition: ClientDefinitions.hpp:694
int16_t item_id
Definition: ClientDefinitions.hpp:694
int16_t amount
Definition: ClientDefinitions.hpp:694

References _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::handle ( ByteBuffer &&  buf)
virtual

CZ_PC_PURCHASE_ITEMLIST.

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

847{
849 get_session()->clif()->npc_purchase_items(_items);
850}
std::shared_ptr< ZoneSession > get_session()
Retrieves the session from this handler instance.
Definition: NetworkPacket.hpp:65
void deserialize(ByteBuffer &buf)
Definition: HandledPackets.cpp:851

References _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

◆ _items

std::vector<cz_pc_purchase_itemlist> Horizon::Zone::CZ_PC_PURCHASE_ITEMLIST::_items

Referenced by deserialize(), and handle().

◆ _packet_length

int16_t Horizon::Zone::CZ_PC_PURCHASE_ITEMLIST::_packet_length

Referenced by deserialize().


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