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

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

#include <TransmittedPackets.hpp>

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

Public Member Functions

 AC_LOGIN_OTP (std::shared_ptr< AuthSession > s)
 
virtual ~AC_LOGIN_OTP ()
 
void deliver ()
 AC_LOGIN_OTP. More...
 
ByteBufferserialize ()
 
- 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

int16_t _packet_length { 0 }
 
int32_t _loginFlag { 0 }
 
char _loginFlag2 [20]
 
char _token [6]
 

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: AC_LOGIN_OTP.

Constructor & Destructor Documentation

◆ AC_LOGIN_OTP()

Horizon::Auth::AC_LOGIN_OTP::AC_LOGIN_OTP ( std::shared_ptr< AuthSession s)
inline
676 : NetworkPacket<AuthSession>(ID_AC_LOGIN_OTP, s)
677 {}
@ ID_AC_LOGIN_OTP
Definition: TransmittedPackets.hpp:648

◆ ~AC_LOGIN_OTP()

virtual Horizon::Auth::AC_LOGIN_OTP::~AC_LOGIN_OTP ( )
inlinevirtual
678{}

Member Function Documentation

◆ deliver()

void AC_LOGIN_OTP::deliver ( )

AC_LOGIN_OTP.

363{
364 _packet_length = 28 + 6;
365 _loginFlag = 0; // normal login
366 std::strncpy(_loginFlag2, "S1000", 20);
367 std::strncpy(_token, "token", 6);
368
369 serialize();
370 transmit();
371}
int32_t _loginFlag
Definition: TransmittedPackets.hpp:685
char _loginFlag2[20]
Definition: TransmittedPackets.hpp:688
ByteBuffer & serialize()
Definition: TransmittedPackets.cpp:372
char _token[6]
Definition: TransmittedPackets.hpp:692
int16_t _packet_length
Definition: TransmittedPackets.hpp:684
void transmit()
Send an Asynchronous packet by queueing a buffer of a particular size to the connected session.
Definition: NetworkPacket.hpp:94

References _loginFlag, _loginFlag2, _packet_length, _token, serialize(), and Horizon::Base::NetworkPacket< AuthSession >::transmit().

Referenced by Horizon::Auth::AuthClientInterface::client_login_otp_response().

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

◆ serialize()

ByteBuffer & AC_LOGIN_OTP::serialize ( )
373{
374 buf() << _packet_id;
375 buf() << _packet_length;
376 buf() << _loginFlag;
377 buf().append(_loginFlag2, 20);
378 buf().append(_token, 6);
379 return buf();
380}
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 _loginFlag, _loginFlag2, Horizon::Base::NetworkPacket< AuthSession >::_packet_id, _packet_length, _token, ByteBuffer::append(), and Horizon::Base::NetworkPacket< AuthSession >::buf().

Referenced by deliver().

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

Member Data Documentation

◆ _loginFlag

int32_t Horizon::Auth::AC_LOGIN_OTP::_loginFlag { 0 }

Referenced by deliver(), and serialize().

◆ _loginFlag2

char Horizon::Auth::AC_LOGIN_OTP::_loginFlag2[20]

Referenced by deliver(), and serialize().

◆ _packet_length

int16_t Horizon::Auth::AC_LOGIN_OTP::_packet_length { 0 }

Referenced by deliver(), and serialize().

◆ _token

char Horizon::Auth::AC_LOGIN_OTP::_token[6]

Referenced by deliver(), and serialize().


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