Horizon Official Technical Documentation
|
|
#include <AuthSession.hpp>
Public Member Functions | |
AuthSession (uint64_t uid) | |
~AuthSession () | |
void | initialize () override |
virtual void | update (uint32_t diff) override |
std::unique_ptr< AuthClientInterface > & | clif () |
std::unique_ptr< ClientPacketLengthTable > & | pkt_tbl () |
void | transmit_buffer (ByteBuffer _buffer, std::size_t size) |
![]() | |
Session (uint64_t uid) | |
virtual | ~Session () |
std::shared_ptr< AuthSocket > | get_socket () |
Get the socket. More... | |
void | set_socket (std::weak_ptr< AuthSocket > socket) |
Set the socket. More... | |
virtual void | update (uint32_t diff)=0 |
virtual void | initialize ()=0 |
bool | is_initialized () |
Called to verify if the session is initialized. More... | |
void | set_initialized (bool initialized) |
Set whether the session is initialized or not. More... | |
uint64_t | get_session_id () |
Get the unique id of the session. More... | |
ThreadSafeQueue< ByteBuffer > & | get_recv_queue () |
Receive queue of the buffer received by the socket. More... | |
Private Attributes | |
std::unique_ptr< AuthClientInterface > | _clif |
std::unique_ptr< ClientPacketLengthTable > | _pkt_tbl |
AuthSession::AuthSession | ( | uint64_t | uid | ) |
AuthSession::~AuthSession | ( | ) |
|
inline |
References _clif.
|
overridevirtual |
Called when the session is started. Virtual method that must be implmented by the derived class. Typically used to initialize the session.
Implements Horizon::Networking::Session< AuthSocket, AuthSession >.
References _clif, _pkt_tbl, and Horizon::Networking::Session< AuthSocket, AuthSession >::set_initialized().
|
inline |
void AuthSession::transmit_buffer | ( | ByteBuffer | _buffer, |
std::size_t | size | ||
) |
References _pkt_tbl, ByteBuffer::active_length(), ByteBuffer::get_read_pointer(), Horizon::Networking::Session< AuthSocket, AuthSession >::get_socket(), HLog, and ByteBuffer::is_empty().
|
overridevirtual |
Called when the session is started. Virtual method that must be implmented by the derived class. Typically used to update the session and process packets.
Implements Horizon::Networking::Session< AuthSocket, AuthSession >.
References _pkt_tbl, and Horizon::Networking::Session< AuthSocket, AuthSession >::get_recv_queue().
|
private |
Referenced by clif(), and initialize().
|
private |
Referenced by initialize(), pkt_tbl(), transmit_buffer(), and update().