TrinityCore
Loading...
Searching...
No Matches
AuthSession Struct Referencefinal

#include <AuthSession.h>

+ Inheritance diagram for AuthSession:

Public Member Functions

 AuthSession (Trinity::Net::IoContextTcpSocket &&socket)
 
void Start () override
 
bool Update () override
 
void SendPacket (ByteBuffer &packet)
 
Trinity::Net::SocketReadCallbackResult ReadHandler () override
 
void QueueQuery (QueryCallback &&queryCallback)
 
- Public Member Functions inherited from Trinity::Net::Socket< Stream >
template<typename... Args>
 Socket (IoContextTcpSocket &&socket, Args &&... args)
 
template<typename... Args>
 Socket (boost::asio::io_context &context, Args &&... args)
 
 Socket (Socket const &other)=delete
 
 Socket (Socket &&other)=delete
 
Socket & operator= (Socket const &other)=delete
 
Socket & operator= (Socket &&other)=delete
 
virtual ~Socket ()
 
boost::asio::ip::address const & GetRemoteIpAddress () const
 
uint16 GetRemotePort () const
 
template<SocketReadCallback Callback>
void AsyncRead (Callback &&callback)
 
void QueuePacket (MessageBuffer &&buffer)
 
bool IsOpen () const
 
void CloseSocket ()
 
void DelayedCloseSocket ()
 Marks the socket for closing after write buffer becomes empty.
 
MessageBuffer & GetReadBuffer ()
 
Stream & underlying_stream ()
 

Public Attributes

uint32 BattlegroupID = 0
 
uint32 LoginServerType = 0
 
uint32 RealmID = 0
 
uint32 Build = 0
 
std::array< uint8, 4 > LocalChallenge = {}
 
uint32 LoginServerID = 0
 
uint32 RegionID = 0
 
uint64 DosResponse = 0
 
Trinity::Crypto::SHA1::Digest Digest = {}
 
std::string Account
 
ByteBuffer AddonInfo
 

Private Types

using AuthSocket = Socket
 

Private Member Functions

bool HandleLogonChallenge ()
 
bool HandleLogonProof ()
 
bool HandleReconnectChallenge ()
 
bool HandleReconnectProof ()
 
bool HandleRealmList ()
 
bool HandleXferAccept ()
 
bool HandleXferResume ()
 
bool HandleXferCancel ()
 
void LogonChallengeCallback (PreparedQueryResult result)
 
void ReconnectChallengeCallback (PreparedQueryResult result)
 
void RealmListCallback (PreparedQueryResult result)
 
bool VerifyVersion (std::span< uint8 const > a, Trinity::Crypto::SHA1::Digest const &versionProof, bool isReconnect)
 
void SetTimeout ()
 

Private Attributes

friend AuthHandlerTable
 
Optional< Trinity::Crypto::SRP6 > _srp6
 
SessionKey _sessionKey = {}
 
std::array< uint8, 16 > _reconnectProof = {}
 
Trinity::Asio::DeadlineTimer _timeout
 
AuthStatus _status
 
AccountInfo _accountInfo
 
Optional< std::vector< uint8 > > _totpSecret
 
LocaleConstant _locale
 
uint32 _os
 
std::string_view _ipCountry
 
uint16 _build
 
uint8 _expversion
 
Minutes _timezoneOffset
 
QueryCallbackProcessor _queryProcessor
 

Additional Inherited Members

- Protected Member Functions inherited from Trinity::Net::Socket< Stream >
virtual void OnClose ()
 
bool AsyncProcessQueue ()
 
void SetNoDelay (bool enable)
 

Detailed Description

Definition at line 64 of file AuthSession.h.

Member Typedef Documentation

◆ AuthSocket

Definition at line 66 of file AuthSession.h.

Constructor & Destructor Documentation

◆ AuthSession()

AuthSession::AuthSession ( Trinity::Net::IoContextTcpSocket &&  socket)

Definition at line 201 of file AuthSession.cpp.

Member Function Documentation

◆ HandleLogonChallenge()

◆ HandleLogonProof()

◆ HandleRealmList()

◆ HandleReconnectChallenge()

◆ HandleReconnectProof()

◆ HandleXferAccept()

bool AuthSession::HandleXferAccept ( )
private

Definition at line 829 of file AuthSession.cpp.

References TC_LOG_DEBUG.

Referenced by AuthHandlerTable::AuthHandlerTable().

◆ HandleXferCancel()

bool AuthSession::HandleXferCancel ( )
private

Definition at line 845 of file AuthSession.cpp.

References TC_LOG_DEBUG.

Referenced by AuthHandlerTable::AuthHandlerTable().

◆ HandleXferResume()

bool AuthSession::HandleXferResume ( )
private

Definition at line 837 of file AuthSession.cpp.

References TC_LOG_DEBUG.

Referenced by AuthHandlerTable::AuthHandlerTable().

◆ LogonChallengeCallback()

◆ QueueQuery()

void AuthSession::QueueQuery ( QueryCallback &&  queryCallback)

◆ ReadHandler()

◆ RealmListCallback()

◆ ReconnectChallengeCallback()

◆ SendPacket()

◆ SetTimeout()

void AuthSession::SetTimeout ( )
private

Definition at line 883 of file AuthSession.cpp.

References _status, _timeout, STATUS_AUTHED, STATUS_WAITING_FOR_REALM_LIST, STATUS_XFER, and TC_LOG_DEBUG.

Referenced by ReadHandler(), and Start().

◆ Start()

◆ Update()

bool AuthSession::Update ( )
overridevirtual

◆ VerifyVersion()

Member Data Documentation

◆ _accountInfo

◆ _build

uint16 AuthSession::_build
private

◆ _expversion

uint8 AuthSession::_expversion
private

◆ _ipCountry

std::string_view AuthSession::_ipCountry
private

Definition at line 108 of file AuthSession.h.

Referenced by LogonChallengeCallback().

◆ _locale

LocaleConstant AuthSession::_locale
private

◆ _os

uint32 AuthSession::_os
private

◆ _queryProcessor

QueryCallbackProcessor AuthSession::_queryProcessor
private

Definition at line 113 of file AuthSession.h.

Referenced by QueueQuery(), and Update().

◆ _reconnectProof

std::array<uint8, 16> AuthSession::_reconnectProof = {}
private

Definition at line 100 of file AuthSession.h.

Referenced by HandleReconnectProof(), and ReconnectChallengeCallback().

◆ _sessionKey

SessionKey AuthSession::_sessionKey = {}
private

◆ _srp6

Optional<Trinity::Crypto::SRP6> AuthSession::_srp6
private

Definition at line 98 of file AuthSession.h.

Referenced by HandleLogonProof(), and LogonChallengeCallback().

◆ _status

◆ _timeout

Trinity::Asio::DeadlineTimer AuthSession::_timeout
private

Definition at line 102 of file AuthSession.h.

Referenced by SetTimeout().

◆ _timezoneOffset

Minutes AuthSession::_timezoneOffset
private

Definition at line 111 of file AuthSession.h.

Referenced by HandleLogonChallenge(), HandleLogonProof(), and HandleReconnectChallenge().

◆ _totpSecret

Optional<std::vector<uint8> > AuthSession::_totpSecret
private

Definition at line 105 of file AuthSession.h.

Referenced by HandleLogonProof(), and LogonChallengeCallback().

◆ Account

std::string AuthSession::Account

Definition at line 241 of file WorldSocket.cpp.

◆ AddonInfo

ByteBuffer AuthSession::AddonInfo

Definition at line 242 of file WorldSocket.cpp.

◆ AuthHandlerTable

friend AuthSession::AuthHandlerTable
private

Definition at line 81 of file AuthSession.h.

◆ BattlegroupID

uint32 AuthSession::BattlegroupID = 0

Definition at line 232 of file WorldSocket.cpp.

◆ Build

uint32 AuthSession::Build = 0

Definition at line 235 of file WorldSocket.cpp.

◆ Digest

Trinity::Crypto::SHA1::Digest AuthSession::Digest = {}

Definition at line 240 of file WorldSocket.cpp.

◆ DosResponse

uint64 AuthSession::DosResponse = 0

Definition at line 239 of file WorldSocket.cpp.

◆ LocalChallenge

std::array<uint8, 4> AuthSession::LocalChallenge = {}

Definition at line 236 of file WorldSocket.cpp.

◆ LoginServerID

uint32 AuthSession::LoginServerID = 0

Definition at line 237 of file WorldSocket.cpp.

◆ LoginServerType

uint32 AuthSession::LoginServerType = 0

Definition at line 233 of file WorldSocket.cpp.

◆ RealmID

uint32 AuthSession::RealmID = 0

Definition at line 234 of file WorldSocket.cpp.

◆ RegionID

uint32 AuthSession::RegionID = 0

Definition at line 238 of file WorldSocket.cpp.


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