TrinityCore
|
#include <Session.h>
Classes | |
struct | AccountInfo |
struct | GameAccountInfo |
struct | LastPlayedCharacterInfo |
Public Member Functions | |
Session (boost::asio::ip::tcp::socket &&socket) | |
~Session () | |
void | Start () override |
bool | Update () override |
uint32 | GetAccountId () const |
uint32 | GetGameAccountId () const |
void | SendResponse (uint32 token, pb::Message const *response) |
void | SendResponse (uint32 token, uint32 status) |
void | SendRequest (uint32 serviceHash, uint32 methodId, pb::Message const *request, std::function< void(MessageBuffer)> callback) |
void | SendRequest (uint32 serviceHash, uint32 methodId, pb::Message const *request) |
uint32 | HandleLogon (authentication::v1::LogonRequest const *logonRequest, std::function< void(ServiceBase *, uint32, ::google::protobuf::Message const *)> &continuation) |
uint32 | HandleVerifyWebCredentials (authentication::v1::VerifyWebCredentialsRequest const *verifyWebCredentialsRequest, std::function< void(ServiceBase *, uint32, ::google::protobuf::Message const *)> &continuation) |
uint32 | HandleGenerateWebCredentials (authentication::v1::GenerateWebCredentialsRequest const *request, std::function< void(ServiceBase *, uint32, google::protobuf::Message const *)> &continuation) |
uint32 | HandleGetAccountState (account::v1::GetAccountStateRequest const *request, account::v1::GetAccountStateResponse *response) |
uint32 | HandleGetGameAccountState (account::v1::GetGameAccountStateRequest const *request, account::v1::GetGameAccountStateResponse *response) |
uint32 | HandleProcessClientRequest (game_utilities::v1::ClientRequest const *request, game_utilities::v1::ClientResponse *response) |
uint32 | HandleGetAllValuesForAttribute (game_utilities::v1::GetAllValuesForAttributeRequest const *request, game_utilities::v1::GetAllValuesForAttributeResponse *response) |
std::string | GetClientInfo () const |
Public Member Functions inherited from Socket< Session, SslSocket<> > | |
Socket (boost::asio::ip::tcp::socket &&socket, Args &&... args) | |
Socket (Socket const &other)=delete | |
Socket (Socket &&other)=delete | |
Socket & | operator= (Socket const &other)=delete |
Socket & | operator= (Socket &&other)=delete |
virtual | ~Socket () |
virtual void | Start ()=0 |
virtual bool | Update () |
boost::asio::ip::address | GetRemoteIpAddress () const |
uint16 | GetRemotePort () const |
void | AsyncRead () |
void | AsyncReadWithCallback (void(T::*callback)(boost::system::error_code const &, std::size_t)) |
void | QueuePacket (MessageBuffer &&buffer) |
bool | IsOpen () const |
void | CloseSocket () |
void | DelayedCloseSocket () |
Marks the socket for closing after write buffer becomes empty. More... | |
MessageBuffer & | GetReadBuffer () |
Protected Member Functions | |
void | HandshakeHandler (boost::system::error_code const &error) |
void | ReadHandler () override |
bool | ReadHeaderLengthHandler () |
bool | ReadHeaderHandler () |
bool | ReadDataHandler () |
Protected Member Functions inherited from Socket< Session, SslSocket<> > | |
virtual void | OnClose () |
virtual void | ReadHandler ()=0 |
bool | AsyncProcessQueue () |
void | SetNoDelay (bool enable) |
SslSocket<> & | underlying_stream () |
Private Types | |
typedef Socket< Session, SslSocket<> > | BattlenetSocket |
typedef uint32(Session::* | ClientRequestHandler) (std::unordered_map< std::string, Variant const * > const &, game_utilities::v1::ClientResponse *) |
Private Member Functions | |
void | AsyncWrite (MessageBuffer *packet) |
void | AsyncHandshake () |
void | CheckIpCallback (PreparedQueryResult result) |
uint32 | VerifyWebCredentials (std::string const &webCredentials, std::function< void(ServiceBase *, uint32, ::google::protobuf::Message const *)> &continuation) |
uint32 | GetRealmListTicket (std::unordered_map< std::string, Variant const * > const ¶ms, game_utilities::v1::ClientResponse *response) |
uint32 | GetLastCharPlayed (std::unordered_map< std::string, Variant const * > const ¶ms, game_utilities::v1::ClientResponse *response) |
uint32 | GetRealmList (std::unordered_map< std::string, Variant const * > const ¶ms, game_utilities::v1::ClientResponse *response) |
uint32 | JoinRealm (std::unordered_map< std::string, Variant const * > const ¶ms, game_utilities::v1::ClientResponse *response) |
Private Attributes | |
MessageBuffer | _headerLengthBuffer |
MessageBuffer | _headerBuffer |
MessageBuffer | _packetBuffer |
std::shared_ptr< AccountInfo > | _accountInfo |
GameAccountInfo * | _gameAccountInfo |
std::string | _locale |
std::string | _os |
uint32 | _build |
Minutes | _timezoneOffset |
std::string | _ipCountry |
std::array< uint8, 32 > | _clientSecret |
bool | _authed |
QueryCallbackProcessor | _queryProcessor |
std::unordered_map< uint32, std::function< void(MessageBuffer)> > | _responseCallbacks |
uint32 | _requestToken |
Static Private Attributes | |
static std::unordered_map< std::string, ClientRequestHandler > const | ClientRequestHandlers |
|
private |
|
explicit |
|
default |
|
private |
Definition at line 86 of file Session.cpp.
|
private |
Definition at line 141 of file Session.cpp.
|
private |
Definition at line 107 of file Session.cpp.
std::string Battlenet::Session::GetClientInfo | ( | ) | const |
|
inline |
uint32 Battlenet::Session::HandleGenerateWebCredentials | ( | authentication::v1::GenerateWebCredentialsRequest const * | request, |
std::function< void(ServiceBase *, uint32, google::protobuf::Message const *)> & | continuation | ||
) |
uint32 Battlenet::Session::HandleGetAccountState | ( | account::v1::GetAccountStateRequest const * | request, |
account::v1::GetAccountStateResponse * | response | ||
) |
Definition at line 456 of file Session.cpp.
uint32 Battlenet::Session::HandleGetAllValuesForAttribute | ( | game_utilities::v1::GetAllValuesForAttributeRequest const * | request, |
game_utilities::v1::GetAllValuesForAttributeResponse * | response | ||
) |
Definition at line 705 of file Session.cpp.
uint32 Battlenet::Session::HandleGetGameAccountState | ( | account::v1::GetGameAccountStateRequest const * | request, |
account::v1::GetGameAccountStateResponse * | response | ||
) |
Definition at line 473 of file Session.cpp.
uint32 Battlenet::Session::HandleLogon | ( | authentication::v1::LogonRequest const * | logonRequest, |
std::function< void(ServiceBase *, uint32, ::google::protobuf::Message const *)> & | continuation | ||
) |
uint32 Battlenet::Session::HandleProcessClientRequest | ( | game_utilities::v1::ClientRequest const * | request, |
game_utilities::v1::ClientResponse * | response | ||
) |
uint32 Battlenet::Session::HandleVerifyWebCredentials | ( | authentication::v1::VerifyWebCredentialsRequest const * | verifyWebCredentialsRequest, |
std::function< void(ServiceBase *, uint32, ::google::protobuf::Message const *)> & | continuation | ||
) |
Definition at line 268 of file Session.cpp.
|
protected |
Definition at line 719 of file Session.cpp.
|
protected |
|
overrideprotectedvirtual |
Implements Socket< Session, SslSocket<> >.
Definition at line 762 of file Session.cpp.
|
protected |
|
protected |
|
inline |
void Battlenet::Session::SendResponse | ( | uint32 | token, |
pb::Message const * | response | ||
) |
Definition at line 149 of file Session.cpp.
|
overridevirtual |
Implements Socket< Session, SslSocket<> >.
Definition at line 92 of file Session.cpp.
|
overridevirtual |
Reimplemented from Socket< Session, SslSocket<> >.
Definition at line 131 of file Session.cpp.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
staticprivate |