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

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

#include <TransmittedPackets.hpp>

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

Public Member Functions

 ZC_ACK_ITEMLIST_BUYING_STORE (std::shared_ptr< ZoneSession > s)
 
virtual ~ZC_ACK_ITEMLIST_BUYING_STORE ()
 
void deliver (int account_id, int store_id, int zeny_limit, std::vector< zc_ack_itemlist_buying_store > items)
 ZC_ACK_ITEMLIST_BUYING_STORE. 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

int16_t _packet_length { 0 }
 
int _account_id { 0 }
 
int _store_id { 0 }
 
int _zeny_limit { 0 }
 
std::vector< zc_ack_itemlist_buying_store_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: ZC_ACK_ITEMLIST_BUYING_STORE.

Constructor & Destructor Documentation

◆ ZC_ACK_ITEMLIST_BUYING_STORE()

Horizon::Zone::ZC_ACK_ITEMLIST_BUYING_STORE::ZC_ACK_ITEMLIST_BUYING_STORE ( std::shared_ptr< ZoneSession s)
inline
16409 : NetworkPacket<ZoneSession>(ID_ZC_ACK_ITEMLIST_BUYING_STORE, s)
16410 {}
@ ID_ZC_ACK_ITEMLIST_BUYING_STORE
Definition: TransmittedPackets.hpp:16385

◆ ~ZC_ACK_ITEMLIST_BUYING_STORE()

virtual Horizon::Zone::ZC_ACK_ITEMLIST_BUYING_STORE::~ZC_ACK_ITEMLIST_BUYING_STORE ( )
inlinevirtual
16411{}

Member Function Documentation

◆ deliver()

void ZC_ACK_ITEMLIST_BUYING_STORE::deliver ( int  account_id,
int  store_id,
int  zeny_limit,
std::vector< zc_ack_itemlist_buying_store items 
)

ZC_ACK_ITEMLIST_BUYING_STORE.

7062{
7063 _account_id = account_id;
7064 _store_id = store_id;
7065 _zeny_limit = zeny_limit;
7066 _items = items;
7067 serialize();
7068 transmit();
7069}
void transmit()
Send an Asynchronous packet by queueing a buffer of a particular size to the connected session.
Definition: NetworkPacket.hpp:94
int _account_id
Definition: TransmittedPackets.hpp:16418
std::vector< zc_ack_itemlist_buying_store > _items
Definition: TransmittedPackets.hpp:16421
int _zeny_limit
Definition: TransmittedPackets.hpp:16420
int _store_id
Definition: TransmittedPackets.hpp:16419
ByteBuffer & serialize()
Definition: TransmittedPackets.cpp:7070

References _account_id, _items, _store_id, _zeny_limit, serialize(), and Horizon::Base::NetworkPacket< ZoneSession >::transmit().

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

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

◆ serialize()

ByteBuffer & ZC_ACK_ITEMLIST_BUYING_STORE::serialize ( )
7071{
7072 buf() << _packet_id;
7073 buf() << _account_id;
7074 buf() << _store_id;
7075 buf() << _zeny_limit;
7076 for (int i = 0; i < _items.size(); i++) {
7077 buf() << _items[i].price;
7078 buf() << _items[i].amount;
7079 buf() << _items[i].item_type;
7080 buf() << _items[i].item_id;
7081 }
7082 return buf();
7083}
uint16_t _packet_id
ID of the network packet.
Definition: NetworkPacket.hpp:87
ByteBuffer & buf()
Definition: NetworkPacket.hpp:59

References _account_id, _items, Horizon::Base::NetworkPacket< ZoneSession >::_packet_id, _store_id, _zeny_limit, and Horizon::Base::NetworkPacket< ZoneSession >::buf().

Referenced by deliver().

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

Member Data Documentation

◆ _account_id

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

Referenced by deliver(), and serialize().

◆ _items

std::vector<zc_ack_itemlist_buying_store> Horizon::Zone::ZC_ACK_ITEMLIST_BUYING_STORE::_items

Referenced by deliver(), and serialize().

◆ _packet_length

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

◆ _store_id

int Horizon::Zone::ZC_ACK_ITEMLIST_BUYING_STORE::_store_id { 0 }

Referenced by deliver(), and serialize().

◆ _zeny_limit

int Horizon::Zone::ZC_ACK_ITEMLIST_BUYING_STORE::_zeny_limit { 0 }

Referenced by deliver(), and serialize().


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