Core/Misc: Moved CharacterInfo out of world to separate class

Closes #19030

(cherrypicked from 59ce3d6c9bd82d55cbfa505bb945b71cab21a12f)
This commit is contained in:
xinef1
2019-07-21 21:06:54 +02:00
committed by Shauren
parent 241e79f434
commit ad4e63bae1
41 changed files with 540 additions and 415 deletions
@@ -17,6 +17,7 @@
#include "QueryPackets.h"
#include "BattlenetAccountMgr.h"
#include "CharacterCache.h"
#include "ObjectMgr.h"
#include "Player.h"
#include "World.h"
@@ -121,7 +122,7 @@ ByteBuffer& operator<<(ByteBuffer& data, WorldPackets::Query::PlayerGuidLookupHi
bool WorldPackets::Query::PlayerGuidLookupData::Initialize(ObjectGuid const& guid, Player const* player /*= nullptr*/)
{
CharacterInfo const* characterInfo = sWorld->GetCharacterInfo(guid);
CharacterCacheEntry const* characterInfo = sCharacterCache->GetCharacterCacheByGuid(guid);
if (!characterInfo)
return false;
@@ -142,7 +143,7 @@ bool WorldPackets::Query::PlayerGuidLookupData::Initialize(ObjectGuid const& gui
}
else
{
uint32 accountId = ObjectMgr::GetPlayerAccountIdByGUID(guid);
uint32 accountId = sCharacterCache->GetCharacterAccountIdByGuid(guid);
uint32 bnetAccountId = ::Battlenet::AccountMgr::GetIdByGameAccount(accountId);
AccountID = ObjectGuid::Create<HighGuid::WowAccount>(accountId);