![]() |
AzerothCore 3.3.5a
OpenSource WoW Emulator
|
#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) |
| void | AddPermissionForTest (uint32 permissionId, std::string const &name) |
| void | AddLinkedPermissionForTest (uint32 permissionId, uint32 linkedPermissionId) |
| void | AddDefaultPermissionForTest (uint8 secLevel, uint32 permissionId) |
| void | ClearPermissionsForTest () |
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 email) |
| static bool | CheckPassword (uint32 accountId, std::string password) |
| static uint32 | GetId (std::string const &username) |
| static uint32 | GetSecurity (uint32 accountId) |
| static uint32 | GetSecurity (uint32 accountId, int32 realmId) |
| static bool | GetName (uint32 accountId, std::string &name) |
| static uint32 | GetCharactersCount (uint32 accountId) |
| static bool | IsPlayerAccount (uint32 gmlevel) |
| static bool | IsGMAccount (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 |
|
private |
|
private |
References ClearRBAC().
References _defaultPermissions.
References _permissions.
| void AccountMgr::AddPermissionForTest | ( | uint32 | permissionId, |
| std::string const & | name | ||
| ) |
References _permissions.
|
static |
References AOR_EMAIL_TOO_LONG, AOR_NAME_NOT_EXIST, AOR_OK, GetName(), LOGIN_UPD_EMAIL, LoginDatabase, MAX_EMAIL_STR, PreparedStatementBase::SetData(), sScriptMgr, utf8length(), and Utf8ToUpperOnlyLatin().
Referenced by account_commandscript::HandleAccountSetEmailCommand().
|
static |
References AOR_NAME_NOT_EXIST, AOR_OK, AOR_PASS_TOO_LONG, GetName(), LOGIN_UPD_LOGON, LoginDatabase, Acore::Crypto::SRP6::MakeRegistrationData(), MAX_PASS_STR, PreparedStatementBase::SetData(), sScriptMgr, utf8length(), and Utf8ToUpperOnlyLatin().
Referenced by account_commandscript::HandleAccountPasswordCommand(), and account_commandscript::HandleAccountSetPasswordCommand().
|
static |
References AOR_NAME_NOT_EXIST, AOR_NAME_TOO_LONG, AOR_OK, AOR_PASS_TOO_LONG, LOGIN_SEL_ACCOUNT_BY_ID, LOGIN_UPD_LOGON, LOGIN_UPD_USERNAME, LoginDatabase, Acore::Crypto::SRP6::MakeRegistrationData(), MAX_ACCOUNT_STR, MAX_PASS_STR, PreparedStatementBase::SetData(), utf8length(), and Utf8ToUpperOnlyLatin().
|
static |
References Acore::Crypto::SRP6::CheckLogin(), GetName(), LOGIN_SEL_CHECK_PASSWORD, LoginDatabase, Acore::Crypto::SRP6::SALT_LENGTH, PreparedStatementBase::SetData(), Utf8ToUpperOnlyLatin(), and Acore::Crypto::SRP6::VERIFIER_LENGTH.
Referenced by account_commandscript::HandleAccountPasswordCommand(), and ns1__executeCommand().
| void AccountMgr::ClearPermissionsForTest | ( | ) |
References ClearRBAC().
|
private |
References _defaultPermissions, and _permissions.
Referenced by ClearPermissionsForTest(), LoadRBAC(), and ~AccountMgr().
| AccountOpResult AccountMgr::CreateAccount | ( | std::string | username, |
| std::string | password, | ||
| std::string | email = "" |
||
| ) |
References AOR_EMAIL_TOO_LONG, AOR_NAME_ALREADY_EXIST, AOR_NAME_TOO_LONG, AOR_OK, AOR_PASS_TOO_LONG, CONFIG_EXPANSION, GetId(), LOGIN_INS_ACCOUNT, LOGIN_INS_REALM_CHARACTERS_INIT, LoginDatabase, Acore::Crypto::SRP6::MakeRegistrationData(), MAX_ACCOUNT_STR, MAX_EMAIL_STR, MAX_PASS_STR, PreparedStatementBase::SetData(), sWorld, utf8length(), and Utf8ToUpperOnlyLatin().
|
static |
References AOR_NAME_NOT_EXIST, AOR_OK, CHAR_DEL_ACCOUNT_DATA, CHAR_DEL_CHARACTER_BAN, CHAR_DEL_TUTORIALS, CHAR_SEL_CHARS_BY_ACCOUNT_ID, CharacterDatabase, Player::DeleteFromDB(), ObjectAccessor::FindPlayer(), ObjectGuid::GetCounter(), 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(), PreparedStatementBase::SetData(), and sScriptMgr.
Referenced by account_commandscript::HandleAccountDeleteCommand().
References CHAR_SEL_SUM_CHARS, CharacterDatabase, and PreparedStatementBase::SetData().
Referenced by character_commandscript::HandleCharacterChangeAccountCommand(), character_commandscript::HandleCharacterDeletedRestoreHelper(), and PlayerDumpReader::LoadDump().
|
static |
References LOGIN_GET_ACCOUNT_ID_BY_USERNAME, LoginDatabase, and PreparedStatementBase::SetData().
Referenced by BanMgr::BanAccount(), CreateAccount(), account_commandscript::HandleAccountDeleteCommand(), account_commandscript::HandleAccountRemoveLockCountryCommand(), account_commandscript::HandleAccountSet2FACommand(), account_commandscript::HandleAccountSetAddonCommand(), account_commandscript::HandleAccountSetGmLevelCommand(), account_commandscript::HandleAccountSetPasswordCommand(), ban_commandscript::HandleBanInfoAccountCommand(), character_commandscript::HandleCharacterChangeAccountCommand(), misc_commandscript::HandleMuteInfoCommand(), ns1__executeCommand(), BanMgr::RemoveBanAccount(), and Acore::ChatCommands::AccountIdentifier::TryConsume().
|
static |
References LOGIN_GET_USERNAME_BY_ID, LoginDatabase, and PreparedStatementBase::SetData().
Referenced by Warden::ApplyPenalty(), BanMgr::BanAccountByPlayerName(), ChangeEmail(), ChangePassword(), CheckPassword(), WorldSession::DosProtection::EvaluateOpcode(), character_commandscript::GetDeletedCharacterInfoList(), account_commandscript::HandleAccountSetAddonCommand(), ban_commandscript::HandleBanListHelper(), character_commandscript::HandleCharacterChangeAccountCommand(), character_commandscript::HandleCharacterEraseCommand(), and Acore::ChatCommands::AccountIdentifier::TryConsume().
| rbac::RBACPermissionContainer const & AccountMgr::GetRBACDefaultPermissions | ( | uint8 | secLevel | ) |
References _defaultPermissions, and LOG_TRACE.
| rbac::RBACPermission const * AccountMgr::GetRBACPermission | ( | uint32 | permission | ) | const |
References _permissions, and LOG_TRACE.
|
inline |
References LOGIN_GET_ACCOUNT_ACCESS_GMLEVEL, LoginDatabase, SEC_PLAYER, and PreparedStatementBase::SetData().
Referenced by rbac_commandscript::GetRBACData(), account_commandscript::HandleAccountSetGmLevelCommand(), WorldSession::HandleAddFriendOpcode(), ticket_commandscript::HandleGMTicketAssignToCommand(), ticket_commandscript::HandleGMTicketUnAssignCommand(), ChatHandler::HasLowerSecurityAccount(), HasPermission(), and ns1__executeCommand().
References LOGIN_GET_GMLEVEL_BY_REALMID, LoginDatabase, SEC_PLAYER, and PreparedStatementBase::SetData().
References GetSecurity(), LOG_DEBUG, and LOG_ERROR.
|
static |
|
static |
References SEC_ADMINISTRATOR, and SEC_CONSOLE.
Referenced by ticket_commandscript::HandleGMTicketAssignToCommand().
|
static |
References SEC_CONSOLE.
Referenced by account_commandscript::HandleAccountSetGmLevelCommand().
|
static |
References SEC_GAMEMASTER.
|
static |
References SEC_PLAYER.
Referenced by WorldSession::HandleAddFriendOpcode(), misc_commandscript::HandleBMCommand(), misc_commandscript::HandleCommentatorCommand(), misc_commandscript::HandleDevCommand(), gm_commandscript::HandleGMChatCommand(), gm_commandscript::HandleGMListIngameCommand(), ticket_commandscript::HandleGMTicketAssignToCommand(), group_commandscript::HandleGroupReviveCommand(), misc_commandscript::HandleReviveCommand(), misc_commandscript::HandleUnstuckCommand(), WorldSession::HandleWhoOpcode(), Player::IsVisibleGloballyFor(), and LogCommandUsage().
| void AccountMgr::LoadRBAC | ( | ) |
References _defaultPermissions, _permissions, rbac::RBACPermission::AddLinkedPermission(), ClearRBAC(), Field::Get(), getMSTime(), GetMSTimeDiffToNow(), Realm::Id, LOG_DEBUG, LOG_ERROR, LOG_INFO, LOGIN_SEL_RBAC_DEFAULT_PERMISSIONS, LoginDatabase, realm, RealmHandle::Realm, and PreparedStatementBase::SetData().
| void AccountMgr::UpdateAccountAccess | ( | rbac::RBACData * | rbac, |
| uint32 | accountId, | ||
| uint8 | securityLevel, | ||
| int32 | realmId | ||
| ) |
References LOGIN_DEL_ACCOUNT_ACCESS, LOGIN_DEL_ACCOUNT_ACCESS_BY_REALM, LOGIN_INS_ACCOUNT_ACCESS, LoginDatabase, and PreparedStatementBase::SetData().
|
private |
Referenced by AddDefaultPermissionForTest(), ClearRBAC(), GetRBACDefaultPermissions(), and LoadRBAC().
|
private |
Referenced by AddLinkedPermissionForTest(), AddPermissionForTest(), ClearRBAC(), GetRBACPermission(), and LoadRBAC().