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

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

#include <TransmittedPackets.hpp>

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

Public Member Functions

 ZC_NPCACK_MAPMOVE (std::shared_ptr< ZoneSession > s)
 
virtual ~ZC_NPCACK_MAPMOVE ()
 
void deliver (std::string map_name, int16_t x, int16_t y)
 ZC_NPCACK_MAPMOVE. 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

char _map_name [MAP_NAME_LENGTH_EXT] {0}
 
int16_t _x {0}
 
int16_t _y {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_NPCACK_MAPMOVE.

Constructor & Destructor Documentation

◆ ZC_NPCACK_MAPMOVE()

Horizon::Zone::ZC_NPCACK_MAPMOVE::ZC_NPCACK_MAPMOVE ( std::shared_ptr< ZoneSession s)
inline
35507 : NetworkPacket<ZoneSession>(ID_ZC_NPCACK_MAPMOVE, s)
35508 {}
@ ID_ZC_NPCACK_MAPMOVE
Definition: TransmittedPackets.hpp:35480

◆ ~ZC_NPCACK_MAPMOVE()

virtual Horizon::Zone::ZC_NPCACK_MAPMOVE::~ZC_NPCACK_MAPMOVE ( )
inlinevirtual
35509{}

Member Function Documentation

◆ deliver()

void ZC_NPCACK_MAPMOVE::deliver ( std::string  map_name,
int16_t  x,
int16_t  y 
)

ZC_NPCACK_MAPMOVE.

2329{
2330 if (map_name.size() + 4 > MAP_NAME_LENGTH_EXT) {
2331 HLog(error) << "Copying '.gat' to map name " << map_name << " would exceed length.";
2332 return;
2333 }
2334
2335 map_name.append(".gat");
2336 strncpy(_map_name, map_name.c_str(), MAP_NAME_LENGTH_EXT);
2337 _x = x;
2338 _y = y;
2339
2340 serialize();
2341 transmit();
2342}
#define MAP_NAME_LENGTH_EXT
Definition: Client.hpp:47
#define HLog(type)
Definition: Logger.hpp:122
void transmit()
Send an Asynchronous packet by queueing a buffer of a particular size to the connected session.
Definition: NetworkPacket.hpp:94
int16_t _x
Definition: TransmittedPackets.hpp:35516
int16_t _y
Definition: TransmittedPackets.hpp:35517
ByteBuffer & serialize()
Definition: TransmittedPackets.cpp:2344
char _map_name[MAP_NAME_LENGTH_EXT]
Definition: TransmittedPackets.hpp:35515

References _map_name, _x, _y, HLog, MAP_NAME_LENGTH_EXT, serialize(), and Horizon::Base::NetworkPacket< ZoneSession >::transmit().

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

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

◆ serialize()

ByteBuffer & ZC_NPCACK_MAPMOVE::serialize ( )
2345{
2346 buf() << _packet_id;
2348 buf() << _x;
2349 buf() << _y;
2350 return buf();
2351}
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 _map_name, Horizon::Base::NetworkPacket< ZoneSession >::_packet_id, _x, _y, ByteBuffer::append(), Horizon::Base::NetworkPacket< ZoneSession >::buf(), and MAP_NAME_LENGTH_EXT.

Referenced by deliver().

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

Member Data Documentation

◆ _map_name

char Horizon::Zone::ZC_NPCACK_MAPMOVE::_map_name[MAP_NAME_LENGTH_EXT] {0}

Referenced by deliver(), and serialize().

◆ _x

int16_t Horizon::Zone::ZC_NPCACK_MAPMOVE::_x {0}

Referenced by deliver(), and serialize().

◆ _y

int16_t Horizon::Zone::ZC_NPCACK_MAPMOVE::_y {0}

Referenced by deliver(), and serialize().


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