feat(Core/Auth): add AccountInfo helper (#5640)

This commit is contained in:
Kargatum
2021-05-20 15:16:50 +07:00
committed by GitHub
parent a9e3d8d13a
commit e50754d804
5 changed files with 389 additions and 395 deletions

View File

@@ -14,6 +14,7 @@
#include "SRP6.h"
class ACE_INET_Addr;
class Fields;
struct Realm;
enum eStatus
@@ -26,6 +27,21 @@ enum eStatus
STATUS_CLOSED
};
struct AccountInfo
{
void LoadResult(Field* fields);
uint32 Id = 0;
std::string Login;
bool IsLockedToIP = false;
std::string LockCountry;
std::string LastIP;
uint32 FailedLogins = 0;
bool IsBanned = false;
bool IsPermanenetlyBanned = false;
AccountTypes SecurityLevel = SEC_PLAYER;
};
// Handle login commands
class AuthSocket: public RealmSocket::Session
{
@@ -65,7 +81,7 @@ private:
eStatus _status;
std::string _login;
AccountInfo _accountInfo;
Optional<std::vector<uint8>> _totpSecret;
// Since GetLocaleByName() is _NOT_ bijective, we have to store the locale as a string. Otherwise we can't differ
@@ -74,7 +90,6 @@ private:
std::string _os;
uint16 _build;
uint8 _expversion;
AccountTypes _accountSecurityLevel;
};
#endif