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

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

#include <TransmittedPackets.hpp>

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

Public Member Functions

 HC_SECOND_PASSWD_LOGIN (std::shared_ptr< CharSession > s)
 
virtual ~HC_SECOND_PASSWD_LOGIN ()
 
void deliver (hc_pincode_state_type state)
 HC_SECOND_PASSWD_LOGIN. More...
 
void deliver (hc_pincode_state_type state, hc_pincode_login_response2 state2)
 
ByteBufferserialize ()
 
- 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

uint32_t _pincode_seed { 0 }
 
uint32_t _account_id { 0 }
 
hc_pincode_state_type _state { PINCODE_CORRECT }
 
hc_pincode_login_response2 _state2 { PINCODE_LOGIN_FLAG_WRONG }
 

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

Constructor & Destructor Documentation

◆ HC_SECOND_PASSWD_LOGIN()

Horizon::Char::HC_SECOND_PASSWD_LOGIN::HC_SECOND_PASSWD_LOGIN ( std::shared_ptr< CharSession s)
inline
1237 : NetworkPacket<CharSession>(ID_HC_SECOND_PASSWD_LOGIN, s)
1238 {}
@ ID_HC_SECOND_PASSWD_LOGIN
Definition: TransmittedPackets.hpp:1184

◆ ~HC_SECOND_PASSWD_LOGIN()

virtual Horizon::Char::HC_SECOND_PASSWD_LOGIN::~HC_SECOND_PASSWD_LOGIN ( )
inlinevirtual
1239{}

Member Function Documentation

◆ deliver() [1/2]

void HC_SECOND_PASSWD_LOGIN::deliver ( hc_pincode_state_type  state)

HC_SECOND_PASSWD_LOGIN.

565{
566 _pincode_seed = rand() % 0xFFFF;
567 get_session()->get_session_data()._pincode_seed = _pincode_seed;
568
569 _account_id = get_session()->get_session_data()._account_id;
570 _state = state;
571
572 serialize();
573 transmit();
574}
void transmit()
Send an Asynchronous packet by queueing a buffer of a particular size to the connected session.
Definition: NetworkPacket.hpp:94
std::shared_ptr< CharSession > get_session()
Retrieves the session from this handler instance.
Definition: NetworkPacket.hpp:65
uint32_t _account_id
Definition: TransmittedPackets.hpp:1252
hc_pincode_state_type _state
Definition: TransmittedPackets.hpp:1253
ByteBuffer & serialize()
Definition: TransmittedPackets.cpp:586
uint32_t _pincode_seed
Definition: TransmittedPackets.hpp:1251

References _account_id, _pincode_seed, _state, Horizon::Base::NetworkPacket< CharSession >::get_session(), serialize(), and Horizon::Base::NetworkPacket< CharSession >::transmit().

Referenced by Horizon::Char::CharClientInterface::authorize_new_connection(), deliver(), Horizon::Char::CharClientInterface::pincode_change(), Horizon::Char::CharClientInterface::pincode_create(), and Horizon::Char::CharClientInterface::pincode_verify().

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

◆ deliver() [2/2]

void HC_SECOND_PASSWD_LOGIN::deliver ( hc_pincode_state_type  state,
hc_pincode_login_response2  state2 
)
580{
581 _state2 = state2;
582 deliver(state);
583}
void deliver(hc_pincode_state_type state)
HC_SECOND_PASSWD_LOGIN.
Definition: TransmittedPackets.cpp:564
hc_pincode_login_response2 _state2
Definition: TransmittedPackets.hpp:1257

References _state2, and deliver().

+ Here is the call graph for this function:

◆ serialize()

ByteBuffer & HC_SECOND_PASSWD_LOGIN::serialize ( )
587{
588 buf() << _packet_id;
589 buf() << _pincode_seed;
590 buf() << _account_id;
591 buf() << ((short)_state);
592#if CLIENT_TYPE == 'M' && PACKET_VERSION >= 20180124 \
593|| CLIENT_TYPE == 'R' && PACKET_VERSION >= 20180124 \
594|| CLIENT_TYPE == 'Z' && PACKET_VERSION >= 20180131
595 buf() << (uint8_t)_state2;
596#endif
597
598 return buf();
599}
uint16_t _packet_id
ID of the network packet.
Definition: NetworkPacket.hpp:87
ByteBuffer & buf()
Definition: NetworkPacket.hpp:59

References _account_id, Horizon::Base::NetworkPacket< CharSession >::_packet_id, _pincode_seed, _state, _state2, and Horizon::Base::NetworkPacket< CharSession >::buf().

Referenced by deliver().

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

Member Data Documentation

◆ _account_id

uint32_t Horizon::Char::HC_SECOND_PASSWD_LOGIN::_account_id { 0 }

Referenced by deliver(), and serialize().

◆ _pincode_seed

uint32_t Horizon::Char::HC_SECOND_PASSWD_LOGIN::_pincode_seed { 0 }

Referenced by deliver(), and serialize().

◆ _state

hc_pincode_state_type Horizon::Char::HC_SECOND_PASSWD_LOGIN::_state { PINCODE_CORRECT }

Referenced by deliver(), and serialize().

◆ _state2

hc_pincode_login_response2 Horizon::Char::HC_SECOND_PASSWD_LOGIN::_state2 { PINCODE_LOGIN_FLAG_WRONG }

Referenced by deliver(), and serialize().


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