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

Port From (https://github.com/TrinityCore/TrinityCore/commit/ad4e63bae145ae49b584ab2fc621660430cec0d3)
This commit is contained in:
hondacrx
2019-08-16 13:43:17 -04:00
parent ea35c2ca62
commit 3634bc7133
56 changed files with 598 additions and 527 deletions
+5 -4
View File
@@ -20,6 +20,7 @@ using Framework.Constants;
using Framework.Dynamic;
using Framework.GameMath;
using Framework.IO;
using Game.Cache;
using Game.Entities;
using System;
using System.Collections.Generic;
@@ -624,7 +625,7 @@ namespace Game.Network.Packets
{
public bool Initialize(ObjectGuid guid, Player player = null)
{
CharacterInfo characterInfo = Global.WorldMgr.GetCharacterInfo(guid);
CharacterCacheEntry characterInfo = Global.CharacterCacheStorage.GetCharacterCacheByGuid(guid);
if (characterInfo == null)
return false;
@@ -646,15 +647,15 @@ namespace Game.Network.Packets
}
else
{
uint accountId = ObjectManager.GetPlayerAccountIdByGUID(guid);
uint accountId = Global.CharacterCacheStorage.GetCharacterAccountIdByGuid(guid);
uint bnetAccountId = Global.BNetAccountMgr.GetIdByGameAccount(accountId);
AccountID = ObjectGuid.Create(HighGuid.WowAccount, accountId);
BnetAccountID = ObjectGuid.Create(HighGuid.BNetAccount, bnetAccountId);
Name = characterInfo.Name;
RaceID = characterInfo.RaceID;
RaceID = characterInfo.RaceId;
Sex = characterInfo.Sex;
ClassID = characterInfo.ClassID;
ClassID = characterInfo.ClassId;
Level = characterInfo.Level;
}