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

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

#include <TransmittedPackets.hpp>

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

Public Member Functions

 ZC_STORE_ITEMLIST_EQUIP_V6 (std::shared_ptr< ZoneSession > s)
 
virtual ~ZC_STORE_ITEMLIST_EQUIP_V6 ()
 
void deliver (std::string name, std::vector< std::shared_ptr< const item_entry_data > > const &items)
 
void deliver (inventory_type type, std::vector< std::shared_ptr< const item_entry_data > > const &items)
 ZC_STORE_ITEMLIST_EQUIP_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_t _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_EQUIP_V6.

Constructor & Destructor Documentation

◆ ZC_STORE_ITEMLIST_EQUIP_V6()

Horizon::Zone::ZC_STORE_ITEMLIST_EQUIP_V6::ZC_STORE_ITEMLIST_EQUIP_V6 ( std::shared_ptr< ZoneSession s)
inline
44786 : NetworkPacket<ZoneSession>(ID_ZC_STORE_ITEMLIST_EQUIP_V6, s)
44787 {}
@ ID_ZC_STORE_ITEMLIST_EQUIP_V6
Definition: TransmittedPackets.hpp:44753

◆ ~ZC_STORE_ITEMLIST_EQUIP_V6()

virtual Horizon::Zone::ZC_STORE_ITEMLIST_EQUIP_V6::~ZC_STORE_ITEMLIST_EQUIP_V6 ( )
inlinevirtual
44788{}

Member Function Documentation

◆ deliver() [1/2]

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

ZC_STORE_ITEMLIST_EQUIP_V6.

5646{
5647 _items = items;
5648#if (CLIENT_TYPE == 'R' && PACKET_VERSION >= 20180912) || \
5649 (CLIENT_TYPE == 'Z' && PACKET_VERSION >= 20180919) || \
5650 (CLIENT_TYPE == 'M' && PACKET_VERSION >= 20181002)
5651 _packet_length = (int16_t) ((67 * _items.size()) + 5);
5652 _inventory_type = type;
5653#else
5654 _packet_length = (int16_t) ((57 * _items.size()) + 4);
5655#endif
5656
5657 serialize();
5658 transmit();
5659}
void transmit()
Send an Asynchronous packet by queueing a buffer of a particular size to the connected session.
Definition: NetworkPacket.hpp:94
int8_t _inventory_type
Definition: TransmittedPackets.hpp:44799
int16_t _packet_length
Definition: TransmittedPackets.hpp:44795
ByteBuffer & serialize()
Definition: TransmittedPackets.cpp:5661
std::vector< std::shared_ptr< const item_entry_data > > _items
Definition: TransmittedPackets.hpp:44807

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

+ Here is the call graph for this function:

◆ deliver() [2/2]

void Horizon::Zone::ZC_STORE_ITEMLIST_EQUIP_V6::deliver ( std::string  name,
std::vector< std::shared_ptr< const item_entry_data > > const &  items 
)

◆ serialize()

ByteBuffer & ZC_STORE_ITEMLIST_EQUIP_V6::serialize ( )
5662{
5663 buf() << _packet_id;
5664 buf() << _packet_length;
5665#if (CLIENT_TYPE == 'R' && PACKET_VERSION >= 20180912) || \
5666 (CLIENT_TYPE == 'Z' && PACKET_VERSION >= 20180919) || \
5667 (CLIENT_TYPE == 'M' && PACKET_VERSION >= 20181002)
5668 buf() << _inventory_type;
5669#endif
5670#if (PACKET_VERSION >= 20120925 && \
5671 ((CLIENT_TYPE == 'R' && PACKET_VERSION < 20180829) || \
5672 (CLIENT_TYPE == 'Z' && PACKET_VERSION < 20180919) || \
5673 (CLIENT_TYPE == 'M' && PACKET_VERSION < 20181002)))
5675#endif
5676 for (auto it = _items.begin(); it != _items.end(); it++) {
5677 std::shared_ptr<const item_entry_data> id = *it;
5678 uint8_t config = 0;
5679 buf() << id->index.inventory; // 2
5680 buf() << id->item_id; // 4 / > 2019: 6
5681 buf() << (int8_t) id->type; // 5
5682 buf() << id->actual_equip_location_mask; // 9
5683 buf() << id->current_equip_location_mask; // 13
5684 buf() << id->refine_level; //14
5685 for (int i = 0; i < MAX_ITEM_SLOTS; i++) // 14 + 8 = 22 / > 2019: 16 + 16 = 32
5686 buf() << id->slot_item_id[i];
5687 buf() << id->hire_expire_date; // 26
5688 buf() << (int16_t) id->bind_type; // 28
5689 buf() << id->sprite_id; // 30
5690
5691 buf() << id->option_count; // 31
5692
5693 for (int i = 0; i < MAX_ITEM_OPTIONS; i++) {
5694 buf() << id->option_data[i].index;
5695 buf() << id->option_data[i].value;
5696 buf() << id->option_data[i].param;
5697 } // 31 + 25 = 56
5698
5699 config |= id->info.is_identified;
5700 config |= id->info.is_broken << 1;
5701 config |= id->info.is_favorite << 2;
5702
5703 buf() << config; // 57 / > 2019: 57 + 10 = 67
5704 }
5705 return buf();
5706}
char _name[MAX_UNIT_NAME_LENGTH]
112
Definition: Client.hpp:51
#define MAX_UNIT_NAME_LENGTH
Definition: Client.hpp:34
#define MAX_ITEM_SLOTS
Definition: ItemDefinitions.hpp:42
#define MAX_ITEM_OPTIONS
Definition: ItemDefinitions.hpp:41
void append(T value)
Definition: ByteBuffer.hpp:140
uint16_t _packet_id
ID of the network packet.
Definition: NetworkPacket.hpp:87
ByteBuffer & buf()
Definition: NetworkPacket.hpp:59

References _inventory_type, _items, _name, Horizon::Base::NetworkPacket< ZoneSession >::_packet_id, _packet_length, ByteBuffer::append(), Horizon::Base::NetworkPacket< ZoneSession >::buf(), MAX_ITEM_OPTIONS, MAX_ITEM_SLOTS, and MAX_UNIT_NAME_LENGTH.

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_EQUIP_V6::_inventory_type { 0 }

Referenced by deliver(), and serialize().

◆ _items

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

Referenced by deliver(), and serialize().

◆ _packet_length

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

Referenced by deliver(), and serialize().


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