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

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

#include <TransmittedPackets.hpp>

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

Public Member Functions

 ZC_NOTIFY_MOVE (std::shared_ptr< ZoneSession > s)
 
virtual ~ZC_NOTIFY_MOVE ()
 
void deliver (int32_t guid, int32_t time, int16_t from_x, int16_t from_y, int16_t to_x, int16_t to_y)
 ZC_NOTIFY_MOVE. 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

int32_t _guid {0}
 
int32_t _timestamp {0}
 
char _packed_pos [6] {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_NOTIFY_MOVE.

Constructor & Destructor Documentation

◆ ZC_NOTIFY_MOVE()

Horizon::Zone::ZC_NOTIFY_MOVE::ZC_NOTIFY_MOVE ( std::shared_ptr< ZoneSession s)
inline
33313 : NetworkPacket<ZoneSession>(ID_ZC_NOTIFY_MOVE, s)
33314 {}
@ ID_ZC_NOTIFY_MOVE
Definition: TransmittedPackets.hpp:33286

◆ ~ZC_NOTIFY_MOVE()

virtual Horizon::Zone::ZC_NOTIFY_MOVE::~ZC_NOTIFY_MOVE ( )
inlinevirtual
33315{}

Member Function Documentation

◆ deliver()

void ZC_NOTIFY_MOVE::deliver ( int32_t  guid,
int32_t  time,
int16_t  from_x,
int16_t  from_y,
int16_t  to_x,
int16_t  to_y 
)

ZC_NOTIFY_MOVE.

2041{
2042 _guid = guid;
2043 _timestamp = time;
2044 PackPosition((int8_t *) _packed_pos, from_x, from_y, to_x, to_y, 8, 8);
2045
2046 serialize();
2047 transmit();
2048}
void PackPosition(int8_t *p, uint16_t x, uint16_t y, uint8_t dir)
Definition: Utility.cpp:141
void transmit()
Send an Asynchronous packet by queueing a buffer of a particular size to the connected session.
Definition: NetworkPacket.hpp:94
int32_t _guid
Definition: TransmittedPackets.hpp:33321
char _packed_pos[6]
Definition: TransmittedPackets.hpp:33323
int32_t _timestamp
Definition: TransmittedPackets.hpp:33322
ByteBuffer & serialize()
Definition: TransmittedPackets.cpp:2050

References _guid, _packed_pos, _timestamp, PackPosition(), serialize(), and Horizon::Base::NetworkPacket< ZoneSession >::transmit().

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

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

◆ serialize()

ByteBuffer & ZC_NOTIFY_MOVE::serialize ( )
2051{
2052 buf() << _packet_id;
2053 buf() << _guid;
2054 buf().append(_packed_pos, sizeof(_packed_pos));
2055 buf() << _timestamp;
2056 return buf();
2057}
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 _guid, _packed_pos, Horizon::Base::NetworkPacket< ZoneSession >::_packet_id, _timestamp, ByteBuffer::append(), 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

◆ _guid

int32_t Horizon::Zone::ZC_NOTIFY_MOVE::_guid {0}

Referenced by deliver(), and serialize().

◆ _packed_pos

char Horizon::Zone::ZC_NOTIFY_MOVE::_packed_pos[6] {0}

Referenced by deliver(), and serialize().

◆ _timestamp

int32_t Horizon::Zone::ZC_NOTIFY_MOVE::_timestamp {0}

Referenced by deliver(), and serialize().


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