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

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

#include <TransmittedPackets.hpp>

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

Public Member Functions

 ZC_ACK_RANKING (std::shared_ptr< ZoneSession > s)
 
virtual ~ZC_ACK_RANKING ()
 
void deliver (cz_req_ranking_type ranking_type, std::vector< zc_ack_ranking_info > info, int ranking_points)
 ZC_ACK_RANKING. 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 _ranking_type { 0 }
 
struct zc_ack_ranking_info _info [MAX_RANKING_LIST]
 
int _ranking_points { 0 }
 

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

Constructor & Destructor Documentation

◆ ZC_ACK_RANKING()

Horizon::Zone::ZC_ACK_RANKING::ZC_ACK_RANKING ( std::shared_ptr< ZoneSession s)
inline
17350 : NetworkPacket<ZoneSession>(ID_ZC_ACK_RANKING, s)
17351 {}
@ ID_ZC_ACK_RANKING
Definition: TransmittedPackets.hpp:17314

◆ ~ZC_ACK_RANKING()

virtual Horizon::Zone::ZC_ACK_RANKING::~ZC_ACK_RANKING ( )
inlinevirtual
17352{}

Member Function Documentation

◆ deliver()

void ZC_ACK_RANKING::deliver ( cz_req_ranking_type  ranking_type,
std::vector< zc_ack_ranking_info info,
int  ranking_points 
)

ZC_ACK_RANKING.

7678{
7679 _ranking_type = (int16_t) ranking_type;
7680 for (int i = 0; i < info.size() && i < MAX_RANKING_LIST; i++)
7681 _info[i] = info[i];
7682 _ranking_points = ranking_points;
7683 serialize();
7684 transmit();
7685}
#define MAX_RANKING_LIST
Definition: ClientDefinitions.hpp:73
void transmit()
Send an Asynchronous packet by queueing a buffer of a particular size to the connected session.
Definition: NetworkPacket.hpp:94
int _ranking_points
Definition: TransmittedPackets.hpp:17360
ByteBuffer & serialize()
Definition: TransmittedPackets.cpp:7686
int16_t _ranking_type
Definition: TransmittedPackets.hpp:17358
struct zc_ack_ranking_info _info[MAX_RANKING_LIST]
Definition: TransmittedPackets.hpp:17359

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

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

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

◆ serialize()

ByteBuffer & ZC_ACK_RANKING::serialize ( )
7687{
7688 buf() << _packet_id;
7689 buf() << _ranking_type;
7690 for (int i = 0; i < MAX_RANKING_LIST; i++) {
7692 buf() << _info[i].points;
7693 }
7694 buf() << _ranking_points;
7695 return buf();
7696}
#define MAX_UNIT_NAME_LENGTH
Definition: Client.hpp:34
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
int points
Definition: ClientDefinitions.hpp:869

References _info, Horizon::Base::NetworkPacket< ZoneSession >::_packet_id, _ranking_points, _ranking_type, ByteBuffer::append(), Horizon::Base::NetworkPacket< ZoneSession >::buf(), MAX_RANKING_LIST, MAX_UNIT_NAME_LENGTH, and zc_ack_ranking_info::points.

Referenced by deliver().

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

Member Data Documentation

◆ _info

struct zc_ack_ranking_info Horizon::Zone::ZC_ACK_RANKING::_info[MAX_RANKING_LIST]

Referenced by deliver(), and serialize().

◆ _ranking_points

int Horizon::Zone::ZC_ACK_RANKING::_ranking_points { 0 }

Referenced by deliver(), and serialize().

◆ _ranking_type

int16_t Horizon::Zone::ZC_ACK_RANKING::_ranking_type { 0 }

Referenced by deliver(), and serialize().


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