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

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

#include <HandledPackets.hpp>

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

Public Member Functions

 CH_MAKE_CHAR (std::shared_ptr< CharSession > s)
 
virtual ~CH_MAKE_CHAR ()
 
void handle (ByteBuffer &&buf)
 CH_MAKE_CHAR. More...
 
void deserialize (ByteBuffer &buf)
 
- 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

char _name [MAX_UNIT_NAME_LENGTH] { 0 }
 
uint8_t _slot { 0 }
 
uint16_t _hair_color { 0 }
 
uint16_t _hair_style { 0 }
 
uint16_t _job_id { 0 }
 
char _unknown_bytes [2] { 0 }
 
uint8_t _gender { 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: CH_MAKE_CHAR.

Constructor & Destructor Documentation

◆ CH_MAKE_CHAR()

Horizon::Char::CH_MAKE_CHAR::CH_MAKE_CHAR ( std::shared_ptr< CharSession s)
inline
590 : NetworkPacket<CharSession>(ID_CH_MAKE_CHAR, s)
591 {}
@ ID_CH_MAKE_CHAR
Definition: HandledPackets.hpp:559

◆ ~CH_MAKE_CHAR()

virtual Horizon::Char::CH_MAKE_CHAR::~CH_MAKE_CHAR ( )
inlinevirtual
592{}

Member Function Documentation

◆ deserialize()

void CH_MAKE_CHAR::deserialize ( ByteBuffer buf)
virtual

Reimplemented from Horizon::Base::NetworkPacket< CharSession >.

95{
96 buf >> _packet_id;
98 buf >> _slot;
100 buf >> _hair_style;
101#if PACKET_VERSION >= 20151001
102 buf >> _job_id;
103 buf.read(_unknown_bytes, sizeof(short));
104 buf >> _gender;
105#endif
106}
#define MAX_UNIT_NAME_LENGTH
Definition: Client.hpp:34
T read()
Definition: ByteBuffer.hpp:379
uint16_t _packet_id
ID of the network packet.
Definition: NetworkPacket.hpp:87
ByteBuffer & buf()
Definition: NetworkPacket.hpp:59
uint16_t _job_id
Definition: HandledPackets.hpp:604
uint8_t _slot
Definition: HandledPackets.hpp:600
char _unknown_bytes[2]
Definition: HandledPackets.hpp:605
uint16_t _hair_style
Definition: HandledPackets.hpp:602
uint16_t _hair_color
Definition: HandledPackets.hpp:601
char _name[MAX_UNIT_NAME_LENGTH]
Definition: HandledPackets.hpp:599
uint8_t _gender
Definition: HandledPackets.hpp:606

References _gender, _hair_color, _hair_style, _job_id, _name, Horizon::Base::NetworkPacket< CharSession >::_packet_id, _slot, _unknown_bytes, Horizon::Base::NetworkPacket< CharSession >::buf(), MAX_UNIT_NAME_LENGTH, and ByteBuffer::read().

Referenced by handle().

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

◆ handle()

void CH_MAKE_CHAR::handle ( ByteBuffer &&  buf)
virtual

CH_MAKE_CHAR.

Reimplemented from Horizon::Base::NetworkPacket< CharSession >.

84{
86
87#if PACKET_VERSION >= 20151001
88 get_session()->clif()->make_new_character(_name, _slot, _hair_color, _hair_style, _job_id, _gender);
89#elif PACKET_VERSION >= 20120307
90 get_session()->clif()->make_new_character(_name, _slot, _hair_color, _hair_style);
91#endif
92}
std::shared_ptr< CharSession > get_session()
Retrieves the session from this handler instance.
Definition: NetworkPacket.hpp:65
void deserialize(ByteBuffer &buf)
Definition: HandledPackets.cpp:94

References _gender, _hair_color, _hair_style, _job_id, _name, _slot, Horizon::Base::NetworkPacket< CharSession >::buf(), deserialize(), and Horizon::Base::NetworkPacket< CharSession >::get_session().

+ Here is the call graph for this function:

Member Data Documentation

◆ _gender

uint8_t Horizon::Char::CH_MAKE_CHAR::_gender { 0 }

Referenced by deserialize(), and handle().

◆ _hair_color

uint16_t Horizon::Char::CH_MAKE_CHAR::_hair_color { 0 }

Referenced by deserialize(), and handle().

◆ _hair_style

uint16_t Horizon::Char::CH_MAKE_CHAR::_hair_style { 0 }

Referenced by deserialize(), and handle().

◆ _job_id

uint16_t Horizon::Char::CH_MAKE_CHAR::_job_id { 0 }

Referenced by deserialize(), and handle().

◆ _name

char Horizon::Char::CH_MAKE_CHAR::_name[MAX_UNIT_NAME_LENGTH] { 0 }

Referenced by deserialize(), and handle().

◆ _slot

uint8_t Horizon::Char::CH_MAKE_CHAR::_slot { 0 }

Referenced by deserialize(), and handle().

◆ _unknown_bytes

char Horizon::Char::CH_MAKE_CHAR::_unknown_bytes[2] { 0 }

Referenced by deserialize().


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