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

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

#include <TransmittedPackets.hpp>

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

Public Member Functions

 HC_EDIT_SECOND_PASSWD (std::shared_ptr< CharSession > s)
 
virtual ~HC_EDIT_SECOND_PASSWD ()
 
void deliver (pincode_edit_response state)
 HC_EDIT_SECOND_PASSWD. More...
 
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

pincode_edit_response _state
 
uint32_t _seed
 

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_EDIT_SECOND_PASSWD.

Constructor & Destructor Documentation

◆ HC_EDIT_SECOND_PASSWD()

Horizon::Char::HC_EDIT_SECOND_PASSWD::HC_EDIT_SECOND_PASSWD ( std::shared_ptr< CharSession s)
inline
778 : NetworkPacket<CharSession>(ID_HC_EDIT_SECOND_PASSWD, s)
779 {}
@ ID_HC_EDIT_SECOND_PASSWD
Definition: TransmittedPackets.hpp:753

◆ ~HC_EDIT_SECOND_PASSWD()

virtual Horizon::Char::HC_EDIT_SECOND_PASSWD::~HC_EDIT_SECOND_PASSWD ( )
inlinevirtual
780{}

Member Function Documentation

◆ deliver()

void HC_EDIT_SECOND_PASSWD::deliver ( pincode_edit_response  state)

HC_EDIT_SECOND_PASSWD.

515{
516 _seed = rand() % 0xFFFF;
517
518 _state = state;
519
520 get_session()->get_session_data()._pincode_seed = _seed;
521
522 serialize();
523 transmit();
524}
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
ByteBuffer & serialize()
Definition: TransmittedPackets.cpp:526
pincode_edit_response _state
Definition: TransmittedPackets.hpp:786
uint32_t _seed
Definition: TransmittedPackets.hpp:787

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

Referenced by Horizon::Char::CharClientInterface::pincode_change().

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

◆ serialize()

ByteBuffer & HC_EDIT_SECOND_PASSWD::serialize ( )
527{
528 buf() << _packet_id;
529 buf() << (short)_state;
530 buf() << _seed;
531 return buf();
532}
uint16_t _packet_id
ID of the network packet.
Definition: NetworkPacket.hpp:87
ByteBuffer & buf()
Definition: NetworkPacket.hpp:59

References Horizon::Base::NetworkPacket< CharSession >::_packet_id, _seed, _state, 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

◆ _seed

uint32_t Horizon::Char::HC_EDIT_SECOND_PASSWD::_seed

Referenced by deliver(), and serialize().

◆ _state

pincode_edit_response Horizon::Char::HC_EDIT_SECOND_PASSWD::_state

Referenced by deliver(), and serialize().


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