refactor(Core/Cache): move the GlobalPlayerCache to its own class (#9166)

This commit is contained in:
Skjalf
2021-11-18 12:53:36 -03:00
committed by GitHub
parent 00dc369cb6
commit 731d256420
47 changed files with 898 additions and 595 deletions

View File

@@ -102,7 +102,7 @@ BanReturn BanMgr::BanAccountByPlayerName(std::string const& CharacterName, std::
uint32 DurationSecs = TimeStringToSecs(Duration);
uint32 AccountID = sObjectMgr->GetPlayerAccountIdByPlayerName(CharacterName);
uint32 AccountID = sCharacterCache->GetCharacterAccountIdByName(CharacterName);
if (!AccountID)
return BAN_NOTFOUND;
@@ -228,7 +228,7 @@ BanReturn BanMgr::BanCharacter(std::string const& CharacterName, std::string con
/// Pick a player to ban if not online
if (!target)
{
TargetGUID = sWorld->GetGlobalPlayerGUID(CharacterName);
TargetGUID = sCharacterCache->GetCharacterGuidByName(CharacterName);
if (!TargetGUID)
return BAN_NOTFOUND;
}
@@ -284,7 +284,7 @@ bool BanMgr::RemoveBanAccount(std::string const& AccountName)
/// Remove a ban from an player name
bool BanMgr::RemoveBanAccountByPlayerName(std::string const& CharacterName)
{
uint32 AccountID = sObjectMgr->GetPlayerAccountIdByPlayerName(CharacterName);
uint32 AccountID = sCharacterCache->GetCharacterAccountIdByName(CharacterName);
if (!AccountID)
return false;
@@ -314,7 +314,7 @@ bool BanMgr::RemoveBanCharacter(std::string const& CharacterName)
/// Pick a player to ban if not online
if (!pBanned)
guid = sWorld->GetGlobalPlayerGUID(CharacterName);
guid = sCharacterCache->GetCharacterGuidByName(CharacterName);
else
guid = pBanned->GetGUID();