mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-28 08:06:23 +00:00
refactor(Core/Cache): move the GlobalPlayerCache to its own class (#9166)
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user