AccountMgr singleton converted to namespace with free functions as it has no internal state
This commit is contained in:
@@ -155,7 +155,7 @@ bool ChatHandler::GetDeletedCharacterInfoList(DeletedInfoList& foundList, std::s
|
||||
info.accountId = fields[2].GetUInt32();
|
||||
|
||||
// account name will be empty for not existed account
|
||||
sAccountMgr->GetName(info.accountId, info.accountName);
|
||||
AccountMgr::GetName(info.accountId, info.accountName);
|
||||
|
||||
info.deleteDate = time_t(fields[3].GetUInt32());
|
||||
|
||||
@@ -278,7 +278,7 @@ void ChatHandler::HandleCharacterDeletedRestoreHelper(DeletedInfo const& delInfo
|
||||
}
|
||||
|
||||
// check character count
|
||||
uint32 charcount = sAccountMgr->GetCharactersCount(delInfo.accountId);
|
||||
uint32 charcount = AccountMgr::GetCharactersCount(delInfo.accountId);
|
||||
if (charcount >= 10)
|
||||
{
|
||||
PSendSysMessage(LANG_CHARACTER_DELETED_SKIP_FULL, delInfo.name.c_str(), delInfo.lowguid, delInfo.accountId);
|
||||
@@ -350,7 +350,7 @@ bool ChatHandler::HandleCharacterDeletedRestoreCommand(const char* args)
|
||||
if (newAccount && newAccount != delInfo.accountId)
|
||||
{
|
||||
delInfo.accountId = newAccount;
|
||||
sAccountMgr->GetName(newAccount, delInfo.accountName);
|
||||
AccountMgr::GetName(newAccount, delInfo.accountName);
|
||||
}
|
||||
|
||||
HandleCharacterDeletedRestoreHelper(delInfo);
|
||||
@@ -466,7 +466,7 @@ bool ChatHandler::HandleCharacterEraseCommand(const char* args){
|
||||
}
|
||||
|
||||
std::string account_name;
|
||||
sAccountMgr->GetName (account_id, account_name);
|
||||
AccountMgr::GetName (account_id, account_name);
|
||||
|
||||
Player::DeleteFromDB(character_guid, account_id, true, true);
|
||||
PSendSysMessage(LANG_CHARACTER_DELETED, character_name.c_str(), GUID_LOPART(character_guid), account_name.c_str(), account_id);
|
||||
|
||||
@@ -213,7 +213,7 @@ int RASocket::check_password(const std::string& user, const std::string& pass)
|
||||
AccountMgr::normalizeString(safe_pass);
|
||||
LoginDatabase.EscapeString(safe_pass);
|
||||
|
||||
std::string hash = sAccountMgr->CalculateShaPassHash(safe_user, safe_pass);
|
||||
std::string hash = AccountMgr::CalculateShaPassHash(safe_user, safe_pass);
|
||||
|
||||
QueryResult check = LoginDatabase.PQuery(
|
||||
"SELECT 1 FROM account WHERE username = '%s' AND sha_pass_hash = '%s'",
|
||||
|
||||
@@ -82,20 +82,20 @@ int ns1__executeCommand(soap* soap, char* command, char** result)
|
||||
return 401;
|
||||
}
|
||||
|
||||
uint32 accountId = sAccountMgr->GetId(soap->userid);
|
||||
uint32 accountId = AccountMgr::GetId(soap->userid);
|
||||
if(!accountId)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "TCSoap: Client used invalid username '%s'", soap->userid);
|
||||
return 401;
|
||||
}
|
||||
|
||||
if(!sAccountMgr->CheckPassword(accountId, soap->passwd))
|
||||
if(!AccountMgr::CheckPassword(accountId, soap->passwd))
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "TCSoap: invalid password for account '%s'", soap->userid);
|
||||
return 401;
|
||||
}
|
||||
|
||||
if(sAccountMgr->GetSecurity(accountId) < SEC_ADMINISTRATOR)
|
||||
if(AccountMgr::GetSecurity(accountId) < SEC_ADMINISTRATOR)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "TCSoap: %s's gmlevel is too low", soap->userid);
|
||||
return 403;
|
||||
|
||||
Reference in New Issue
Block a user