48 auto [salt, verifier] = Trinity::Crypto::SRP6::MakeRegistrationData<BnetSRP6>(srpUsername, password);
62 *gameAccountName = std::to_string(newAccountId) +
"#1";
63 std::string gameAccountPassword = password.substr(0,
MAX_PASS_STR);
74 if (!
GetName(accountId, username))
81 auto [salt, verifier] = Trinity::Crypto::SRP6::MakeRegistrationData<BnetSRP6>(srpUsername, newPassword);
97 if (!
GetName(accountId, username))
111 return BnetSRP6_OLD(username, salt, verifier).CheckCredentials(username, password);
113 return BnetSRP6(username, salt, verifier).CheckCredentials(username, password);
165 return (*result)[0].GetUInt32();
176 name = (*result)[0].GetString();
188 return (*result)[0].GetUInt32();
206 return (*result)[0].GetUInt8();
Trinity::Crypto::SRP::BnetSRP6v2< Trinity::Crypto::SHA256 > BnetSRP6
Trinity::Crypto::SRP::BnetSRP6v1< Trinity::Crypto::SHA256 > BnetSRP6_OLD
#define MAX_BNET_EMAIL_STR
#define MAX_BNET_PASS_STR
std::shared_ptr< PreparedResultSet > PreparedQueryResult
DatabaseWorkerPool< LoginDatabaseConnection > LoginDatabase
Accessor to the realm/login database.
@ LOGIN_UPD_BNET_GAME_ACCOUNT_LINK
@ LOGIN_SEL_BNET_ACCOUNT_ID_BY_EMAIL
@ LOGIN_SEL_BNET_ACCOUNT_ID_BY_GAME_ACCOUNT
@ LOGIN_SEL_BNET_MAX_ACCOUNT_INDEX
@ LOGIN_SEL_BNET_ACCOUNT_EMAIL_BY_ID
@ LOGIN_SEL_BNET_CHECK_PASSWORD
bool Utf8ToUpperOnlyLatin(std::string &utf8String)
size_t utf8length(std::string &utf8str)
std::string ByteArrayToHexStr(Container const &c, bool reverse=false)
constexpr std::underlying_type< E >::type AsUnderlyingType(E enumValue)
AccountOpResult CreateAccount(std::string username, std::string password, std::string email="", uint32 bnetAccountId=0, uint8 bnetIndex=0)
static AccountMgr * instance()
static uint32 GetId(std::string_view username)
void setStringView(const uint8 index, const std::string_view value)
void setUInt8(const uint8 index, const uint8 value)
void setBinary(const uint8 index, const std::vector< uint8 > &value)
void setUInt32(const uint8 index, const uint32 value)
void setNull(const uint8 index)
void setString(const uint8 index, const std::string &value)
void setInt8(const uint8 index, const int8 value)
static Digest GetDigestOf(uint8 const *data, size_t len)
TC_GAME_API AccountOpResult LinkWithGameAccount(std::string_view email, std::string_view gameAccountName)
TC_GAME_API AccountOpResult ChangePassword(uint32 accountId, std::string newPassword)
TC_GAME_API uint8 GetMaxIndex(uint32 accountId)
TC_GAME_API QueryCallback GetIdByGameAccountAsync(uint32 gameAccountId)
TC_GAME_API AccountOpResult CreateBattlenetAccount(std::string email, std::string password, bool withGameAccount, std::string *gameAccountName)
TC_GAME_API uint32 GetId(std::string_view username)
TC_GAME_API uint32 GetIdByGameAccount(uint32 gameAccountId)
TC_GAME_API bool CheckPassword(uint32 accountId, std::string password)
TC_GAME_API AccountOpResult UnlinkGameAccount(std::string_view gameAccountName)
TC_GAME_API bool GetName(uint32 accountId, std::string &name)
TC_GAME_API std::string GetSrpUsername(std::string name)
std::array< uint8, SALT_LENGTH > Salt
std::vector< uint8 > Verifier
static constexpr size_t SALT_LENGTH