Horizon Official Technical Documentation
Horizon::Char::HC_NOTIFY_ZONESVR Class Reference

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

#include <TransmittedPackets.hpp>

+ Inheritance diagram for Horizon::Char::HC_NOTIFY_ZONESVR:
+ Collaboration diagram for Horizon::Char::HC_NOTIFY_ZONESVR:

Public Member Functions

 HC_NOTIFY_ZONESVR (std::shared_ptr< CharSession > s)
 
virtual ~HC_NOTIFY_ZONESVR ()
 
void deliver (uint32_t char_id, std::string map_name, uint32_t ip_address, uint16_t port)
 HC_NOTIFY_ZONESVR. More...
 
ByteBufferserialize ()
 
- Public Member Functions inherited from Horizon::Base::NetworkPacket< CharSession >
 NetworkPacket (uint16_t packet_id, std::shared_ptr< CharSession > s)
 
virtual ~NetworkPacket ()
 
void set_packet_id (uint16_t id)
 
uint16_t get_packet_id ()
 
ByteBufferbuf ()
 
std::shared_ptr< CharSession > 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

uint32_t _char_id { 0 }
 
char _map_name [MAP_NAME_LENGTH_EXT] { 0 }
 
uint32_t _ip_address { 0 }
 
uint16_t _port { 0 }
 

Additional Inherited Members

- Protected Attributes inherited from Horizon::Base::NetworkPacket< CharSession >
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: HC_NOTIFY_ZONESVR.

Constructor & Destructor Documentation

◆ HC_NOTIFY_ZONESVR()

Horizon::Char::HC_NOTIFY_ZONESVR::HC_NOTIFY_ZONESVR ( std::shared_ptr< CharSession s)
inline
899 : NetworkPacket<CharSession>(ID_HC_NOTIFY_ZONESVR, s)
900 {}
@ ID_HC_NOTIFY_ZONESVR
Definition: TransmittedPackets.hpp:868

◆ ~HC_NOTIFY_ZONESVR()

virtual Horizon::Char::HC_NOTIFY_ZONESVR::~HC_NOTIFY_ZONESVR ( )
inlinevirtual
901{}

Member Function Documentation

◆ deliver()

void HC_NOTIFY_ZONESVR::deliver ( uint32_t  char_id,
std::string  map_name,
uint32_t  ip_address,
uint16_t  port 
)

HC_NOTIFY_ZONESVR.

261{
262 _char_id = char_id;
263 strncpy(_map_name, map_name.c_str(), MAP_NAME_LENGTH_EXT);
264 _ip_address = ip_address;
265 _port = port;
266
267 serialize();
268 transmit();
269}
#define MAP_NAME_LENGTH_EXT
Definition: Client.hpp:47
void transmit()
Send an Asynchronous packet by queueing a buffer of a particular size to the connected session.
Definition: NetworkPacket.hpp:94
uint32_t _char_id
Definition: TransmittedPackets.hpp:907
char _map_name[MAP_NAME_LENGTH_EXT]
Definition: TransmittedPackets.hpp:908
uint16_t _port
Definition: TransmittedPackets.hpp:910
uint32_t _ip_address
Definition: TransmittedPackets.hpp:909
ByteBuffer & serialize()
Definition: TransmittedPackets.cpp:271

References _char_id, _ip_address, _map_name, _port, MAP_NAME_LENGTH_EXT, serialize(), and Horizon::Base::NetworkPacket< CharSession >::transmit().

Referenced by Horizon::Char::CharClientInterface::select_character().

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

◆ serialize()

ByteBuffer & HC_NOTIFY_ZONESVR::serialize ( )
272{
273 buf() << _packet_id;
274 buf() << _char_id;
275 buf().append(_map_name, sizeof(_map_name));
276 buf() << _ip_address;
277 buf() << _port;
278 return buf();
279}
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 _char_id, _ip_address, _map_name, Horizon::Base::NetworkPacket< CharSession >::_packet_id, _port, ByteBuffer::append(), and Horizon::Base::NetworkPacket< CharSession >::buf().

Referenced by deliver().

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

Member Data Documentation

◆ _char_id

uint32_t Horizon::Char::HC_NOTIFY_ZONESVR::_char_id { 0 }

Referenced by deliver(), and serialize().

◆ _ip_address

uint32_t Horizon::Char::HC_NOTIFY_ZONESVR::_ip_address { 0 }

Referenced by deliver(), and serialize().

◆ _map_name

char Horizon::Char::HC_NOTIFY_ZONESVR::_map_name[MAP_NAME_LENGTH_EXT] { 0 }

Referenced by deliver(), and serialize().

◆ _port

uint16_t Horizon::Char::HC_NOTIFY_ZONESVR::_port { 0 }

Referenced by deliver(), and serialize().


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