AccountMgr singleton converted to namespace with free functions as it has no internal state

This commit is contained in:
Spp-
2011-09-08 10:49:58 +02:00
parent e67a33eaaa
commit eddcb8ffbf
13 changed files with 50 additions and 55 deletions
+1 -1
View File
@@ -516,7 +516,7 @@ bool ChatHandler::HasLowerSecurityAccount(WorldSession* target, uint32 target_ac
if (target)
target_sec = target->GetSecurity();
else if (target_account)
target_sec = sAccountMgr->GetSecurity(target_account, realmID);
target_sec = AccountMgr::GetSecurity(target_account, realmID);
else
return true; // caller must report error for (target == NULL && target_account == 0)
+4 -4
View File
@@ -3065,7 +3065,7 @@ bool ChatHandler::HandleBanInfoAccountCommand(const char *args)
return false;
}
uint32 accountid = sAccountMgr->GetId(account_name);
uint32 accountid = AccountMgr::GetId(account_name);
if (!accountid)
{
PSendSysMessage(LANG_ACCOUNT_NOT_EXIST, account_name.c_str());
@@ -3342,7 +3342,7 @@ bool ChatHandler::HandleBanListHelper(QueryResult result)
account_name = fields[1].GetString();
// "character" case, name need extract from another DB
else
sAccountMgr->GetName (account_id, account_name);
AccountMgr::GetName (account_id, account_name);
// No SQL injection. id is uint32.
QueryResult banInfo = LoginDatabase.PQuery("SELECT bandate, unbandate, bannedby, banreason FROM account_banned WHERE id = %u ORDER BY unbandate", account_id);
@@ -3505,7 +3505,7 @@ bool ChatHandler::HandlePDumpLoadCommand(const char *args)
return false;
}
uint32 account_id = sAccountMgr->GetId(account_name);
uint32 account_id = AccountMgr::GetId(account_name);
if (!account_id)
{
account_id = atoi(account); // use original string
@@ -3517,7 +3517,7 @@ bool ChatHandler::HandlePDumpLoadCommand(const char *args)
}
}
if (!sAccountMgr->GetName(account_id, account_name))
if (!AccountMgr::GetName(account_id, account_name))
{
PSendSysMessage(LANG_ACCOUNT_NOT_EXIST, account_name.c_str());
SetSentErrorMessage(true);
@@ -169,7 +169,7 @@ bool ChatHandler::HandleGMTicketAssignToCommand(const char* args)
// Get target information
uint64 targetGuid = sObjectMgr->GetPlayerGUIDByName(target.c_str());
uint64 targetAccId = sObjectMgr->GetPlayerAccountIdByGUID(targetGuid);
uint32 targetGmLevel = sAccountMgr->GetSecurity(targetAccId, realmID);
uint32 targetGmLevel = AccountMgr::GetSecurity(targetAccId, realmID);
// Target must exist and have administrative rights
if (!targetGuid || targetGmLevel == SEC_PLAYER)
{
@@ -227,7 +227,7 @@ bool ChatHandler::HandleGMTicketUnAssignCommand(const char* args)
{
uint64 guid = ticket->GetAssignedToGUID();
uint32 accountId = sObjectMgr->GetPlayerAccountIdByGUID(guid);
security = sAccountMgr->GetSecurity(accountId, realmID);
security = AccountMgr::GetSecurity(accountId, realmID);
}
// Check security
Player* player = m_session->GetPlayer();