mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-18 03:15:41 +00:00
refactor(Core/Cache): move the GlobalPlayerCache to its own class (#9166)
This commit is contained in:
@@ -51,17 +51,16 @@ void WorldSession::HandleAddFriendOpcode(WorldPacket& recv_data)
|
||||
|
||||
LOG_DEBUG("network", "WORLD: %s asked to add friend : '%s'", GetPlayer()->GetName().c_str(), friendName.c_str());
|
||||
|
||||
// xinef: Get Data From global storage
|
||||
ObjectGuid friendGuid = sWorld->GetGlobalPlayerGUID(friendName);
|
||||
ObjectGuid friendGuid = sCharacterCache->GetCharacterGuidByName(friendName);
|
||||
if (!friendGuid)
|
||||
return;
|
||||
|
||||
GlobalPlayerData const* playerData = sWorld->GetGlobalPlayerData(friendGuid.GetCounter());
|
||||
CharacterCacheEntry const* playerData = sCharacterCache->GetCharacterCacheByGuid(friendGuid);
|
||||
if (!playerData)
|
||||
return;
|
||||
|
||||
uint32 friendAccountId = playerData->accountId;
|
||||
TeamId teamId = Player::TeamIdForRace(playerData->race);
|
||||
uint32 friendAccountId = playerData->AccountId;
|
||||
TeamId teamId = Player::TeamIdForRace(playerData->Race);
|
||||
FriendsResult friendResult = FRIEND_NOT_FOUND;
|
||||
|
||||
if (!AccountMgr::IsPlayerAccount(GetSecurity()) || sWorld->getBoolConfig(CONFIG_ALLOW_GM_FRIEND)|| AccountMgr::IsPlayerAccount(AccountMgr::GetSecurity(friendAccountId, realm.Id.Realm)))
|
||||
@@ -118,7 +117,7 @@ void WorldSession::HandleAddIgnoreOpcode(WorldPacket& recv_data)
|
||||
|
||||
LOG_DEBUG("network", "WORLD: %s asked to Ignore: '%s'", GetPlayer()->GetName().c_str(), ignoreName.c_str());
|
||||
|
||||
ObjectGuid ignoreGuid = sWorld->GetGlobalPlayerGUID(ignoreName);
|
||||
ObjectGuid ignoreGuid = sCharacterCache->GetCharacterGuidByName(ignoreName);
|
||||
if (!ignoreGuid)
|
||||
return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user