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

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

#include <TransmittedPackets.hpp>

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

Public Member Functions

 ZC_STORE_ITEMLIST_NORMAL_V6 (std::shared_ptr< ZoneSession > s)
 
virtual ~ZC_STORE_ITEMLIST_NORMAL_V6 ()
 
void deliver (inventory_type type, std::vector< std::shared_ptr< const item_entry_data > > const &items)
 ZC_STORE_ITEMLIST_NORMAL_V6. 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 _packet_length { 0 }
 
int8_t _inventory_type { 0 }
 
std::vector< std::shared_ptr< const item_entry_data > > _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_STORE_ITEMLIST_NORMAL_V6.

Constructor & Destructor Documentation

◆ ZC_STORE_ITEMLIST_NORMAL_V6()

Horizon::Zone::ZC_STORE_ITEMLIST_NORMAL_V6::ZC_STORE_ITEMLIST_NORMAL_V6 ( std::shared_ptr< ZoneSession s)
inline
44963 : NetworkPacket<ZoneSession>(ID_ZC_STORE_ITEMLIST_NORMAL_V6, s)
44964 {}
@ ID_ZC_STORE_ITEMLIST_NORMAL_V6
Definition: TransmittedPackets.hpp:44939

◆ ~ZC_STORE_ITEMLIST_NORMAL_V6()

virtual Horizon::Zone::ZC_STORE_ITEMLIST_NORMAL_V6::~ZC_STORE_ITEMLIST_NORMAL_V6 ( )
inlinevirtual
44965{}

Member Function Documentation

◆ deliver()

void ZC_STORE_ITEMLIST_NORMAL_V6::deliver ( inventory_type  type,
std::vector< std::shared_ptr< const item_entry_data > > const &  items 
)

ZC_STORE_ITEMLIST_NORMAL_V6.

5880{
5881 _packet_length = 5 + (items.size() * 34);
5882 _items = items;
5883 _inventory_type = type;
5884
5885 serialize();
5886 transmit();
5887}
void transmit()
Send an Asynchronous packet by queueing a buffer of a particular size to the connected session.
Definition: NetworkPacket.hpp:94
std::vector< std::shared_ptr< const item_entry_data > > _items
Definition: TransmittedPackets.hpp:44973
int16 _packet_length
Definition: TransmittedPackets.hpp:44971
int8_t _inventory_type
Definition: TransmittedPackets.hpp:44972
ByteBuffer & serialize()
Definition: TransmittedPackets.cpp:5889

References _inventory_type, _items, _packet_length, serialize(), and Horizon::Base::NetworkPacket< ZoneSession >::transmit().

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

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

◆ serialize()

ByteBuffer & ZC_STORE_ITEMLIST_NORMAL_V6::serialize ( )
5890{
5891 buf() << _packet_id;
5892 buf() << _packet_length;
5893 buf() << _inventory_type;
5894
5895 for (auto it = _items.begin(); it != _items.end(); it++) {
5896 std::shared_ptr<const item_entry_data> id = *it;
5897 uint8_t config = 0;
5898
5899 buf() << id->index.inventory;
5900 buf() << id->item_id; // 4 / > 2019: 6
5901 buf() << (uint8_t) id->type;
5902 buf() << id->amount;
5903 buf() << id->current_equip_location_mask; // 11 / 13
5904
5905 for (int i = 0; i < MAX_ITEM_SLOTS; i++)
5906 buf() << id->slot_item_id[i]; // 4 * 2 / > 2019: 4 * 4
5907
5908 buf() << id->hire_expire_date; // 23
5909
5910 config |= id->info.is_identified;
5911 config |= id->info.is_favorite << 1;
5912 buf() << config; // 24 / 34
5913 }
5914
5915 return buf();
5916}
#define MAX_ITEM_SLOTS
Definition: ItemDefinitions.hpp:42
uint16_t _packet_id
ID of the network packet.
Definition: NetworkPacket.hpp:87
ByteBuffer & buf()
Definition: NetworkPacket.hpp:59

References _inventory_type, _items, Horizon::Base::NetworkPacket< ZoneSession >::_packet_id, _packet_length, Horizon::Base::NetworkPacket< ZoneSession >::buf(), and MAX_ITEM_SLOTS.

Referenced by deliver().

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

Member Data Documentation

◆ _inventory_type

int8_t Horizon::Zone::ZC_STORE_ITEMLIST_NORMAL_V6::_inventory_type { 0 }

Referenced by deliver(), and serialize().

◆ _items

std::vector<std::shared_ptr<const item_entry_data> > Horizon::Zone::ZC_STORE_ITEMLIST_NORMAL_V6::_items

Referenced by deliver(), and serialize().

◆ _packet_length

int16 Horizon::Zone::ZC_STORE_ITEMLIST_NORMAL_V6::_packet_length { 0 }

Referenced by deliver(), and serialize().


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