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

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

#include <TransmittedPackets.hpp>

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

Public Member Functions

 ZC_ACCEPT_ENTER3 (std::shared_ptr< ZoneSession > s)
 
virtual ~ZC_ACCEPT_ENTER3 ()
 
void deliver (int16_t x, int16_t y, int16_t dir, int16_t font, unit_gender_types gender)
 ZC_ACCEPT_ENTER3. 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 _start_time {0}
 
char _packed_pos [3] {0}
 
int8_t _x_size {0}
 
int8_t _y_size {0}
 
int16_t _font {0}
 
int8_t _gender {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_ACCEPT_ENTER3.

Constructor & Destructor Documentation

◆ ZC_ACCEPT_ENTER3()

Horizon::Zone::ZC_ACCEPT_ENTER3::ZC_ACCEPT_ENTER3 ( std::shared_ptr< ZoneSession s)
inline
14538 : NetworkPacket<ZoneSession>(ID_ZC_ACCEPT_ENTER3, s)
14539 {}
@ ID_ZC_ACCEPT_ENTER3
Definition: TransmittedPackets.hpp:14514

◆ ~ZC_ACCEPT_ENTER3()

virtual Horizon::Zone::ZC_ACCEPT_ENTER3::~ZC_ACCEPT_ENTER3 ( )
inlinevirtual
14540{}

Member Function Documentation

◆ deliver()

void ZC_ACCEPT_ENTER3::deliver ( int16_t  x,
int16_t  y,
int16_t  dir,
int16_t  font,
unit_gender_types  gender 
)

ZC_ACCEPT_ENTER3.

5767{
5768 PackPosition((int8_t *) _packed_pos, x, y, dir);
5769 _start_time = (int32_t) get_sys_time();
5770 _x_size = _y_size = 5;
5771 _font = font;
5772 _gender = (int) gender;
5773
5774 serialize();
5775 transmit();
5776}
int64_t get_sys_time()
Definition: Utility.cpp:68
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
int8_t _x_size
Definition: TransmittedPackets.hpp:14548
int32_t _start_time
Definition: TransmittedPackets.hpp:14546
char _packed_pos[3]
Definition: TransmittedPackets.hpp:14547
int8_t _y_size
Definition: TransmittedPackets.hpp:14549
int16_t _font
Definition: TransmittedPackets.hpp:14550
ByteBuffer & serialize()
Definition: TransmittedPackets.cpp:5777
int8_t _gender
Definition: TransmittedPackets.hpp:14551

References _font, _gender, _packed_pos, _start_time, _x_size, _y_size, get_sys_time(), PackPosition(), serialize(), and Horizon::Base::NetworkPacket< ZoneSession >::transmit().

+ Here is the call graph for this function:

◆ serialize()

ByteBuffer & ZC_ACCEPT_ENTER3::serialize ( )
5778{
5779 buf() << _packet_id;
5780 buf() << _start_time;
5781 buf().append(_packed_pos, sizeof(_packed_pos));
5782 buf() << _x_size << _y_size << _font;
5783 buf() << _gender;
5784 return buf();
5785}
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 _font, _gender, _packed_pos, Horizon::Base::NetworkPacket< ZoneSession >::_packet_id, _start_time, _x_size, _y_size, 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

◆ _font

int16_t Horizon::Zone::ZC_ACCEPT_ENTER3::_font {0}

Referenced by deliver(), and serialize().

◆ _gender

int8_t Horizon::Zone::ZC_ACCEPT_ENTER3::_gender {0}

Referenced by deliver(), and serialize().

◆ _packed_pos

char Horizon::Zone::ZC_ACCEPT_ENTER3::_packed_pos[3] {0}

Referenced by deliver(), and serialize().

◆ _start_time

int32_t Horizon::Zone::ZC_ACCEPT_ENTER3::_start_time {0}

Referenced by deliver(), and serialize().

◆ _x_size

int8_t Horizon::Zone::ZC_ACCEPT_ENTER3::_x_size {0}

Referenced by deliver(), and serialize().

◆ _y_size

int8_t Horizon::Zone::ZC_ACCEPT_ENTER3::_y_size {0}

Referenced by deliver(), and serialize().


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