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

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

#include <HandledPackets.hpp>

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

Public Member Functions

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

uint32_t _account_id
 
char _new_pin [MAX_PINCODE_STRING_LENGTH]
 

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

Constructor & Destructor Documentation

◆ CH_MAKE_SECOND_PASSWD()

Horizon::Char::CH_MAKE_SECOND_PASSWD::CH_MAKE_SECOND_PASSWD ( std::shared_ptr< CharSession s)
inline
664 : NetworkPacket<CharSession>(ID_CH_MAKE_SECOND_PASSWD, s)
665 {}
@ ID_CH_MAKE_SECOND_PASSWD
Definition: HandledPackets.hpp:645

◆ ~CH_MAKE_SECOND_PASSWD()

virtual Horizon::Char::CH_MAKE_SECOND_PASSWD::~CH_MAKE_SECOND_PASSWD ( )
inlinevirtual
666{}

Member Function Documentation

◆ deserialize()

void CH_MAKE_SECOND_PASSWD::deserialize ( ByteBuffer buf)
virtual

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

269{
270 memset(_new_pin, '\0', MAX_PINCODE_STRING_LENGTH);
271
272 buf >> _packet_id;
273 buf >> _account_id;
275}
#define MAX_PINCODE_STRING_LENGTH
Definition: Client.hpp:42
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
char _new_pin[MAX_PINCODE_STRING_LENGTH]
Definition: HandledPackets.hpp:673
uint32_t _account_id
Definition: HandledPackets.hpp:672

References _account_id, _new_pin, Horizon::Base::NetworkPacket< CharSession >::_packet_id, Horizon::Base::NetworkPacket< CharSession >::buf(), MAX_PINCODE_STRING_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_SECOND_PASSWD::handle ( ByteBuffer &&  buf)
virtual

CH_MAKE_SECOND_PASSWD.

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

263{
265 get_session()->clif()->pincode_create(_account_id, _new_pin);
266}
std::shared_ptr< CharSession > get_session()
Retrieves the session from this handler instance.
Definition: NetworkPacket.hpp:65
void deserialize(ByteBuffer &buf)
Definition: HandledPackets.cpp:268

References _account_id, _new_pin, Horizon::Base::NetworkPacket< CharSession >::buf(), deserialize(), and Horizon::Base::NetworkPacket< CharSession >::get_session().

+ Here is the call graph for this function:

Member Data Documentation

◆ _account_id

uint32_t Horizon::Char::CH_MAKE_SECOND_PASSWD::_account_id

Referenced by deserialize(), and handle().

◆ _new_pin

char Horizon::Char::CH_MAKE_SECOND_PASSWD::_new_pin[MAX_PINCODE_STRING_LENGTH]

Referenced by deserialize(), and handle().


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