18#ifndef CreatureTextMgrImpl_h__
19#define CreatureTextMgrImpl_h__
29template<
class Builder>
46 _cache[loc_idx].reset(sender);
49 sender =
_cache[loc_idx].get();
74template<
class Builder>
90 if (
Group const* group = whisperPlayer->GetGroup())
91 group->BroadcastWorker(localizer);
118 if (itr->GetSource()->GetAreaId() == areaId && (!team ||
Team(itr->GetSource()->GetEffectiveTeam()) == team) && (!gmOnly || itr->GetSource()->IsGameMaster()))
119 localizer(itr->GetSource());
127 if (itr->GetSource()->GetZoneId() == zoneId && (!team ||
Team(itr->GetSource()->GetEffectiveTeam()) == team) && (!gmOnly || itr->GetSource()->IsGameMaster()))
128 localizer(itr->GetSource());
135 if ((!team ||
Team(itr->GetSource()->GetEffectiveTeam()) == team) && (!gmOnly || itr->GetSource()->IsGameMaster()))
136 localizer(itr->GetSource());
142 for (SessionMap::const_iterator iter = smap.begin(); iter != smap.end(); ++iter)
143 if (
Player* player = iter->second->GetPlayer())
144 if ((!team ||
Team(player->GetTeam()) == team) && (!gmOnly || player->IsGameMaster()))
149 if (!whisperTarget || !whisperTarget->
IsPlayer())
152 localizer(whisperTarget->
ToPlayer());
@ CHAT_MSG_MONSTER_WHISPER
@ CHAT_MSG_RAID_BOSS_WHISPER
std::array< std::unique_ptr< Trinity::ChatPacketSender >, TOTAL_LOCALES > _cache
CreatureTextLocalizer(Builder const &builder, ChatMsg msgType)
void operator()(Player const *player) const
static void SendChatPacket(WorldObject *source, Builder const &builder, ChatMsg msgType, WorldObject const *whisperTarget=nullptr, CreatureTextRange range=TEXT_RANGE_NORMAL, Team team=TEAM_OTHER, bool gmOnly=false)
static float GetRangeForChatType(ChatMsg msgType)
PlayerList const & GetPlayers() const
static Player * ToPlayer(Object *o)
void SendDirectMessage(WorldPacket const *data) const
WorldSession * GetSession() const
WorldPackets::Chat::Chat UntranslatedPacket
WorldPacket const * Write() override
void SetReceiver(WorldObject const *receiver, LocaleConstant locale)
LocaleConstant GetSessionDbLocaleIndex() const
std::unordered_map< uint32, WorldSession * > SessionMap
static void VisitWorldObjects(WorldObject const *obj, T &visitor, float radius, bool dont_load=true)