Horizon Official Technical Documentation
Horizon::Auth::CA_LOGIN Class Reference

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

#include <HandledPackets.hpp>

+ Inheritance diagram for Horizon::Auth::CA_LOGIN:
+ Collaboration diagram for Horizon::Auth::CA_LOGIN:

Public Member Functions

 CA_LOGIN (std::shared_ptr< AuthSession > s)
 
virtual ~CA_LOGIN ()
 
void handle (ByteBuffer &&buf)
 CA_LOGIN. More...
 
void deserialize (ByteBuffer &buf)
 
ByteBuffer serialize (int32_t version, std::string username, std::string password, uint8_t client_type)
 
- Public Member Functions inherited from Horizon::Base::NetworkPacket< AuthSession >
 NetworkPacket (uint16_t packet_id, std::shared_ptr< AuthSession > s)
 
virtual ~NetworkPacket ()
 
void set_packet_id (uint16_t id)
 
uint16_t get_packet_id ()
 
ByteBufferbuf ()
 
std::shared_ptr< AuthSession > 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 _version { 0 }
 Client Version Information. More...
 
char _username [24] { 0 }
 Username. More...
 
char _password [24] { 0 }
 Password. More...
 
uint8_t _client_type { 0 }
 Client Type. More...
 

Additional Inherited Members

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

Constructor & Destructor Documentation

◆ CA_LOGIN()

Horizon::Auth::CA_LOGIN::CA_LOGIN ( std::shared_ptr< AuthSession s)
inline
397 : NetworkPacket<AuthSession>(ID_CA_LOGIN, s)
398 {}
@ ID_CA_LOGIN
Definition: HandledPackets.hpp:375

◆ ~CA_LOGIN()

virtual Horizon::Auth::CA_LOGIN::~CA_LOGIN ( )
inlinevirtual
399{}

Member Function Documentation

◆ deserialize()

void CA_LOGIN::deserialize ( ByteBuffer buf)
virtual

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

56{
57 buf >> _packet_id;
58 buf >> _version;
59 buf.read(_username, sizeof(_username));
60 buf.read(_password, sizeof(_password));
62}
T read()
Definition: ByteBuffer.hpp:379
char _password[24]
Password.
Definition: HandledPackets.hpp:408
uint32_t _version
Client Version Information.
Definition: HandledPackets.hpp:406
char _username[24]
Username.
Definition: HandledPackets.hpp:407
uint8_t _client_type
Client Type.
Definition: HandledPackets.hpp:409
uint16_t _packet_id
ID of the network packet.
Definition: NetworkPacket.hpp:87
ByteBuffer & buf()
Definition: NetworkPacket.hpp:59

References _client_type, Horizon::Base::NetworkPacket< AuthSession >::_packet_id, _password, _username, _version, Horizon::Base::NetworkPacket< AuthSession >::buf(), and ByteBuffer::read().

Referenced by handle().

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

◆ handle()

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

CA_LOGIN.

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

49{
51
52 get_session()->clif()->process_login(_username, _password, _version, _client_type);
53}
void deserialize(ByteBuffer &buf)
Definition: HandledPackets.cpp:55
std::shared_ptr< AuthSession > get_session()
Retrieves the session from this handler instance.
Definition: NetworkPacket.hpp:65

References _client_type, _password, _username, _version, Horizon::Base::NetworkPacket< AuthSession >::buf(), deserialize(), and Horizon::Base::NetworkPacket< AuthSession >::get_session().

+ Here is the call graph for this function:

◆ serialize()

ByteBuffer CA_LOGIN::serialize ( int32_t  version,
std::string  username,
std::string  password,
uint8_t  client_type 
)
65{
66 _version = version;
67 std::strncpy(_username, username.c_str(), MAX_USERNAME_LENGTH);
68 std::strncpy(_password, password.c_str(), MAX_PASSWORD_LENGTH);
69 _client_type = client_type;
70
71 ByteBuffer &buf = this->_buffer;
72 buf << _packet_id;
73 buf << _version;
77
78 return buf;
79}
#define MAX_PASSWORD_LENGTH
Definition: Client.hpp:39
#define MAX_USERNAME_LENGTH
Definition: Client.hpp:38
Definition: ByteBuffer.hpp:78
void append(T value)
Definition: ByteBuffer.hpp:140
ByteBuffer _buffer
Buffer storage facility for the packet stream.
Definition: NetworkPacket.hpp:86

References Horizon::Base::NetworkPacket< AuthSession >::_buffer, _client_type, Horizon::Base::NetworkPacket< AuthSession >::_packet_id, _password, _username, _version, ByteBuffer::append(), Horizon::Base::NetworkPacket< AuthSession >::buf(), MAX_PASSWORD_LENGTH, and MAX_USERNAME_LENGTH.

+ Here is the call graph for this function:

Member Data Documentation

◆ _client_type

uint8_t Horizon::Auth::CA_LOGIN::_client_type { 0 }

Client Type.

Referenced by deserialize(), handle(), and serialize().

◆ _password

char Horizon::Auth::CA_LOGIN::_password[24] { 0 }

Password.

Referenced by deserialize(), handle(), and serialize().

◆ _username

char Horizon::Auth::CA_LOGIN::_username[24] { 0 }

Username.

Referenced by deserialize(), handle(), and serialize().

◆ _version

uint32_t Horizon::Auth::CA_LOGIN::_version { 0 }

Client Version Information.

Referenced by deserialize(), handle(), and serialize().


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