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
+4 -4
View File
@@ -1291,7 +1291,7 @@ namespace Game.Chat
ObjectGuid parseGUID = ObjectGuid.Create(HighGuid.Player, args.NextUInt64());
// ... and make sure we get a target, somehow.
if (ObjectManager.GetPlayerNameByGUID(parseGUID, out targetName))
if (Global.CharacterCacheStorage.GetCharacterNameByGuid(parseGUID, out targetName))
{
target = Global.ObjAccessor.FindPlayer(parseGUID);
targetGuid = parseGUID;
@@ -1673,7 +1673,7 @@ namespace Game.Chat
if (!handler.extractPlayerTarget(new StringArguments(nameStr), out target, out targetGuid, out targetName))
return false;
uint accountId = target ? target.GetSession().GetAccountId() : ObjectManager.GetPlayerAccountIdByGUID(targetGuid);
uint accountId = target ? target.GetSession().GetAccountId() : Global.CharacterCacheStorage.GetCharacterAccountIdByGuid(targetGuid);
// find only player from same account if any
if (!target)
@@ -1745,7 +1745,7 @@ namespace Game.Chat
if (!handler.extractPlayerTarget(args, out target, out targetGuid, out targetName))
return false;
uint accountId = target ? target.GetSession().GetAccountId() : ObjectManager.GetPlayerAccountIdByGUID(targetGuid);
uint accountId = target ? target.GetSession().GetAccountId() : Global.CharacterCacheStorage.GetCharacterAccountIdByGuid(targetGuid);
// find only player from same account if any
if (!target)
@@ -2259,7 +2259,7 @@ namespace Game.Chat
if (!string.IsNullOrEmpty(targetName))
{
// Check for offline players
ObjectGuid guid = ObjectManager.GetPlayerGUIDByName(name);
ObjectGuid guid = Global.CharacterCacheStorage.GetCharacterGuidByName(name);
if (guid.IsEmpty())
{
handler.SendSysMessage(CypherStrings.CommandFreezeWrong);