|
Project SkyFire Core
SkyFire 5.4.8 server core API documentation
|
#include <AccountMgr.h>
Public Member Functions | |
| AccountOpResult | CreateAccount (std::string username, std::string password, std::string email) |
| rbac::RBACPermissionContainer const & | GetRBACDefaultPermissions (uint8 secLevel) |
| rbac::RBACPermission const * | GetRBACPermission (uint32 permission) const |
| rbac::RBACPermissionsContainer const & | GetRBACPermissionList () const |
| void | LoadRBAC () |
| void | UpdateAccountAccess (rbac::RBACData *rbac, uint32 accountId, uint8 securityLevel, int32 realmId) |
Static Public Member Functions | |
| static AccountOpResult | ChangeEmail (uint32 accountId, std::string newEmail) |
| static AccountOpResult | ChangePassword (uint32 accountId, std::string newPassword) |
| static AccountOpResult | ChangeRegEmail (uint32 accountId, std::string newEmail) |
| static AccountOpResult | ChangeUsername (uint32 accountId, std::string newUsername, std::string newPassword) |
| static bool | CheckEmail (uint32 accountId, std::string newEmail) |
| static bool | CheckPassword (uint32 accountId, std::string password) |
| static AccountOpResult | DeleteAccount (uint32 accountId) |
| static uint32 | GetCharactersCount (uint32 accountId) |
| static bool | GetEmail (uint32 accountId, std::string &email) |
| static uint32 | GetId (std::string const &username) |
| static bool | GetName (uint32 accountId, std::string &name) |
| static AccountTypes | GetSecurity (uint32 accountId) |
| static AccountTypes | GetSecurity (uint32 accountId, int32 realmId) |
| static bool | HasPermission (uint32 accountId, uint32 permission, uint32 realmId) |
| static bool | IsAdminAccount (AccountTypes gmlevel) |
| static bool | IsConsoleAccount (AccountTypes gmlevel) |
| static bool | IsPlayerAccount (AccountTypes gmlevel) |
| static bool | normalizeString (std::string &utf8String) |
Private Member Functions | |
| AccountMgr () | |
| void | ClearRBAC () |
| ~AccountMgr () | |
Private Attributes | |
| rbac::RBACDefaultPermissionsContainer | _defaultPermissions |
| rbac::RBACPermissionsContainer | _permissions |
Friends | |
| class | Skyfire::Singleton< AccountMgr, Skyfire::NullMutex > |
Definition at line 40 of file AccountMgr.h.
|
private |
Definition at line 16 of file AccountMgr.cpp.
|
private |
Definition at line 18 of file AccountMgr.cpp.
References ClearRBAC().
|
static |
Definition at line 194 of file AccountMgr.cpp.
References AOR_EMAIL_TOO_LONG, AOR_NAME_NOT_EXIST, AOR_OK, GetName(), LOGIN_UPD_EMAIL, LoginDatabase, MAX_EMAIL_STR, normalizeString(), PreparedStatement::setString(), PreparedStatement::setUInt32(), and utf8length().
Referenced by account_commandscript::HandleAccountEmailCommand(), and account_commandscript::HandleAccountSetEmailCommand().
|
static |
Definition at line 169 of file AccountMgr.cpp.
References AOR_NAME_NOT_EXIST, AOR_OK, AOR_PASS_TOO_LONG, GetName(), LOGIN_UPD_LOGON, LoginDatabase, SkyFire::Crypto::SRP6::MakeRegistrationData(), MAX_ACCOUNT_STR, normalizeString(), PreparedStatement::setBinary(), PreparedStatement::setUInt32(), and utf8length().
Referenced by account_commandscript::HandleAccountPasswordCommand(), and account_commandscript::HandleAccountSetPasswordCommand().
|
static |
Definition at line 217 of file AccountMgr.cpp.
References AOR_EMAIL_TOO_LONG, AOR_NAME_NOT_EXIST, AOR_OK, GetName(), LOGIN_UPD_REG_EMAIL, LoginDatabase, MAX_EMAIL_STR, normalizeString(), PreparedStatement::setString(), PreparedStatement::setUInt32(), and utf8length().
Referenced by account_commandscript::HandleAccountSetRegEmailCommand().
|
static |
Definition at line 133 of file AccountMgr.cpp.
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, SkyFire::Crypto::SRP6::MakeRegistrationData(), MAX_ACCOUNT_STR, normalizeString(), PreparedStatement::setBinary(), PreparedStatement::setString(), PreparedStatement::setUInt32(), and utf8length().
|
static |
Definition at line 321 of file AccountMgr.cpp.
References GetEmail(), and normalizeString().
Referenced by account_commandscript::HandleAccountEmailCommand(), and account_commandscript::HandleAccountPasswordCommand().
|
static |
Definition at line 298 of file AccountMgr.cpp.
References SkyFire::Crypto::SRP6::CheckLogin(), GetName(), LOGIN_SEL_CHECK_PASSWORD, LoginDatabase, normalizeString(), SkyFire::Crypto::SRP6::SALT_LENGTH, PreparedStatement::setUInt32(), and SkyFire::Crypto::SRP6::VERIFIER_LENGTH.
Referenced by account_commandscript::HandleAccountEmailCommand(), account_commandscript::HandleAccountPasswordCommand(), and ns1__executeCommand().
|
private |
Definition at line 523 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 23 of file AccountMgr.cpp.
References AOR_NAME_ALREADY_EXIST, AOR_NAME_TOO_LONG, AOR_OK, CONFIG_BOOST_NEW_ACCOUNT, GetId(), LOGIN_INS_ACCOUNT, LOGIN_INS_REALM_CHARACTERS_INIT, LOGIN_UPD_ACCOUNT_BOOST, LoginDatabase, SkyFire::Crypto::SRP6::MakeRegistrationData(), MAX_ACCOUNT_STR, normalizeString(), PreparedStatement::setBinary(), PreparedStatement::setBool(), PreparedStatement::setString(), PreparedStatement::setUInt32(), sWorld, and utf8length().
|
static |
Definition at line 61 of file AccountMgr.cpp.
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(), HIGHGUID_PLAYER, WorldSession::KickPlayer(), LOGIN_DEL_ACCOUNT, LOGIN_DEL_ACCOUNT_ACCESS, LOGIN_DEL_ACCOUNT_BANNED, LOGIN_DEL_REALM_CHARACTERS, LOGIN_SEL_ACCOUNT_BY_ID, LoginDatabase, WorldSession::LogoutPlayer(), MAKE_NEW_GUID(), and PreparedStatement::setUInt32().
Referenced by account_commandscript::HandleAccountDeleteCommand().
Definition at line 338 of file AccountMgr.cpp.
References CHAR_SEL_SUM_CHARS, CharacterDatabase, and PreparedStatement::setUInt32().
Referenced by character_commandscript::HandleCharacterDeletedRestoreHelper(), and PlayerDumpReader::LoadDump().
|
static |
Definition at line 283 of file AccountMgr.cpp.
References LOGIN_GET_EMAIL_BY_ID, LoginDatabase, and PreparedStatement::setUInt32().
Referenced by CheckEmail().
|
static |
Definition at line 240 of file AccountMgr.cpp.
References LOGIN_GET_ACCOUNT_ID_BY_USERNAME, LoginDatabase, and PreparedStatement::setString().
Referenced by CreateAccount(), account_commandscript::HandleAccountBoostAddCommand(), account_commandscript::HandleAccountBoostDelCommand(), account_commandscript::HandleAccountDeleteCommand(), account_commandscript::HandleAccountSetAddonCommand(), account_commandscript::HandleAccountSetEmailCommand(), account_commandscript::HandleAccountSetGmLevelCommand(), account_commandscript::HandleAccountSetPasswordCommand(), account_commandscript::HandleAccountSetRegEmailCommand(), ban_commandscript::HandleBanInfoAccountCommand(), character_commandscript::HandlePDumpLoadCommand(), ns1__executeCommand(), rbac_commandscript::ReadParams(), and World::RemoveBanAccount().
|
static |
Definition at line 268 of file AccountMgr.cpp.
References LOGIN_GET_USERNAME_BY_ID, LoginDatabase, and PreparedStatement::setUInt32().
Referenced by ChangeEmail(), ChangePassword(), ChangeRegEmail(), CheckPassword(), character_commandscript::GetDeletedCharacterInfoList(), account_commandscript::HandleAccountSetAddonCommand(), ban_commandscript::HandleBanListHelper(), character_commandscript::HandleCharacterDeletedRestoreCommand(), character_commandscript::HandleCharacterEraseCommand(), character_commandscript::HandlePDumpLoadCommand(), WorldSession::LoadPermissions(), Warden::Penalty(), and rbac_commandscript::ReadParams().
| rbac::RBACPermissionContainer const & AccountMgr::GetRBACDefaultPermissions | ( | uint8 | secLevel | ) |
Definition at line 532 of file AccountMgr.cpp.
References _defaultPermissions, and SF_LOG_TRACE.
| rbac::RBACPermission const * AccountMgr::GetRBACPermission | ( | uint32 | permission | ) | const |
Definition at line 496 of file AccountMgr.cpp.
References _permissions, and SF_LOG_TRACE.
|
inline |
Definition at line 76 of file AccountMgr.h.
References _permissions, and GetRBACPermissionList().
Referenced by GetRBACPermissionList().
|
static |
Definition at line 249 of file AccountMgr.cpp.
References LOGIN_GET_ACCOUNT_ACCESS_GMLEVEL, LoginDatabase, SEC_PLAYER, and PreparedStatement::setUInt32().
Referenced by account_commandscript::HandleAccountSetGmLevelCommand(), WorldSession::HandleAddFriendOpcodeCallBack(), ticket_commandscript::HandleGMTicketAssignToCommand(), ticket_commandscript::HandleGMTicketUnAssignCommand(), ticket_commandscript::HandleTicketAssignToCommand(), ticket_commandscript::HandleTicketUnAssignCommand(), ChatHandler::HasLowerSecurityAccount(), ns1__executeCommand(), and rbac_commandscript::ReadParams().
|
static |
Definition at line 258 of file AccountMgr.cpp.
References LOGIN_GET_GMLEVEL_BY_REALMID, LoginDatabase, SEC_PLAYER, PreparedStatement::setInt32(), and PreparedStatement::setUInt32().
Definition at line 506 of file AccountMgr.cpp.
References SF_LOG_DEBUG, and SF_LOG_ERROR.
Referenced by ticket_commandscript::HandleGMTicketAssignToCommand(), ticket_commandscript::HandleTicketAssignToCommand(), and AuctionHouseMgr::SendAuctionWonMail().
|
static |
Definition at line 371 of file AccountMgr.cpp.
References SEC_ADMINISTRATOR, and SEC_CONSOLE.
Referenced by ticket_commandscript::HandleGMTicketAssignToCommand(), and ticket_commandscript::HandleTicketAssignToCommand().
|
static |
Definition at line 376 of file AccountMgr.cpp.
References SEC_CONSOLE.
Referenced by account_commandscript::HandleAccountSetGmLevelCommand().
|
static |
Definition at line 366 of file AccountMgr.cpp.
References SEC_PLAYER.
Referenced by ChatHandler::ExecuteCommandInTable(), WorldSession::HandleAddFriendOpcodeCallBack(), Player::IsVisibleGloballyFor(), and Channel::JoinChannel().
| void AccountMgr::LoadRBAC | ( | ) |
Definition at line 381 of file AccountMgr.cpp.
References _defaultPermissions, _permissions, rbac::RBACPermission::AddLinkedPermission(), ClearRBAC(), getMSTime(), GetMSTimeDiffToNow(), Field::GetUInt32(), LoginDatabase, SF_LOG_DEBUG, SF_LOG_ERROR, and SF_LOG_INFO.
|
static |
Definition at line 348 of file AccountMgr.cpp.
References MAX_ACCOUNT_STR, Utf8toWStr(), wcharToUpperOnlyLatin(), and WStrToUtf8().
Referenced by ChangeEmail(), ChangePassword(), ChangeRegEmail(), ChangeUsername(), RASocket::check_access_level(), RASocket::check_password(), CheckEmail(), CheckPassword(), CreateAccount(), account_commandscript::HandleAccountBoostAddCommand(), account_commandscript::HandleAccountBoostDelCommand(), account_commandscript::HandleAccountDeleteCommand(), account_commandscript::HandleAccountSetAddonCommand(), account_commandscript::HandleAccountSetEmailCommand(), account_commandscript::HandleAccountSetGmLevelCommand(), account_commandscript::HandleAccountSetPasswordCommand(), account_commandscript::HandleAccountSetRegEmailCommand(), ban_commandscript::HandleBanHelper(), ban_commandscript::HandleBanInfoAccountCommand(), lookup_commandscript::HandleLookupPlayerAccountCommand(), character_commandscript::HandlePDumpLoadCommand(), ban_commandscript::HandleUnBanHelper(), and rbac_commandscript::ReadParams().
| void AccountMgr::UpdateAccountAccess | ( | rbac::RBACData * | rbac, |
| uint32 | accountId, | ||
| uint8 | securityLevel, | ||
| int32 | realmId ) |
Definition at line 465 of file AccountMgr.cpp.
References LOGIN_DEL_ACCOUNT_ACCESS, LOGIN_DEL_ACCOUNT_ACCESS_BY_REALM, LOGIN_INS_ACCOUNT_ACCESS, LoginDatabase, PreparedStatement::setInt32(), PreparedStatement::setUInt32(), and PreparedStatement::setUInt8().
|
friend |
Definition at line 37 of file AccountMgr.h.
|
private |
Definition at line 82 of file AccountMgr.h.
Referenced by ClearRBAC(), GetRBACDefaultPermissions(), and LoadRBAC().
|
private |
Definition at line 81 of file AccountMgr.h.
Referenced by ClearRBAC(), GetRBACPermission(), GetRBACPermissionList(), and LoadRBAC().