aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Chat
diff options
context:
space:
mode:
authorxinef1 <w.szyszko2@gmail.com>2017-02-05 23:14:19 +0100
committerShauren <shauren.trinity@gmail.com>2017-02-05 23:14:19 +0100
commit59ce3d6c9bd82d55cbfa505bb945b71cab21a12f (patch)
tree11e0f0f2ae3f3baffff0586f785ebbc7b7efd8aa /src/server/game/Chat
parent3c605ba614c45c4b8f99c12fb49f342c068054a5 (diff)
Core/Misc: Moved CharacterInfo out of world to separate class
Closes #19030
Diffstat (limited to 'src/server/game/Chat')
-rw-r--r--src/server/game/Chat/Channels/ChannelAppenders.h3
-rw-r--r--src/server/game/Chat/Chat.cpp12
2 files changed, 8 insertions, 7 deletions
diff --git a/src/server/game/Chat/Channels/ChannelAppenders.h b/src/server/game/Chat/Channels/ChannelAppenders.h
index 151d7b0b0fd..03daf416f30 100644
--- a/src/server/game/Chat/Channels/ChannelAppenders.h
+++ b/src/server/game/Chat/Channels/ChannelAppenders.h
@@ -19,6 +19,7 @@
#define _CHANNELAPPENDERS_H
#include "Channel.h"
+#include "CharacterCache.h"
// initial packet data (notify type and channel name)
template<class PacketModifier>
@@ -184,7 +185,7 @@ struct ChannelOwnerAppend
{
explicit ChannelOwnerAppend(Channel const* channel, ObjectGuid const& ownerGuid) : _channel(channel), _ownerGuid(ownerGuid)
{
- CharacterInfo const* cInfo = sWorld->GetCharacterInfo(_ownerGuid);
+ CharacterCacheEntry const* cInfo = sCharacterCache->GetCharacterCacheByGuid(_ownerGuid);
if (!cInfo || cInfo->Name.empty())
_ownerName = "PLAYER_NOT_FOUND";
else
diff --git a/src/server/game/Chat/Chat.cpp b/src/server/game/Chat/Chat.cpp
index 518d9c816ae..30aaee0787b 100644
--- a/src/server/game/Chat/Chat.cpp
+++ b/src/server/game/Chat/Chat.cpp
@@ -24,6 +24,7 @@
#include "AccountMgr.h"
#include "CellImpl.h"
+#include "CharacterCache.h"
#include "Chat.h"
#include "GridNotifiersImpl.h"
#include "Language.h"
@@ -87,7 +88,7 @@ bool ChatHandler::HasLowerSecurity(Player* target, ObjectGuid guid, bool strong)
if (target)
target_session = target->GetSession();
else if (guid)
- target_account = sObjectMgr->GetPlayerAccountIdByGUID(guid);
+ target_account = sCharacterCache->GetCharacterAccountIdByGuid(guid);
if (!target_session && !target_account)
{
@@ -1030,10 +1031,9 @@ ObjectGuid::LowType ChatHandler::extractLowGuidFromLink(char* text, HighGuid& gu
if (Player* player = ObjectAccessor::FindPlayerByName(name))
return player->GetGUID().GetCounter();
- if (ObjectGuid guid = sWorld->GetCharacterGuidByName(name))
- return guid.GetCounter();
+ ObjectGuid guid = sCharacterCache->GetCharacterGuidByName(name);
+ return guid.GetCounter();
- return 0;
}
case GUID_LINK_CREATURE:
{
@@ -1086,7 +1086,7 @@ bool ChatHandler::extractPlayerTarget(char* args, Player** player, ObjectGuid* p
*player = pl;
// if need guid value from DB (in name case for check player existence)
- ObjectGuid guid = !pl && (player_guid || player_name) ? sWorld->GetCharacterGuidByName(name) : ObjectGuid::Empty;
+ ObjectGuid guid = !pl && (player_guid || player_name) ? sCharacterCache->GetCharacterGuidByName(name) : ObjectGuid::Empty;
// if allowed player guid (if no then only online players allowed)
if (player_guid)
@@ -1245,7 +1245,7 @@ bool ChatHandler::GetPlayerGroupAndGUIDByName(char const* cname, Player*& player
player = ObjectAccessor::FindPlayerByName(name);
if (offline)
- guid = sWorld->GetCharacterGuidByName(name);
+ guid = sCharacterCache->GetCharacterGuidByName(name);
}
}