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

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

#include <TransmittedPackets.hpp>

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

Public Member Functions

 ZC_POSITION_INFO (std::shared_ptr< ZoneSession > s)
 
virtual ~ZC_POSITION_INFO ()
 
void deliver (std::vector< s_zc_position_info > info)
 ZC_POSITION_INFO. 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 }
 
std::vector< s_zc_position_info_info
 

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_POSITION_INFO.

Constructor & Destructor Documentation

◆ ZC_POSITION_INFO()

Horizon::Zone::ZC_POSITION_INFO::ZC_POSITION_INFO ( std::shared_ptr< ZoneSession s)
inline
38637 : NetworkPacket<ZoneSession>(ID_ZC_POSITION_INFO, s)
38638 {}
@ ID_ZC_POSITION_INFO
Definition: TransmittedPackets.hpp:38610

◆ ~ZC_POSITION_INFO()

virtual Horizon::Zone::ZC_POSITION_INFO::~ZC_POSITION_INFO ( )
inlinevirtual
38639{}

Member Function Documentation

◆ deliver()

void ZC_POSITION_INFO::deliver ( std::vector< s_zc_position_info info)

ZC_POSITION_INFO.

2525{
2526 _packet_length = 4 + (sizeof(s_zc_position_info) * info.size());
2527 _info = info;
2528 serialize();
2529 transmit();
2530}
void transmit()
Send an Asynchronous packet by queueing a buffer of a particular size to the connected session.
Definition: NetworkPacket.hpp:94
std::vector< s_zc_position_info > _info
Definition: TransmittedPackets.hpp:38646
int16_t _packet_length
Definition: TransmittedPackets.hpp:38645
ByteBuffer & serialize()
Definition: TransmittedPackets.cpp:2532
Definition: ClientDefinitions.hpp:310

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

+ Here is the call graph for this function:

◆ serialize()

ByteBuffer & ZC_POSITION_INFO::serialize ( )
2533{
2534 buf() << _packet_id;
2535 buf() << _packet_length;
2536 for (auto i : _info) {
2537 buf() << i.position_id;
2538 buf() << i.mode;
2539 buf() << i.ranking;
2540 buf() << i.pay_rate;
2541 }
2542 return buf();
2543}
uint16_t _packet_id
ID of the network packet.
Definition: NetworkPacket.hpp:87
ByteBuffer & buf()
Definition: NetworkPacket.hpp:59

References _info, Horizon::Base::NetworkPacket< ZoneSession >::_packet_id, _packet_length, 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

◆ _info

std::vector<s_zc_position_info> Horizon::Zone::ZC_POSITION_INFO::_info

Referenced by deliver(), and serialize().

◆ _packet_length

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

Referenced by deliver(), and serialize().


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