![]() |
TrinityCore
|
#include <AccountMgr.h>
Public Member Functions | |
| AccountMgr (AccountMgr const &)=delete | |
| AccountMgr (AccountMgr &&)=delete | |
| AccountMgr & | operator= (AccountMgr const &)=delete |
| AccountMgr & | operator= (AccountMgr &&)=delete |
| AccountOpResult | CreateAccount (std::string username, std::string password, std::string email="", uint32 bnetAccountId=0, uint8 bnetIndex=0) |
| void | UpdateAccountAccess (rbac::RBACData *rbac, uint32 accountId, uint8 securityLevel, int32 realmId) |
| void | LoadRBAC () |
| rbac::RBACPermission const * | GetRBACPermission (uint32 permission) const |
| rbac::RBACPermissionsContainer const & | GetRBACPermissionList () const |
| rbac::RBACPermissionContainer const & | GetRBACDefaultPermissions (uint8 secLevel) |
Static Public Member Functions | |
| static AccountMgr * | instance () |
| static AccountOpResult | DeleteAccount (uint32 accountId) |
| static AccountOpResult | ChangeUsername (uint32 accountId, std::string newUsername, std::string newPassword) |
| static AccountOpResult | ChangePassword (uint32 accountId, std::string newPassword) |
| static AccountOpResult | ChangeEmail (uint32 accountId, std::string newEmail) |
| static AccountOpResult | ChangeRegEmail (uint32 accountId, std::string newEmail) |
| static bool | CheckPassword (std::string username, std::string password) |
| static bool | CheckPassword (uint32 accountId, std::string password) |
| static bool | CheckEmail (uint32 accountId, std::string newEmail) |
| static uint32 | GetId (std::string_view username) |
| static uint32 | GetSecurity (uint32 accountId, int32 realmId) |
| static QueryCallback | GetSecurityAsync (uint32 accountId, int32 realmId, std::function< void(uint32)> callback) |
| static bool | GetName (uint32 accountId, std::string &name) |
| static bool | GetEmail (uint32 accountId, std::string &email) |
| static uint32 | GetCharactersCount (uint32 accountId) |
| static bool | IsBannedAccount (std::string const &name) |
| static bool | IsPlayerAccount (uint32 gmlevel) |
| static bool | IsAdminAccount (uint32 gmlevel) |
| static bool | IsConsoleAccount (uint32 gmlevel) |
| static bool | HasPermission (uint32 accountId, uint32 permission, uint32 realmId) |
Private Member Functions | |
| AccountMgr () | |
| ~AccountMgr () | |
| void | ClearRBAC () |
Private Attributes | |
| rbac::RBACPermissionsContainer | _permissions |
| rbac::RBACDefaultPermissionsContainer | _defaultPermissions |
Definition at line 54 of file AccountMgr.h.
|
private |
Definition at line 34 of file AccountMgr.cpp.
|
private |
Definition at line 36 of file AccountMgr.cpp.
References ClearRBAC().
|
delete |
|
delete |
|
static |
Definition at line 233 of file AccountMgr.cpp.
References AOR_EMAIL_TOO_LONG, AOR_NAME_NOT_EXIST, AOR_OK, GetName(), LOGIN_UPD_EMAIL, LoginDatabase, MAX_EMAIL_STR, PreparedStatementBase::setString(), PreparedStatementBase::setUInt32(), sScriptMgr, utf8length(), and Utf8ToUpperOnlyLatin().
Referenced by account_commandscript::HandleAccountEmailCommand(), and account_commandscript::HandleAccountSetEmailCommand().
|
static |
Definition at line 203 of file AccountMgr.cpp.
References AOR_NAME_NOT_EXIST, AOR_OK, AOR_PASS_TOO_LONG, GetName(), LOGIN_UPD_LOGON, LoginDatabase, MAX_PASS_STR, PreparedStatementBase::setBinary(), PreparedStatementBase::setUInt32(), sScriptMgr, utf8length(), and Utf8ToUpperOnlyLatin().
Referenced by account_commandscript::HandleAccountPasswordCommand(), and account_commandscript::HandleAccountSetPasswordCommand().
|
static |
Definition at line 263 of file AccountMgr.cpp.
References AOR_EMAIL_TOO_LONG, AOR_NAME_NOT_EXIST, AOR_OK, GetName(), LOGIN_UPD_REG_EMAIL, LoginDatabase, MAX_EMAIL_STR, PreparedStatementBase::setString(), PreparedStatementBase::setUInt32(), sScriptMgr, utf8length(), and Utf8ToUpperOnlyLatin().
Referenced by account_commandscript::HandleAccountSetRegEmailCommand().
|
static |
Definition at line 169 of file AccountMgr.cpp.
References AOR_NAME_NOT_EXIST, AOR_NAME_TOO_LONG, AOR_OK, AOR_PASS_TOO_LONG, CONFIG_EXTENDED_ACCOUNT_NAME_LENGTH_LIMIT, LOGIN_SEL_ACCOUNT_BY_ID, LOGIN_UPD_LOGON, LOGIN_UPD_USERNAME, LoginDatabase, MAX_ACCOUNT_NAME_BYTES, MAX_ACCOUNT_STR, MAX_PASS_STR, PreparedStatementBase::setBinary(), PreparedStatementBase::setString(), PreparedStatementBase::setUInt32(), sWorld, utf8length(), and Utf8ToUpperOnlyLatin().
|
static |
Definition at line 396 of file AccountMgr.cpp.
References GetEmail(), and Utf8ToUpperOnlyLatin().
Referenced by account_commandscript::HandleAccountEmailCommand(), and account_commandscript::HandleAccountPasswordCommand().
|
static |
Definition at line 353 of file AccountMgr.cpp.
References Trinity::Crypto::SRP::SRP6::CheckCredentials(), LOGIN_SEL_CHECK_PASSWORD_BY_NAME, LoginDatabase, Trinity::Crypto::SRP::SALT_LENGTH, PreparedStatementBase::setString(), and Utf8ToUpperOnlyLatin().
Referenced by account_commandscript::HandleAccountEmailCommand(), account_commandscript::HandleAccountPasswordCommand(), ns1__executeCommand(), and RASession::Start().
|
static |
Definition at line 372 of file AccountMgr.cpp.
References Trinity::Crypto::SRP::SRP6::CheckCredentials(), GetName(), LOGIN_SEL_CHECK_PASSWORD, LoginDatabase, Trinity::Crypto::SRP::SALT_LENGTH, PreparedStatementBase::setUInt32(), and Utf8ToUpperOnlyLatin().
|
private |
Definition at line 598 of file AccountMgr.cpp.
References _defaultPermissions, and _permissions.
Referenced by LoadRBAC(), and ~AccountMgr().
| AccountOpResult AccountMgr::CreateAccount | ( | std::string | username, |
| std::string | password, | ||
| std::string | email = "", |
||
| uint32 | bnetAccountId = 0, |
||
| uint8 | bnetIndex = 0 |
||
| ) |
Definition at line 47 of file AccountMgr.cpp.
References AOR_NAME_ALREADY_EXIST, AOR_NAME_TOO_LONG, AOR_OK, AOR_PASS_TOO_LONG, CONFIG_EXTENDED_ACCOUNT_NAME_LENGTH_LIMIT, GetId(), LOGIN_INS_ACCOUNT, LOGIN_INS_REALM_CHARACTERS_INIT, LoginDatabase, MAX_ACCOUNT_NAME_BYTES, MAX_ACCOUNT_STR, MAX_PASS_STR, PreparedStatementBase::setBinary(), PreparedStatementBase::setNull(), PreparedStatementBase::setString(), PreparedStatementBase::setUInt32(), PreparedStatementBase::setUInt8(), sWorld, utf8length(), and Utf8ToUpperOnlyLatin().
Referenced by Battlenet::AccountMgr::CreateBattlenetAccount().
|
static |
Definition at line 90 of file AccountMgr.cpp.
References AOR_NAME_NOT_EXIST, AOR_OK, CHAR_DEL_ACCOUNT_DATA, CHAR_DEL_ACCOUNT_INSTANCE_LOCK_TIMES, CHAR_DEL_CHARACTER_BAN, CHAR_DEL_TUTORIALS, CHAR_SEL_CHARS_BY_ACCOUNT_ID, CharacterDatabase, Player::DeleteFromDB(), ObjectAccessor::FindConnectedPlayer(), WorldSession::KickPlayer(), LOGIN_DEL_ACCOUNT, LOGIN_DEL_ACCOUNT_ACCESS, LOGIN_DEL_ACCOUNT_BANNED, LOGIN_DEL_ACCOUNT_MUTED, LOGIN_DEL_REALM_CHARACTERS, LOGIN_SEL_ACCOUNT_BY_ID, LoginDatabase, WorldSession::LogoutPlayer(), and PreparedStatementBase::setUInt32().
Referenced by account_commandscript::HandleAccountDeleteCommand().
Definition at line 413 of file AccountMgr.cpp.
References CHAR_SEL_SUM_CHARS, CharacterDatabase, and PreparedStatementBase::setUInt32().
Referenced by character_commandscript::HandleCharacterChangeAccountCommand(), character_commandscript::HandleCharacterDeletedRestoreHelper(), and PlayerDumpReader::LoadDump().
|
static |
Definition at line 338 of file AccountMgr.cpp.
References LOGIN_GET_EMAIL_BY_ID, LoginDatabase, and PreparedStatementBase::setUInt32().
Referenced by CheckEmail().
|
static |
Definition at line 293 of file AccountMgr.cpp.
References LOGIN_GET_ACCOUNT_ID_BY_USERNAME, LoginDatabase, and PreparedStatementBase::setString().
Referenced by CreateAccount(), account_commandscript::HandleAccountDeleteCommand(), account_commandscript::HandleAccountSet2FACommand(), account_commandscript::HandleAccountSetAddonCommand(), account_commandscript::HandleAccountSetEmailCommand(), account_commandscript::HandleAccountSetPasswordCommand(), account_commandscript::HandleAccountSetRegEmailCommand(), account_commandscript::HandleAccountSetSecLevelCommand(), ban_commandscript::HandleBanInfoAccountCommand(), misc_commandscript::HandleMuteHistoryCommand(), Battlenet::AccountMgr::LinkWithGameAccount(), ns1__executeCommand(), World::RemoveBanAccount(), Trinity::ChatCommands::AccountIdentifier::TryConsume(), and Battlenet::AccountMgr::UnlinkGameAccount().
|
static |
Definition at line 323 of file AccountMgr.cpp.
References LOGIN_GET_USERNAME_BY_ID, LoginDatabase, and PreparedStatementBase::setUInt32().
Referenced by ChangeEmail(), ChangePassword(), ChangeRegEmail(), CheckPassword(), character_commandscript::GetDeletedCharacterInfoList(), account_commandscript::HandleAccountSetAddonCommand(), account_commandscript::HandleAccountSetSecLevelCommand(), ban_commandscript::HandleBanListHelper(), character_commandscript::HandleCharacterEraseCommand(), and Trinity::ChatCommands::AccountIdentifier::TryConsume().
| rbac::RBACPermissionContainer const & AccountMgr::GetRBACDefaultPermissions | ( | uint8 | secLevel | ) |
Definition at line 607 of file AccountMgr.cpp.
References _defaultPermissions, and TC_LOG_TRACE.
| rbac::RBACPermission const * AccountMgr::GetRBACPermission | ( | uint32 | permission | ) | const |
Definition at line 571 of file AccountMgr.cpp.
References _permissions, and TC_LOG_TRACE.
|
inline |
Definition at line 96 of file AccountMgr.h.
Definition at line 302 of file AccountMgr.cpp.
References LOGIN_GET_GMLEVEL_BY_REALMID, LoginDatabase, SEC_PLAYER, PreparedStatementBase::setInt32(), and PreparedStatementBase::setUInt32().
Referenced by rbac_commandscript::GetRBACData(), account_commandscript::HandleAccountSetSecLevelCommand(), ticket_commandscript::HandleTicketUnAssignCommand(), ChatHandler::HasLowerSecurityAccount(), HasPermission(), and ns1__executeCommand().
|
static |
Definition at line 312 of file AccountMgr.cpp.
References LOGIN_GET_GMLEVEL_BY_REALMID, LoginDatabase, SEC_PLAYER, PreparedStatementBase::setInt32(), and PreparedStatementBase::setUInt32().
Referenced by WorldSession::HandleAddFriendOpcode().
Definition at line 581 of file AccountMgr.cpp.
References GetSecurity(), TC_LOG_DEBUG, and TC_LOG_ERROR.
Referenced by ticket_commandscript::HandleTicketAssignToCommand(), and BlackMarketMgr::SendAuctionWonMail().
|
static |
Definition at line 41 of file AccountMgr.cpp.
References instance().
Referenced by Battlenet::AccountMgr::CreateBattlenetAccount(), and instance().
|
static |
Definition at line 440 of file AccountMgr.cpp.
References SEC_ADMINISTRATOR, and SEC_CONSOLE.
|
static |
Definition at line 423 of file AccountMgr.cpp.
References LOGIN_SEL_ACCOUNT_BANNED_BY_USERNAME, LoginDatabase, and PreparedStatementBase::setString().
Referenced by World::BanAccount().
|
static |
Definition at line 445 of file AccountMgr.cpp.
References SEC_CONSOLE.
Referenced by account_commandscript::HandleAccountSetSecLevelCommand().
|
static |
Definition at line 435 of file AccountMgr.cpp.
References SEC_PLAYER.
Referenced by WorldSession::HandleAddFriendOpcode(), WorldSession::HandleWhoOpcode(), Player::IsVisibleGloballyFor(), Channel::JoinChannel(), and LogCommandUsage().
| void AccountMgr::LoadRBAC | ( | ) |
Definition at line 450 of file AccountMgr.cpp.
References _defaultPermissions, _permissions, rbac::RBACPermission::AddLinkedPermission(), ClearRBAC(), getMSTime(), GetMSTimeDiffToNow(), Field::GetUInt32(), LoginDatabase, sRealmList, TC_LOG_DEBUG, TC_LOG_ERROR, and TC_LOG_INFO.
|
delete |
|
delete |
| void AccountMgr::UpdateAccountAccess | ( | rbac::RBACData * | rbac, |
| uint32 | accountId, | ||
| uint8 | securityLevel, | ||
| int32 | realmId | ||
| ) |
Definition at line 537 of file AccountMgr.cpp.
References LOGIN_DEL_ACCOUNT_ACCESS, LOGIN_DEL_ACCOUNT_ACCESS_BY_REALM, LOGIN_INS_ACCOUNT_ACCESS, LoginDatabase, PreparedStatementBase::setInt32(), PreparedStatementBase::setUInt32(), and PreparedStatementBase::setUInt8().
|
private |
Definition at line 102 of file AccountMgr.h.
Referenced by ClearRBAC(), GetRBACDefaultPermissions(), and LoadRBAC().
|
private |
Definition at line 101 of file AccountMgr.h.
Referenced by ClearRBAC(), GetRBACPermission(), and LoadRBAC().