![]() |
TrinityCore
|
#include <AccountMgr.h>
Public Member Functions | |
| AccountOpResult | CreateAccount (std::string username, std::string password, std::string email="") |
| 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 (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 52 of file AccountMgr.h.
|
private |
Definition at line 32 of file AccountMgr.cpp.
|
private |
Definition at line 34 of file AccountMgr.cpp.
References ClearRBAC().
|
static |
Definition at line 220 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 190 of file AccountMgr.cpp.
References AOR_NAME_NOT_EXIST, AOR_OK, AOR_PASS_TOO_LONG, GetName(), LOGIN_UPD_LOGON, LoginDatabase, Trinity::Crypto::SRP6::MakeRegistrationData(), MAX_PASS_STR, PreparedStatementBase::setBinary(), PreparedStatementBase::setUInt32(), sScriptMgr, utf8length(), and Utf8ToUpperOnlyLatin().
Referenced by account_commandscript::HandleAccountPasswordCommand(), and account_commandscript::HandleAccountSetPasswordCommand().
|
static |
Definition at line 250 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 156 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, Trinity::Crypto::SRP6::MakeRegistrationData(), MAX_ACCOUNT_NAME_BYTES, MAX_ACCOUNT_STR, MAX_PASS_STR, PreparedStatementBase::setBinary(), PreparedStatementBase::setString(), PreparedStatementBase::setUInt32(), sWorld, utf8length(), and Utf8ToUpperOnlyLatin().
|
static |
Definition at line 364 of file AccountMgr.cpp.
References GetEmail(), and Utf8ToUpperOnlyLatin().
Referenced by account_commandscript::HandleAccountEmailCommand(), and account_commandscript::HandleAccountPasswordCommand().
|
static |
Definition at line 340 of file AccountMgr.cpp.
References Trinity::Crypto::SRP6::CheckLogin(), GetName(), LOGIN_SEL_CHECK_PASSWORD, LoginDatabase, Trinity::Crypto::SRP6::SALT_LENGTH, PreparedStatementBase::setUInt32(), Utf8ToUpperOnlyLatin(), and Trinity::Crypto::SRP6::VERIFIER_LENGTH.
Referenced by account_commandscript::HandleAccountEmailCommand(), account_commandscript::HandleAccountPasswordCommand(), and ns1__executeCommand().
|
private |
Definition at line 566 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 = "" |
||
| ) |
Definition at line 45 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, Trinity::Crypto::SRP6::MakeRegistrationData(), MAX_ACCOUNT_NAME_BYTES, MAX_ACCOUNT_STR, MAX_PASS_STR, PreparedStatementBase::setBinary(), PreparedStatementBase::setString(), sWorld, utf8length(), and Utf8ToUpperOnlyLatin().
|
static |
Definition at line 77 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 381 of file AccountMgr.cpp.
References CHAR_SEL_SUM_CHARS, CharacterDatabase, and PreparedStatementBase::setUInt32().
Referenced by character_commandscript::HandleCharacterChangeAccountCommand(), character_commandscript::HandleCharacterDeletedRestoreHelper(), AuctionBotConfig::Initialize(), and PlayerDumpReader::LoadDump().
|
static |
Definition at line 325 of file AccountMgr.cpp.
References LOGIN_GET_EMAIL_BY_ID, LoginDatabase, and PreparedStatementBase::setUInt32().
Referenced by CheckEmail().
|
static |
Definition at line 280 of file AccountMgr.cpp.
References LOGIN_GET_ACCOUNT_ID_BY_USERNAME, LoginDatabase, and PreparedStatementBase::setStringView().
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(), ns1__executeCommand(), World::RemoveBanAccount(), and Trinity::ChatCommands::AccountIdentifier::TryConsume().
|
static |
Definition at line 310 of file AccountMgr.cpp.
References LOGIN_GET_USERNAME_BY_ID, LoginDatabase, and PreparedStatementBase::setUInt32().
Referenced by Warden::ApplyPenalty(), 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 575 of file AccountMgr.cpp.
References _defaultPermissions, and TC_LOG_TRACE.
| rbac::RBACPermission const * AccountMgr::GetRBACPermission | ( | uint32 | permission | ) | const |
Definition at line 539 of file AccountMgr.cpp.
References _permissions, and TC_LOG_TRACE.
|
inline |
Definition at line 88 of file AccountMgr.h.
Definition at line 289 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::HandleGMTicketAssignToCommand(), ticket_commandscript::HandleGMTicketUnAssignCommand(), ChatHandler::HasLowerSecurityAccount(), HasPermission(), and ns1__executeCommand().
|
static |
Definition at line 299 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 549 of file AccountMgr.cpp.
References GetSecurity(), TC_LOG_DEBUG, and TC_LOG_ERROR.
Referenced by ticket_commandscript::HandleGMTicketAssignToCommand().
|
static |
|
static |
Definition at line 408 of file AccountMgr.cpp.
References SEC_ADMINISTRATOR, and SEC_CONSOLE.
Referenced by ticket_commandscript::HandleGMTicketAssignToCommand().
|
static |
Definition at line 391 of file AccountMgr.cpp.
References LOGIN_SEL_ACCOUNT_BANNED_BY_USERNAME, LoginDatabase, and PreparedStatementBase::setString().
Referenced by World::BanAccount().
|
static |
Definition at line 413 of file AccountMgr.cpp.
References SEC_CONSOLE.
Referenced by account_commandscript::HandleAccountSetSecLevelCommand().
|
static |
Definition at line 403 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 418 of file AccountMgr.cpp.
References _defaultPermissions, _permissions, rbac::RBACPermission::AddLinkedPermission(), ClearRBAC(), getMSTime(), GetMSTimeDiffToNow(), Field::GetUInt32(), Realm::Id, LoginDatabase, realm, RealmHandle::Realm, TC_LOG_DEBUG, TC_LOG_ERROR, and TC_LOG_INFO.
| void AccountMgr::UpdateAccountAccess | ( | rbac::RBACData * | rbac, |
| uint32 | accountId, | ||
| uint8 | securityLevel, | ||
| int32 | realmId | ||
| ) |
Definition at line 505 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 94 of file AccountMgr.h.
Referenced by ClearRBAC(), GetRBACDefaultPermissions(), and LoadRBAC().
|
private |
Definition at line 93 of file AccountMgr.h.
Referenced by ClearRBAC(), GetRBACPermission(), and LoadRBAC().