TrinityCore
Loading...
Searching...
No Matches
AuthSession.h
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#ifndef __AUTHSESSION_H__
19#define __AUTHSESSION_H__
20
22#include "Common.h"
23#include "CryptoHash.h"
24#include "DatabaseEnvFwd.h"
25#include "DeadlineTimer.h"
26#include "Duration.h"
27#include "Optional.h"
28#include "Socket.h"
29#include "SRP6.h"
30#include <boost/asio/ip/tcp.hpp>
31#include <span>
32
33using boost::asio::ip::tcp;
34
36class ByteBuffer;
37
48
50{
51 void LoadResult(Field* fields);
52
54 std::string Login;
55 bool IsLockedToIP = false;
56 std::string LockCountry;
57 std::string LastIP;
59 bool IsBanned = false;
62};
63
115
116#endif
std::array< uint8, SESSION_KEY_LENGTH > SessionKey
Definition AuthDefines.h:25
AuthStatus
Definition AuthSession.h:39
@ STATUS_RECONNECT_PROOF
Definition AuthSession.h:42
@ STATUS_XFER
Definition AuthSession.h:45
@ STATUS_WAITING_FOR_REALM_LIST
Definition AuthSession.h:44
@ STATUS_CLOSED
Definition AuthSession.h:46
@ STATUS_CHALLENGE
Definition AuthSession.h:40
@ STATUS_LOGON_PROOF
Definition AuthSession.h:41
@ STATUS_AUTHED
Definition AuthSession.h:43
LocaleConstant
Definition Common.h:48
AccountTypes
Definition Common.h:39
@ SEC_PLAYER
Definition Common.h:40
std::shared_ptr< PreparedResultSet > PreparedQueryResult
uint8_t uint8
Definition Define.h:135
uint16_t uint16
Definition Define.h:134
uint32_t uint32
Definition Define.h:133
std::chrono::minutes Minutes
Minutes shorthand typedef.
Definition Duration.h:30
std::optional< T > Optional
Optional helper class to wrap optional values within.
Definition Optional.h:25
SessionKey _sessionKey
Definition AuthSession.h:99
void QueueQuery(QueryCallback &&queryCallback)
Minutes _timezoneOffset
bool HandleXferResume()
Trinity::Asio::DeadlineTimer _timeout
AccountInfo _accountInfo
Optional< Trinity::Crypto::SRP6 > _srp6
Definition AuthSession.h:98
bool HandleLogonChallenge()
AuthStatus _status
bool VerifyVersion(std::span< uint8 const > a, Trinity::Crypto::SHA1::Digest const &versionProof, bool isReconnect)
void RealmListCallback(PreparedQueryResult result)
void Start() override
std::string_view _ipCountry
Socket AuthSocket
Definition AuthSession.h:66
LocaleConstant _locale
void ReconnectChallengeCallback(PreparedQueryResult result)
bool HandleLogonProof()
bool HandleReconnectChallenge()
bool HandleXferAccept()
bool HandleRealmList()
Trinity::Net::SocketReadCallbackResult ReadHandler() override
QueryCallbackProcessor _queryProcessor
bool HandleXferCancel()
void SetTimeout()
void SendPacket(ByteBuffer &packet)
void LogonChallengeCallback(PreparedQueryResult result)
uint16 _build
Optional< std::vector< uint8 > > _totpSecret
bool Update() override
bool HandleReconnectProof()
std::array< uint8, 16 > _reconnectProof
friend AuthHandlerTable
Definition AuthSession.h:81
uint8 _expversion
Class used to access individual fields of database query result.
Definition Field.h:92
std::array< uint8, DIGEST_LENGTH > Digest
Definition CryptoHash.h:47
Socket(IoContextTcpSocket &&socket, Args &&... args)
Definition Socket.h:113
SocketReadCallbackResult
Definition Socket.h:44
boost::asio::basic_stream_socket< boost::asio::ip::tcp, boost::asio::io_context::executor_type > IoContextTcpSocket
Definition Socket.h:41
std::string LockCountry
Definition AuthSession.h:56
uint32 FailedLogins
Definition AuthSession.h:58
void LoadResult(Field *fields)
AccountTypes SecurityLevel
Definition AuthSession.h:61
bool IsLockedToIP
Definition AuthSession.h:55
std::string LastIP
Definition AuthSession.h:57
std::string Login
Definition AuthSession.h:54
bool IsPermanenetlyBanned
Definition AuthSession.h:60