AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
ChatHandler Class Reference

#include "Chat.h"

Inheritance diagram for ChatHandler:
AddonChannelCommandHandler CliHandler

Public Member Functions

 ChatHandler (WorldSession *session)
 
virtual ~ChatHandler ()
 
void SendNotification (std::string_view str)
 
template<typename... Args>
void SendNotification (uint32 strId, Args &&... args)
 
template<typename... Args>
void SendNotification (char const *fmt, Args &&... args)
 
void SendGMText (std::string_view str)
 
template<typename... Args>
void SendGMText (uint32 strId, Args &&... args)
 
template<typename... Args>
void SendGMText (char const *fmt, Args &&... args)
 
void SendWorldText (std::string_view str)
 
template<typename... Args>
void SendWorldText (uint32 strId, Args &&... args)
 
template<typename... Args>
void SendWorldText (char const *fmt, Args &&... args)
 
void SendWorldTextOptional (std::string_view str, uint32 flag)
 
template<typename... Args>
void SendWorldTextOptional (uint32 strId, uint32 flag, Args &&... args)
 
template<typename... Args>
void SendWorldTextOptional (char const *fmt, uint32 flag, Args &&... args)
 
virtual std::string GetAcoreString (uint32 entry) const
 
virtual void SendSysMessage (std::string_view str, bool escapeCharacters=false)
 
void SendSysMessage (uint32 entry)
 
void PSendSysMessage (std::string_view str, bool escapeCharacters=false)
 
template<typename... Args>
void PSendSysMessage (char const *fmt, Args &&... args)
 
template<typename... Args>
void PSendSysMessage (uint32 entry, Args &&... args)
 
template<typename... Args>
std::string PGetParseString (uint32 entry, Args &&... args) const
 
std::string const * GetModuleString (std::string module, uint32 id) const
 
template<typename... Args>
void PSendModuleSysMessage (std::string module, uint32 id, Args &&... args)
 
template<typename... Args>
std::string PGetParseModuleString (std::string module, uint32 id, Args &&... args) const
 
void SendErrorMessage (uint32 entry)
 
void SendErrorMessage (std::string_view str, bool escapeCharacters)
 
template<typename... Args>
void SendErrorMessage (char const *fmt, Args &&... args)
 
template<typename... Args>
void SendErrorMessage (uint32 entry, Args &&... args)
 
bool _ParseCommands (std::string_view text)
 
virtual bool ParseCommands (std::string_view text)
 
void SendGlobalSysMessage (const char *str)
 
virtual bool IsHumanReadable () const
 
virtual std::string GetNameLink () const
 
virtual bool needReportToTarget (Player *chr) const
 
virtual LocaleConstant GetSessionDbcLocale () const
 
virtual int GetSessionDbLocaleIndex () const
 
bool HasLowerSecurity (Player *target, ObjectGuid guid=ObjectGuid::Empty, bool strong=false)
 
bool HasLowerSecurityAccount (WorldSession *target, uint32 account, bool strong=false)
 
void SendGlobalGMSysMessage (const char *str)
 
PlayergetSelectedPlayer () const
 
CreaturegetSelectedCreature () const
 
UnitgetSelectedUnit () const
 
WorldObjectgetSelectedObject () const
 
PlayergetSelectedPlayerOrSelf () const
 
virtual bool HasSession () const
 
void DoForAllValidSessions (std::function< void(Player *)> exec)
 
char * extractKeyFromLink (char *text, char const *linkType, char **something1=nullptr)
 
char * extractKeyFromLink (char *text, char const *const *linkTypes, int *found_idx, char **something1=nullptr)
 
char * extractQuotedArg (char *args)
 
uint32 extractSpellIdFromLink (char *text)
 
ObjectGuid::LowType extractLowGuidFromLink (char *text, HighGuid &guidHigh)
 
bool GetPlayerGroupAndGUIDByName (const char *cname, Player *&player, Group *&group, ObjectGuid &guid, bool offline=false)
 
std::string extractPlayerNameFromLink (char *text)
 
bool extractPlayerTarget (char *args, Player **player, ObjectGuid *player_guid=nullptr, std::string *player_name=nullptr)
 
std::string playerLink (std::string const &name) const
 
std::string GetNameLink (Player *chr) const
 
GameObjectGetNearbyGameObject () const
 
GameObjectGetObjectFromPlayerMapByDbGuid (ObjectGuid::LowType lowguid)
 
CreatureGetCreatureFromPlayerMapByDbGuid (ObjectGuid::LowType lowguid)
 
bool HasSentErrorMessage () const
 
void SetSentErrorMessage (bool val)
 
bool IsConsole () const
 
PlayerGetPlayer () const
 
WorldSessionGetSession ()
 
bool IsAvailable (uint32 securityLevel) const
 

Static Public Member Functions

static std::size_t BuildChatPacket (WorldPacket &data, ChatMsg chatType, Language language, ObjectGuid senderGUID, ObjectGuid receiverGUID, std::string_view message, uint8 chatTag, std::string const &senderName="", std::string const &receiverName="", uint32 achievementId=0, bool gmMessage=false, std::string const &channelName="")
 
static std::size_t BuildChatPacket (WorldPacket &data, ChatMsg chatType, Language language, WorldObject const *sender, WorldObject const *receiver, std::string_view message, uint32 achievementId=0, std::string const &channelName="", LocaleConstant locale=DEFAULT_LOCALE)
 
static char * LineFromMessage (char *&pos)
 

Protected Member Functions

 ChatHandler ()
 

Private Attributes

WorldSessionm_session
 
bool sentErrorMessage
 

Detailed Description

Constructor & Destructor Documentation

◆ ChatHandler() [1/2]

ChatHandler::ChatHandler ( WorldSession session)
inlineexplicit
39: m_session(session), sentErrorMessage(false) {}
WorldSession * m_session
Definition Chat.h:248
bool sentErrorMessage
Definition Chat.h:251

◆ ~ChatHandler()

virtual ChatHandler::~ChatHandler ( )
inlinevirtual
40{ }

◆ ChatHandler() [2/2]

ChatHandler::ChatHandler ( )
inlineexplicitprotected
245: m_session(nullptr), sentErrorMessage(false) {} // for CLI subclass

Member Function Documentation

◆ _ParseCommands()

bool ChatHandler::_ParseCommands ( std::string_view  text)
229{
231 return true;
232
233 // Pretend commands don't exist for regular players
235 return false;
236
237 // Send error message for GMs
239 return true;
240}
@ CONFIG_ALLOW_PLAYER_COMMANDS
Definition IWorld.h:66
@ LANG_CMD_INVALID
Definition Language.h:38
void SendErrorMessage(uint32 entry)
Definition Chat.cpp:216
AccountTypes GetSecurity() const
Definition WorldSession.h:373
#define sWorld
Definition World.h:363
bool IsPlayerAccount(uint32 gmlevel)
Definition AccountMgr.cpp:305
AC_GAME_API bool TryExecuteCommand(ChatHandler &handler, std::string_view cmd)
Definition ChatCommand.cpp:532

References CONFIG_ALLOW_PLAYER_COMMANDS, WorldSession::GetSecurity(), AccountMgr::IsPlayerAccount(), LANG_CMD_INVALID, m_session, SendErrorMessage(), sWorld, and Acore::ChatCommands::TryExecuteCommand().

Referenced by CliHandler::ParseCommands(), AddonChannelCommandHandler::ParseCommands(), and ParseCommands().

◆ BuildChatPacket() [1/2]

std::size_t ChatHandler::BuildChatPacket ( WorldPacket data,
ChatMsg  chatType,
Language  language,
ObjectGuid  senderGUID,
ObjectGuid  receiverGUID,
std::string_view  message,
uint8  chatTag,
std::string const &  senderName = "",
std::string const &  receiverName = "",
uint32  achievementId = 0,
bool  gmMessage = false,
std::string const &  channelName = "" 
)
static
268{
269 std::size_t receiverGUIDPos = 0;
271 data << uint8(chatType);
272 data << int32(language);
273 data << senderGUID;
274 data << uint32(0); // some flags
275 switch (chatType)
276 {
285 data << uint32(senderName.length() + 1);
286 data << senderName;
287 receiverGUIDPos = data.wpos();
288 data << receiverGUID;
289 if (receiverGUID && !receiverGUID.IsPlayer() && !receiverGUID.IsPet())
290 {
291 data << uint32(receiverName.length() + 1);
292 data << receiverName;
293 }
294 break;
296 data << uint32(senderName.length() + 1);
297 data << senderName;
298 receiverGUIDPos = data.wpos();
299 data << receiverGUID;
300 break;
304 receiverGUIDPos = data.wpos();
305 data << receiverGUID;
306 if (receiverGUID && !receiverGUID.IsPlayer())
307 {
308 data << uint32(receiverName.length() + 1);
309 data << receiverName;
310 }
311 break;
314 receiverGUIDPos = data.wpos();
315 data << receiverGUID;
316 break;
317 default:
318 if (gmMessage)
319 {
320 data << uint32(senderName.length() + 1);
321 data << senderName;
322 }
323
324 if (chatType == CHAT_MSG_CHANNEL)
325 {
326 ASSERT(channelName.length() > 0);
327 data << channelName;
328 }
329
330 receiverGUIDPos = data.wpos();
331 data << receiverGUID;
332 break;
333 }
334
335 data << uint32(message.length() + 1);
336 data << message;
337 data << uint8(chatTag);
338
339 if (chatType == CHAT_MSG_ACHIEVEMENT || chatType == CHAT_MSG_GUILD_ACHIEVEMENT)
340 data << uint32(achievementId);
341
342 return receiverGUIDPos;
343}
std::int32_t int32
Definition Define.h:103
std::uint8_t uint8
Definition Define.h:109
std::uint32_t uint32
Definition Define.h:107
#define ASSERT
Definition Errors.h:68
@ CHAT_MSG_MONSTER_WHISPER
Definition SharedDefines.h:3167
@ CHAT_MSG_RAID_BOSS_WHISPER
Definition SharedDefines.h:3194
@ CHAT_MSG_WHISPER_FOREIGN
Definition SharedDefines.h:3160
@ CHAT_MSG_GUILD_ACHIEVEMENT
Definition SharedDefines.h:3201
@ CHAT_MSG_BG_SYSTEM_ALLIANCE
Definition SharedDefines.h:3189
@ CHAT_MSG_MONSTER_PARTY
Definition SharedDefines.h:3165
@ CHAT_MSG_ACHIEVEMENT
Definition SharedDefines.h:3200
@ CHAT_MSG_RAID_BOSS_EMOTE
Definition SharedDefines.h:3193
@ CHAT_MSG_BATTLENET
Definition SharedDefines.h:3199
@ CHAT_MSG_MONSTER_EMOTE
Definition SharedDefines.h:3168
@ CHAT_MSG_MONSTER_SAY
Definition SharedDefines.h:3164
@ CHAT_MSG_MONSTER_YELL
Definition SharedDefines.h:3166
@ CHAT_MSG_BG_SYSTEM_HORDE
Definition SharedDefines.h:3190
@ CHAT_MSG_BG_SYSTEM_NEUTRAL
Definition SharedDefines.h:3188
@ CHAT_MSG_CHANNEL
Definition SharedDefines.h:3169
std::size_t wpos() const
Definition ByteBuffer.h:330
void Initialize(uint16 opcode, std::size_t newres=200)
Definition WorldPacket.h:68
@ SMSG_GM_MESSAGECHAT
Definition Opcodes.h:977
@ SMSG_MESSAGECHAT
Definition Opcodes.h:180

References ASSERT, CHAT_MSG_ACHIEVEMENT, CHAT_MSG_BATTLENET, CHAT_MSG_BG_SYSTEM_ALLIANCE, CHAT_MSG_BG_SYSTEM_HORDE, CHAT_MSG_BG_SYSTEM_NEUTRAL, CHAT_MSG_CHANNEL, CHAT_MSG_GUILD_ACHIEVEMENT, CHAT_MSG_MONSTER_EMOTE, CHAT_MSG_MONSTER_PARTY, CHAT_MSG_MONSTER_SAY, CHAT_MSG_MONSTER_WHISPER, CHAT_MSG_MONSTER_YELL, CHAT_MSG_RAID_BOSS_EMOTE, CHAT_MSG_RAID_BOSS_WHISPER, CHAT_MSG_WHISPER_FOREIGN, WorldPacket::Initialize(), SMSG_GM_MESSAGECHAT, SMSG_MESSAGECHAT, and ByteBuffer::wpos().

Referenced by Guild::BroadcastToGuild(), BuildChatPacket(), Acore::BattlegroundChatBuilder::do_helper(), Acore::WorldWorldTextBuilder::do_helper(), WorldSession::HandleChatIgnoredOpcode(), debug_commandscript::HandleDebugSendChatMsgCommand(), WorldSession::HandleMessagechatOpcode(), npc_spiritual_insight::npc_spiritual_insightAI::IsSummonedBy(), Acore::Battleground2ChatBuilder::operator()(), Acore::BroadcastTextBuilder::operator()(), Acore::CustomChatTextBuilder::operator()(), Acore::AcoreStringChatBuilder::operator()(), Acore::BroadcastTextBuilder::operator()(), CreatureTextBuilder::operator()(), PlayerTextBuilder::operator()(), Channel::Say(), Player::Say(), AddonChannelCommandHandler::Send(), SendGlobalGMSysMessage(), SendGlobalSysMessage(), SendGMText(), SendSysMessage(), AddonChannelCommandHandler::SendSysMessage(), SendWorldTextOptional(), WorldSessionMgr::SendZoneText(), Player::TextEmote(), Player::Whisper(), Unit::Whisper(), Unit::Whisper(), Player::Whisper(), Player::Yell(), and Battleground::YellToAll().

◆ BuildChatPacket() [2/2]

std::size_t ChatHandler::BuildChatPacket ( WorldPacket data,
ChatMsg  chatType,
Language  language,
WorldObject const *  sender,
WorldObject const *  receiver,
std::string_view  message,
uint32  achievementId = 0,
std::string const &  channelName = "",
LocaleConstant  locale = DEFAULT_LOCALE 
)
static
347{
348 ObjectGuid senderGUID;
349 std::string senderName = "";
350 uint8 chatTag = 0;
351 bool gmMessage = false;
352 ObjectGuid receiverGUID;
353 std::string receiverName = "";
354 if (sender)
355 {
356 senderGUID = sender->GetGUID();
357 senderName = sender->GetNameForLocaleIdx(locale);
358 if (Player const* playerSender = sender->ToPlayer())
359 {
360 chatTag = playerSender->GetChatTag();
361 gmMessage = playerSender->IsGameMaster();
362 }
363 }
364
365 if (receiver)
366 {
367 receiverGUID = receiver->GetGUID();
368 receiverName = receiver->GetNameForLocaleIdx(locale);
369 }
370
371 return BuildChatPacket(data, chatType, language, senderGUID, receiverGUID, message, chatTag, senderName, receiverName, achievementId, gmMessage, channelName);
372}
static std::size_t BuildChatPacket(WorldPacket &data, ChatMsg chatType, Language language, ObjectGuid senderGUID, ObjectGuid receiverGUID, std::string_view message, uint8 chatTag, std::string const &senderName="", std::string const &receiverName="", uint32 achievementId=0, bool gmMessage=false, std::string const &channelName="")
Definition Chat.cpp:265
Definition ObjectGuid.h:118
Player * ToPlayer()
Definition Object.h:201
Definition Player.h:1081

References BuildChatPacket(), Object::GetGUID(), WorldObject::GetNameForLocaleIdx(), and Object::ToPlayer().

◆ DoForAllValidSessions()

void ChatHandler::DoForAllValidSessions ( std::function< void(Player *)>  exec)
445{
446 WorldSessionMgr::SessionMap const& sessionMap = sWorldSessionMgr->GetAllSessions();
447 for (WorldSessionMgr::SessionMap::const_iterator itr = sessionMap.begin(); itr != sessionMap.end(); ++itr)
448 if (Player* player = itr->second->GetPlayer())
449 if (player->IsInWorld())
450 exec(player);
451}
#define sWorldSessionMgr
Definition WorldSessionMgr.h:110
std::unordered_map< uint32, WorldSession * > SessionMap
Definition WorldSessionMgr.h:56

References sWorldSessionMgr.

Referenced by AutobroadcastMgr::SendNotificationAnnouncement(), and AutobroadcastMgr::SendWorldAnnouncement().

◆ extractKeyFromLink() [1/2]

char * ChatHandler::extractKeyFromLink ( char *  text,
char const *const *  linkTypes,
int *  found_idx,
char **  something1 = nullptr 
)
502{
503 // skip empty
504 if (!text)
505 return nullptr;
506
507 // skip spaces
508 while (*text == ' ' || *text == '\t' || *text == '\b')
509 ++text;
510
511 if (!*text)
512 return nullptr;
513
514 // return non link case
515 if (text[0] != '|')
516 return strtok(text, " ");
517
518 // [name] Shift-click form |color|linkType:key|h[name]|h|r
519 // or
520 // [name] Shift-click form |color|linkType:key:something1:...:somethingN|h[name]|h|r
521 // or
522 // [name] Shift-click form |linkType:key|h[name]|h|r
523
524 char* tail;
525
526 if (text[1] == 'c')
527 {
528 char* check = strtok(text, "|"); // skip color
529 if (!check)
530 return nullptr; // end of data
531
532 tail = strtok(nullptr, ""); // tail
533 }
534 else
535 tail = text + 1; // skip first |
536
537 char* cLinkType = strtok(tail, ":"); // linktype
538 if (!cLinkType)
539 return nullptr; // end of data
540
541 for (int i = 0; linkTypes[i]; ++i)
542 {
543 if (strcmp(cLinkType, linkTypes[i]) == 0)
544 {
545 char* cKeys = strtok(nullptr, "|"); // extract keys and values
546 char* cKeysTail = strtok(nullptr, "");
547
548 char* cKey = strtok(cKeys, ":|"); // extract key
549 if (something1)
550 *something1 = strtok(nullptr, ":|"); // extract something
551
552 strtok(cKeysTail, "]"); // restart scan tail and skip name with possible spaces
553 strtok(nullptr, " "); // skip link tail (to allow continue strtok(nullptr, s) use after return from function
554 if (found_idx)
555 *found_idx = i;
556 return cKey;
557 }
558 }
559
560 strtok(nullptr, " "); // skip link tail (to allow continue strtok(nullptr, s) use after return from function
562 return nullptr;
563}
@ LANG_WRONG_LINK_TYPE
Definition Language.h:555
virtual void SendSysMessage(std::string_view str, bool escapeCharacters=false)
Definition Chat.cpp:160

References LANG_WRONG_LINK_TYPE, and SendSysMessage().

◆ extractKeyFromLink() [2/2]

char * ChatHandler::extractKeyFromLink ( char *  text,
char const *  linkType,
char **  something1 = nullptr 
)
454{
455 // skip empty
456 if (!text)
457 return nullptr;
458
459 // skip spaces
460 while (*text == ' ' || *text == '\t' || *text == '\b')
461 ++text;
462
463 if (!*text)
464 return nullptr;
465
466 // return non link case
467 if (text[0] != '|')
468 return strtok(text, " ");
469
470 // [name] Shift-click form |color|linkType:key|h[name]|h|r
471 // or
472 // [name] Shift-click form |color|linkType:key:something1:...:somethingN|h[name]|h|r
473
474 char* check = strtok(text, "|"); // skip color
475 if (!check)
476 return nullptr; // end of data
477
478 char* cLinkType = strtok(nullptr, ":"); // linktype
479 if (!cLinkType)
480 return nullptr; // end of data
481
482 if (strcmp(cLinkType, linkType) != 0)
483 {
484 strtok(nullptr, " "); // skip link tail (to allow continue strtok(nullptr, s) use after retturn from function
486 return nullptr;
487 }
488
489 char* cKeys = strtok(nullptr, "|"); // extract keys and values
490 char* cKeysTail = strtok(nullptr, "");
491
492 char* cKey = strtok(cKeys, ":|"); // extract key
493 if (something1)
494 *something1 = strtok(nullptr, ":|"); // extract something
495
496 strtok(cKeysTail, "]"); // restart scan tail and skip name with possible spaces
497 strtok(nullptr, " "); // skip link tail (to allow continue strtok(nullptr, s) use after return from function
498 return cKey;
499}

References LANG_WRONG_LINK_TYPE, and SendSysMessage().

Referenced by extractLowGuidFromLink(), extractPlayerNameFromLink(), and extractSpellIdFromLink().

◆ extractLowGuidFromLink()

ObjectGuid::LowType ChatHandler::extractLowGuidFromLink ( char *  text,
HighGuid guidHigh 
)
698{
699 int type = 0;
700
701 // |color|Hcreature:creature_guid|h[name]|h|r
702 // |color|Hgameobject:go_guid|h[name]|h|r
703 // |color|Hplayer:name|h[name]|h|r
704 char* idS = extractKeyFromLink(text, guidKeys, &type);
705 if (!idS)
706 return 0;
707
708 switch (type)
709 {
711 {
712 guidHigh = HighGuid::Player;
713
714 std::string name = idS;
715 if (!normalizePlayerName(name))
716 return 0;
717
718 if (Player* player = ObjectAccessor::FindPlayerByName(name, false))
719 return player->GetGUID().GetCounter();
720
721 if (ObjectGuid guid = sCharacterCache->GetCharacterGuidByName(name))
722 return guid.GetCounter();
723
724 return 0;
725 }
727 {
728 guidHigh = HighGuid::Unit;
729
730 ObjectGuid::LowType lowguid = (uint32)atol(idS);
731
732 if (sObjectMgr->GetCreatureData(lowguid))
733 return lowguid;
734 else
735 return 0;
736 }
738 {
739 guidHigh = HighGuid::GameObject;
740
741 ObjectGuid::LowType lowguid = (uint32)atol(idS);
742
743 if (sObjectMgr->GetGameObjectData(lowguid))
744 return lowguid;
745 else
746 return 0;
747 }
748 }
749
750 // unknown type?
751 return 0;
752}
#define sCharacterCache
Definition CharacterCache.h:83
@ SPELL_LINK_PLAYER
Definition Chat.cpp:684
@ SPELL_LINK_CREATURE
Definition Chat.cpp:685
@ SPELL_LINK_GAMEOBJECT
Definition Chat.cpp:686
static char const *const guidKeys[]
Definition Chat.cpp:689
bool normalizePlayerName(std::string &name)
Definition ObjectMgr.cpp:208
#define sObjectMgr
Definition ObjectMgr.h:1636
char * extractKeyFromLink(char *text, char const *linkType, char **something1=nullptr)
Definition Chat.cpp:453
uint32 LowType
Definition ObjectGuid.h:122
Player * FindPlayerByName(std::string const &name, bool checkInWorld=true)
Definition ObjectAccessor.cpp:271

References extractKeyFromLink(), ObjectAccessor::FindPlayerByName(), GameObject, guidKeys, normalizePlayerName(), Player, sCharacterCache, sObjectMgr, SPELL_LINK_CREATURE, SPELL_LINK_GAMEOBJECT, SPELL_LINK_PLAYER, and Unit.

◆ extractPlayerNameFromLink()

std::string ChatHandler::extractPlayerNameFromLink ( char *  text)
755{
756 // |color|Hplayer:name|h[name]|h|r
757 char* name_str = extractKeyFromLink(text, "Hplayer");
758 if (!name_str)
759 return "";
760
761 std::string name = name_str;
762 if (!normalizePlayerName(name))
763 return "";
764
765 return name;
766}

References extractKeyFromLink(), and normalizePlayerName().

Referenced by extractPlayerTarget().

◆ extractPlayerTarget()

bool ChatHandler::extractPlayerTarget ( char *  args,
Player **  player,
ObjectGuid player_guid = nullptr,
std::string *  player_name = nullptr 
)
769{
770 if (args && *args)
771 {
772 std::string name = extractPlayerNameFromLink(args);
773 if (name.empty())
774 {
776 return false;
777 }
778
779 Player* pl = ObjectAccessor::FindPlayerByName(name, false);
780
781 // if allowed player pointer
782 if (player)
783 *player = pl;
784
785 // if need guid value from DB (in name case for check player existence)
786 ObjectGuid guid = !pl && (player_guid || player_name) ? sCharacterCache->GetCharacterGuidByName(name) : ObjectGuid::Empty;
787
788 // if allowed player guid (if no then only online players allowed)
789 if (player_guid)
790 *player_guid = pl ? pl->GetGUID() : guid;
791
792 if (player_name)
793 *player_name = pl || guid ? name : "";
794 }
795 else
796 {
797 // populate strtok buffer to prevent crashes
798 static char dummy[1] = "";
799 strtok(dummy, "");
800
802 // if allowed player pointer
803 if (player)
804 *player = pl;
805
806 // if allowed player guid (if no then only online players allowed)
807 if (player_guid)
808 *player_guid = pl ? pl->GetGUID() : ObjectGuid::Empty;
809
810 if (player_name)
811 *player_name = pl ? pl->GetName() : "";
812 }
813
814 // some from req. data must be provided (note: name is empty if player not exist)
815 if ((!player || !*player) && (!player_guid || !*player_guid) && (!player_name || player_name->empty()))
816 {
818 return false;
819 }
820
821 return true;
822}
@ LANG_PLAYER_NOT_FOUND
Definition Language.h:540
std::string extractPlayerNameFromLink(char *text)
Definition Chat.cpp:754
Player * getSelectedPlayer() const
Definition Chat.cpp:374
static ObjectGuid const Empty
Definition ObjectGuid.h:120
static ObjectGuid GetGUID(Object const *o)
Definition Object.h:112
std::string const & GetName() const
Definition Object.h:463

References ObjectGuid::Empty, extractPlayerNameFromLink(), ObjectAccessor::FindPlayerByName(), Object::GetGUID(), WorldObject::GetName(), getSelectedPlayer(), LANG_PLAYER_NOT_FOUND, sCharacterCache, and SendErrorMessage().

◆ extractQuotedArg()

char * ChatHandler::extractQuotedArg ( char *  args)
825{
826 if (!*args)
827 return nullptr;
828
829 if (*args == '"')
830 return strtok(args + 1, "\"");
831 else
832 {
833 // skip spaces
834 while (*args == ' ')
835 {
836 args += 1;
837 continue;
838 }
839
840 // return nullptr if we reached the end of the string
841 if (!*args)
842 return nullptr;
843
844 // since we skipped all spaces, we expect another token now
845 if (*args == '"')
846 {
847 // return an empty string if there are 2 "" in a row.
848 // strtok doesn't handle this case
849 if (*(args + 1) == '"')
850 {
851 strtok(args, " ");
852 static char arg[1];
853 arg[0] = '\0';
854 return arg;
855 }
856 else
857 return strtok(args + 1, "\"");
858 }
859 else
860 return nullptr;
861 }
862}

◆ extractSpellIdFromLink()

uint32 ChatHandler::extractSpellIdFromLink ( char *  text)
629{
630 // number or [name] Shift-click form |color|Henchant:recipe_spell_id|h[prof_name: recipe_name]|h|r
631 // number or [name] Shift-click form |color|Hglyph:glyph_slot_id:glyph_prop_id|h[%s]|h|r
632 // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r
633 // number or [name] Shift-click form |color|Htalent:talent_id, rank|h[name]|h|r
634 // number or [name] Shift-click form |color|Htrade:spell_id, skill_id, max_value, cur_value|h[name]|h|r
635 int type = 0;
636 char* param1_str = nullptr;
637 char* idS = extractKeyFromLink(text, spellKeys, &type, &param1_str);
638 if (!idS)
639 return 0;
640
641 uint32 id = (uint32)atol(idS);
642
643 switch (type)
644 {
645 case SPELL_LINK_SPELL:
646 return id;
648 {
649 // talent
650 TalentEntry const* talentEntry = sTalentStore.LookupEntry(id);
651 if (!talentEntry)
652 return 0;
653
654 int32 rank = param1_str ? (uint32)atol(param1_str) : 0;
655 if (rank >= MAX_TALENT_RANK)
656 return 0;
657
658 if (rank < 0)
659 rank = 0;
660
661 return talentEntry->RankID[rank];
662 }
664 case SPELL_LINK_TRADE:
665 return id;
666 case SPELL_LINK_GLYPH:
667 {
668 uint32 glyph_prop_id = param1_str ? (uint32)atol(param1_str) : 0;
669
670 GlyphPropertiesEntry const* glyphPropEntry = sGlyphPropertiesStore.LookupEntry(glyph_prop_id);
671 if (!glyphPropEntry)
672 return 0;
673
674 return glyphPropEntry->SpellId;
675 }
676 }
677
678 // unknown type?
679 return 0;
680}
@ SPELL_LINK_SPELL
Definition Chat.cpp:611
@ SPELL_LINK_GLYPH
Definition Chat.cpp:615
@ SPELL_LINK_TALENT
Definition Chat.cpp:612
@ SPELL_LINK_ENCHANT
Definition Chat.cpp:613
@ SPELL_LINK_TRADE
Definition Chat.cpp:614
static char const *const spellKeys[]
Definition Chat.cpp:618
DBCStorage< TalentEntry > sTalentStore(TalentEntryfmt)
DBCStorage< GlyphPropertiesEntry > sGlyphPropertiesStore(GlyphPropertiesfmt)
#define MAX_TALENT_RANK
Definition DBCStructure.h:1917
Definition DBCStructure.h:1020
uint32 SpellId
Definition DBCStructure.h:1022
Definition DBCStructure.h:1922
std::array< uint32, MAX_TALENT_RANK > RankID
Definition DBCStructure.h:1927

References extractKeyFromLink(), MAX_TALENT_RANK, TalentEntry::RankID, sGlyphPropertiesStore, SPELL_LINK_ENCHANT, SPELL_LINK_GLYPH, SPELL_LINK_SPELL, SPELL_LINK_TALENT, SPELL_LINK_TRADE, GlyphPropertiesEntry::SpellId, spellKeys, and sTalentStore.

◆ GetAcoreString()

std::string ChatHandler::GetAcoreString ( uint32  entry) const
virtual

Reimplemented in CliHandler.

42{
43 return m_session->GetAcoreString(entry);
44}
std::string GetAcoreString(uint32 entry) const
Definition WorldSession.cpp:807

References WorldSession::GetAcoreString(), and m_session.

Referenced by tele_commandscript::DoNameTeleport(), Acore::Impl::ChatCommands::GetAcoreString(), message_commandscript::HandleAnnounceCommand(), ban_commandscript::HandleBanInfoCharacterCommand(), ban_commandscript::HandleBanInfoHelper(), ban_commandscript::HandleBanInfoIPCommand(), character_commandscript::HandleCharacterReputationCommand(), character_commandscript::HandleCharacterTitlesCommand(), misc_commandscript::HandleCooldownCommand(), event_commandscript::HandleEventActiveListCommand(), event_commandscript::HandleEventInfoCommand(), message_commandscript::HandleGMNotifyCommand(), gm_commandscript::HandleGMVisibleCommand(), misc_commandscript::HandleKickPlayerCommand(), lookup_commandscript::HandleLookupEventCommand(), lookup_commandscript::HandleLookupFactionCommand(), lookup_commandscript::HandleLookupMapCommand(), lookup_commandscript::HandleLookupQuestCommand(), lookup_commandscript::HandleLookupSkillCommand(), lookup_commandscript::HandleLookupSpellCommand(), lookup_commandscript::HandleLookupSpellIdCommand(), lookup_commandscript::HandleLookupTitleCommand(), modify_commandscript::HandleModifyEnergyCommand(), modify_commandscript::HandleModifyMoneyCommand(), modify_commandscript::HandleModifyRepCommand(), misc_commandscript::HandleMuteCommand(), misc_commandscript::HandleNearGraveCommand(), message_commandscript::HandleNotifyCommand(), misc_commandscript::HandlePInfoCommand(), misc_commandscript::HandleSummonCommand(), misc_commandscript::HandleUnstuckCommand(), message_commandscript::HandleWhispersCommand(), list_commandscript::ListAurasCommand(), and SendSysMessage().

◆ GetCreatureFromPlayerMapByDbGuid()

Creature * ChatHandler::GetCreatureFromPlayerMapByDbGuid ( ObjectGuid::LowType  lowguid)
579{
580 if (!m_session)
581 return nullptr;
582
583 // Select the first alive creature or a dead one if not found
584 Creature* creature = nullptr;
585
586 auto bounds = m_session->GetPlayer()->GetMap()->GetCreatureBySpawnIdStore().equal_range(lowguid);
587 for (auto it = bounds.first; it != bounds.second; ++it)
588 {
589 creature = it->second;
590 if (it->second->IsAlive())
591 break;
592 }
593
594 return creature;
595}
Definition Creature.h:43
CreatureBySpawnIdContainer & GetCreatureBySpawnIdStore()
Definition Map.h:367
Map * GetMap() const
Definition Object.h:536
Player * GetPlayer() const
Definition WorldSession.h:376

References Map::GetCreatureBySpawnIdStore(), WorldObject::GetMap(), WorldSession::GetPlayer(), and m_session.

Referenced by npc_commandscript::HandleNpcDeleteCommand(), npc_commandscript::HandleNpcMoveCommand(), and npc_commandscript::HandleNpcSetMoveTypeCommand().

◆ GetModuleString()

std::string const * ChatHandler::GetModuleString ( std::string  module,
uint32  id 
) const
47{
48 return m_session->GetModuleString(module, id);
49}
std::string const * GetModuleString(std::string module, uint32 id) const
Definition WorldSession.cpp:812

References WorldSession::GetModuleString(), and m_session.

◆ GetNameLink() [1/2]

virtual std::string ChatHandler::GetNameLink ( ) const
inlinevirtual

Reimplemented in CliHandler.

198{ return GetNameLink(m_session->GetPlayer()); }
virtual std::string GetNameLink() const
Definition Chat.h:198

References GetNameLink().

Referenced by modify_commandscript::CheckModifySpeed(), tele_commandscript::DoNameTeleport(), GetNameLink(), misc_commandscript::HandleAddItemCommand(), character_commandscript::HandleCharacterChangeFactionCommand(), character_commandscript::HandleCharacterChangeRaceCommand(), character_commandscript::HandleCharacterCustomizeCommand(), character_commandscript::HandleCharacterLevel(), character_commandscript::HandleCharacterRenameCommand(), misc_commandscript::HandleCooldownCommand(), cheat_commandscript::HandleExploreCheatCommand(), gm_commandscript::HandleGMFlyCommand(), misc_commandscript::HandleGroupSummonCommand(), learn_commandscript::HandleLearnAllDefaultCommand(), Acore::PlayerCommand::HandleLearnSpellCommand(), modify_commandscript::HandleModifyArenaCommand(), modify_commandscript::HandleModifyEnergyCommand(), modify_commandscript::HandleModifyGenderCommand(), modify_commandscript::HandleModifyHonorCommand(), modify_commandscript::HandleModifyHPCommand(), modify_commandscript::HandleModifyManaCommand(), modify_commandscript::HandleModifyMoneyCommand(), modify_commandscript::HandleModifyRageCommand(), modify_commandscript::HandleModifyRepCommand(), modify_commandscript::HandleModifyRunicPowerCommand(), modify_commandscript::HandleModifyScaleCommand(), modify_commandscript::HandleModifySpellCommand(), reset_commandscript::HandleResetItemsAllAndDeleteBagsCommand(), reset_commandscript::HandleResetItemsAllCommand(), reset_commandscript::HandleResetItemsEquippedCommand(), reset_commandscript::HandleResetItemsInBagsCommand(), reset_commandscript::HandleResetItemsInBankCommand(), reset_commandscript::HandleResetItemsInCurrenciesListCommand(), reset_commandscript::HandleResetItemsInVendorBuyBackTabCommand(), reset_commandscript::HandleResetItemsKeyringCommand(), reset_commandscript::HandleResetSpellsCommand(), reset_commandscript::HandleResetTalentsCommand(), misc_commandscript::HandleSetSkillCommand(), cheat_commandscript::HandleTaxiCheatCommand(), tele_commandscript::HandleTeleGroupCommand(), titles_commandscript::HandleTitlesAddCommand(), titles_commandscript::HandleTitlesCurrentCommand(), titles_commandscript::HandleTitlesRemoveCommand(), titles_commandscript::HandleTitlesSetMaskCommand(), and modify_commandscript::NotifyModification().

◆ GetNameLink() [2/2]

std::string ChatHandler::GetNameLink ( Player chr) const
881{
882 return playerLink(chr->GetName());
883}
std::string playerLink(std::string const &name) const
Definition Chat.h:231

References WorldObject::GetName(), and playerLink().

◆ GetNearbyGameObject()

GameObject * ChatHandler::GetNearbyGameObject ( ) const
566{
567 if (!m_session)
568 return nullptr;
569
570 Player* pl = m_session->GetPlayer();
571 GameObject* obj = nullptr;
575 return obj;
576}
#define SIZE_OF_GRIDS
Definition MapDefines.h:26
Definition GridNotifiers.h:703
Definition GameObject.h:120
Definition GridNotifiers.h:335
static void VisitGridObjects(WorldObject const *obj, T &visitor, float radius)
Definition CellImpl.h:165

References WorldSession::GetPlayer(), m_session, SIZE_OF_GRIDS, and Cell::VisitGridObjects().

Referenced by getSelectedObject(), and debug_commandscript::HandleDebugSendOpcodeCommand().

◆ GetObjectFromPlayerMapByDbGuid()

◆ GetPlayer()

Player * ChatHandler::GetPlayer ( ) const
37{
38 return m_session ? m_session->GetPlayer() : nullptr;
39}

References WorldSession::GetPlayer(), and m_session.

Referenced by Acore::ChatCommands::PlayerIdentifier::FromSelf(), Acore::ChatCommands::PlayerIdentifier::FromTarget(), debug_commandscript::HandleDebugCooldownCommand(), debug_commandscript::HandleDebugEnterVehicleCommand(), debug_commandscript::HandleDebugGetItemStateCommand(), debug_commandscript::HandleDebugGetItemValueCommand(), debug_commandscript::HandleDebugItemExpireCommand(), debug_commandscript::HandleDebugMapDataCommand(), debug_commandscript::HandleDebugMod32ValueCommand(), debug_commandscript::HandleDebugMoveflagsCommand(), debug_commandscript::HandleDebugPlayCinematicCommand(), debug_commandscript::HandleDebugPlayMovieCommand(), debug_commandscript::HandleDebugPlayMusicCommand(), debug_commandscript::HandleDebugPlaySoundCommand(), debug_commandscript::HandleDebugSendBuyErrorCommand(), debug_commandscript::HandleDebugSendChatMsgCommand(), debug_commandscript::HandleDebugSendEquipErrorCommand(), debug_commandscript::HandleDebugSendQuestInvalidMsgCommand(), debug_commandscript::HandleDebugSendQuestPartyMsgCommand(), debug_commandscript::HandleDebugSendSellErrorCommand(), debug_commandscript::HandleDebugSetItemValueCommand(), debug_commandscript::HandleDebugSpawnVehicleCommand(), debug_commandscript::HandleDebugUpdateWorldStateCommand(), debug_commandscript::HandleDebugVisualCommand(), gm_commandscript::HandleGMOffCommand(), gm_commandscript::HandleGMOnCommand(), learn_commandscript::HandleLearnAllLangCommand(), Acore::PlayerCommand::HandleLearnSpellCommand(), misc_commandscript::HandleOpenDoorCommand(), reload_commandscript::HandleReloadMotdCommand(), player_settings_commandscript::HandleSettingsAnnouncerFlags(), and AddonChannelCommandHandler::Send().

◆ GetPlayerGroupAndGUIDByName()

bool ChatHandler::GetPlayerGroupAndGUIDByName ( const char *  cname,
Player *&  player,
Group *&  group,
ObjectGuid guid,
bool  offline = false 
)
919{
920 player = nullptr;
921 guid = ObjectGuid::Empty;
922
923 if (cname)
924 {
925 std::string name = cname;
926 if (!name.empty())
927 {
928 if (!normalizePlayerName(name))
929 {
931 return false;
932 }
933
934 player = ObjectAccessor::FindPlayerByName(name, false);
935 if (offline)
936 {
937 guid = sCharacterCache->GetCharacterGuidByName(name);
938 }
939 }
940 }
941
942 if (player)
943 {
944 group = player->GetGroup();
945 if (!guid || !offline)
946 guid = player->GetGUID();
947 }
948 else
949 {
950 if (getSelectedPlayer())
951 player = getSelectedPlayer();
952 else
953 player = m_session->GetPlayer();
954
955 if (!guid || !offline)
956 guid = player->GetGUID();
957 group = player->GetGroup();
958 }
959
960 return true;
961}
Group * GetGroup()
Definition Player.h:2476

References ObjectGuid::Empty, ObjectAccessor::FindPlayerByName(), Player::GetGroup(), Object::GetGUID(), WorldSession::GetPlayer(), getSelectedPlayer(), LANG_PLAYER_NOT_FOUND, m_session, normalizePlayerName(), sCharacterCache, and SendErrorMessage().

Referenced by group_commandscript::HandleGroupDisbandCommand(), group_commandscript::HandleGroupJoinCommand(), group_commandscript::HandleGroupLeaderCommand(), and group_commandscript::HandleGroupRemoveCommand().

◆ getSelectedCreature()

Creature * ChatHandler::getSelectedCreature ( ) const
411{
412 if (!m_session)
413 return nullptr;
414
416}
ObjectGuid GetTarget() const
Definition Unit.h:827
Creature * GetCreatureOrPetOrVehicle(WorldObject const &, ObjectGuid const)
Definition ObjectAccessor.cpp:234

References ObjectAccessor::GetCreatureOrPetOrVehicle(), WorldSession::GetPlayer(), Unit::GetTarget(), and m_session.

Referenced by cast_commandscript::HandleCastBackCommand(), cast_commandscript::HandleCastTargetCommad(), misc_commandscript::HandleComeToMeCommand(), debug_commandscript::HandleDebugGetLootRecipientCommand(), debug_commandscript::HandleDebugThreatListCommand(), misc_commandscript::HandleFreezeCommand(), modify_commandscript::HandleModifyFactionCommand(), npc_commandscript::HandleNpcAddFormationCommand(), npc_commandscript::HandleNpcAddVendorItemCommand(), npc_commandscript::HandleNpcDeleteCommand(), npc_commandscript::HandleNpcDeleteVendorItemCommand(), npc_commandscript::HandleNpcFollowCommand(), npc_commandscript::HandleNpcGuidCommand(), npc_commandscript::HandleNpcInfoCommand(), npc_commandscript::HandleNpcMoveCommand(), npc_commandscript::HandleNpcPlayEmoteCommand(), npc_commandscript::HandleNpcSayCommand(), npc_commandscript::HandleNpcSetDataCommand(), npc_commandscript::HandleNpcSetFactionIdCommand(), npc_commandscript::HandleNpcSetFlagCommand(), npc_commandscript::HandleNpcSetLevelCommand(), npc_commandscript::HandleNpcSetLinkCommand(), npc_commandscript::HandleNpcSetModelCommand(), npc_commandscript::HandleNpcSetMoveTypeCommand(), npc_commandscript::HandleNpcSetPhaseCommand(), npc_commandscript::HandleNpcSetSpawnTimeCommand(), npc_commandscript::HandleNpcSetWanderDistanceCommand(), npc_commandscript::HandleNpcTameCommand(), npc_commandscript::HandleNpcTextEmoteCommand(), npc_commandscript::HandleNpcUnFollowCommand(), npc_commandscript::HandleNpcWhisperCommand(), npc_commandscript::HandleNpcYellCommand(), pet_commandscript::HandlePetCreateCommand(), misc_commandscript::HandleUnFreezeCommand(), wp_commandscript::HandleWpAddCommand(), wp_commandscript::HandleWpLoadCommand(), wp_commandscript::HandleWpModifyCommand(), wp_commandscript::HandleWpShowCommand(), and wp_commandscript::HandleWpUnLoadCommand().

◆ getSelectedObject()

WorldObject * ChatHandler::getSelectedObject ( ) const
398{
399 if (!m_session)
400 return nullptr;
401
403
404 if (!guid)
405 return GetNearbyGameObject();
406
408}
GameObject * GetNearbyGameObject() const
Definition Chat.cpp:565
Unit * GetUnit(WorldObject const &, ObjectGuid const guid)
Definition ObjectAccessor.cpp:199

References GetNearbyGameObject(), WorldSession::GetPlayer(), Unit::GetTarget(), ObjectAccessor::GetUnit(), and m_session.

Referenced by debug_commandscript::HandleDebugSet32BitCommand(), and debug_commandscript::HandleDebugSetValueCommand().

◆ getSelectedPlayer()

Player * ChatHandler::getSelectedPlayer ( ) const
375{
376 if (!m_session)
377 return nullptr;
378
379 ObjectGuid selected = m_session->GetPlayer()->GetTarget();
380 if (!selected)
381 return m_session->GetPlayer();
382
384}
Player * FindConnectedPlayer(ObjectGuid const guid)
Definition ObjectAccessor.cpp:257

References ObjectAccessor::FindConnectedPlayer(), WorldSession::GetPlayer(), Unit::GetTarget(), and m_session.

Referenced by extractPlayerTarget(), GetPlayerGroupAndGUIDByName(), account_commandscript::HandleAccountSetAddonCommand(), account_commandscript::HandleAccountSetGmLevelCommand(), achievement_commandscript::HandleAchievementAddCommand(), misc_commandscript::HandleAddItemSetCommand(), misc_commandscript::HandleCooldownCommand(), debug_commandscript::HandleDebugGetItemStateCommand(), cheat_commandscript::HandleExploreCheatCommand(), gm_commandscript::HandleGMFlyCommand(), misc_commandscript::HandleHideAreaCommand(), honor_commandscript::HandleHonorAddCommand(), honor_commandscript::HandleHonorUpdateCommand(), instance_commandscript::HandleInstanceListBindsCommand(), instance_commandscript::HandleInstanceUnbindCommand(), learn_commandscript::HandleLearnAllRecipesCommand(), learn_commandscript::HandleLearnCommand(), lookup_commandscript::HandleLookupFactionCommand(), lookup_commandscript::HandleLookupQuestCommand(), lookup_commandscript::HandleLookupSkillCommand(), lookup_commandscript::HandleLookupSpellCommand(), lookup_commandscript::HandleLookupSpellIdCommand(), lookup_commandscript::HandleLookupTitleCommand(), misc_commandscript::HandleMaxSkillCommand(), modify_commandscript::HandleModifyArenaCommand(), modify_commandscript::HandleModifyDrunkCommand(), modify_commandscript::HandleModifyEnergyCommand(), modify_commandscript::HandleModifyGenderCommand(), modify_commandscript::HandleModifyHonorCommand(), modify_commandscript::HandleModifyHPCommand(), modify_commandscript::HandleModifyManaCommand(), modify_commandscript::HandleModifyMoneyCommand(), modify_commandscript::HandleModifyRageCommand(), modify_commandscript::HandleModifyRepCommand(), modify_commandscript::HandleModifyRunicPowerCommand(), modify_commandscript::HandleModifySpellCommand(), misc_commandscript::HandleSaveCommand(), misc_commandscript::HandleSetSkillCommand(), misc_commandscript::HandleShowAreaCommand(), cheat_commandscript::HandleTaxiCheatCommand(), tele_commandscript::HandleTeleGroupCommand(), titles_commandscript::HandleTitlesAddCommand(), titles_commandscript::HandleTitlesCurrentCommand(), titles_commandscript::HandleTitlesRemoveCommand(), titles_commandscript::HandleTitlesSetMaskCommand(), and learn_commandscript::HandleUnLearnCommand().

◆ getSelectedPlayerOrSelf()

◆ getSelectedUnit()

Unit * ChatHandler::getSelectedUnit ( ) const
387{
388 if (!m_session)
389 return nullptr;
390
391 if (Unit* selected = m_session->GetPlayer()->GetSelectedUnit())
392 return selected;
393
394 return m_session->GetPlayer();
395}
Unit * GetSelectedUnit() const
Definition Player.cpp:11600
Definition Unit.h:636

References WorldSession::GetPlayer(), Player::GetSelectedUnit(), and m_session.

Referenced by misc_commandscript::HandleAuraCommand(), misc_commandscript::HandleAuraStacksCommand(), misc_commandscript::HandleBindSightCommand(), cast_commandscript::HandleCastCommand(), cast_commandscript::HandleCastDestCommand(), cast_commandscript::HandleCastSelfCommand(), misc_commandscript::HandleDamageCommand(), debug_commandscript::HandleDebugAnimCommand(), debug_commandscript::HandleDebugEnterVehicleCommand(), debug_commandscript::HandleDebugGetValueCommand(), debug_commandscript::HandleDebugHostileRefListCommand(), debug_commandscript::HandleDebugLoSCommand(), debug_commandscript::HandleDebugMoveflagsCommand(), debug_commandscript::HandleDebugPlaySoundCommand(), debug_commandscript::HandleDebugSendOpcodeCommand(), debug_commandscript::HandleDebugSetAuraStateCommand(), debug_commandscript::HandleDebugSetVehicleIdCommand(), debug_commandscript::HandleDebugUnitStateCommand(), debug_commandscript::HandleDebugUpdateCommand(), debug_commandscript::HandleDebugVisualCommand(), misc_commandscript::HandleDieCommand(), misc_commandscript::HandleGetDistanceCommand(), misc_commandscript::HandleGPSCommand(), honor_commandscript::HandleHonorAddKillCommand(), mmaps_commandscript::HandleMmapPathCommand(), modify_commandscript::HandleModifyBitCommand(), modify_commandscript::HandleModifyPhaseCommand(), modify_commandscript::HandleModifyScaleCommand(), modify_commandscript::HandleModifyTalentCommand(), modify_commandscript::HandleMorphResetCommand(), modify_commandscript::HandleMorphTargetCommand(), misc_commandscript::HandleMovegensCommand(), npc_commandscript::HandleNpcSetEntryCommand(), misc_commandscript::HandlePossessCommand(), misc_commandscript::HandleRespawnCommand(), misc_commandscript::HandleUnAuraCommand(), misc_commandscript::HandleUnPossessCommand(), and list_commandscript::ListAurasCommand().

◆ GetSession()

WorldSession * ChatHandler::GetSession ( )
inline
242{ return m_session; }

Referenced by go_commandscript::DoTeleport(), account_commandscript::HandleAccount2FARemoveCommand(), account_commandscript::HandleAccount2FASetupCommand(), account_commandscript::HandleAccountAddonCommand(), account_commandscript::HandleAccountCommand(), account_commandscript::HandleAccountCreateCommand(), account_commandscript::HandleAccountLockCountryCommand(), account_commandscript::HandleAccountLockIpCommand(), account_commandscript::HandleAccountPasswordCommand(), account_commandscript::HandleAccountSetAddonCommand(), account_commandscript::HandleAccountSetGmLevelCommand(), misc_commandscript::HandleAddItemCommand(), misc_commandscript::HandleAddItemSetCommand(), misc_commandscript::HandleAppearCommand(), arena_commandscript::HandleArenaLookupCommand(), bg_commandscript::HandleBagsClearCommand(), ban_commandscript::HandleBanCharacterCommand(), ban_commandscript::HandleBanHelper(), ban_commandscript::HandleBanListCharacterCommand(), ban_commandscript::HandleBanListHelper(), ban_commandscript::HandleBanListIPCommand(), misc_commandscript::HandleBindSightCommand(), cast_commandscript::HandleCastBackCommand(), cast_commandscript::HandleCastCommand(), cast_commandscript::HandleCastDistCommand(), cheat_commandscript::HandleCasttimeCheatCommand(), misc_commandscript::HandleChangeWeather(), character_commandscript::HandleCharacterCheckBankCommand(), character_commandscript::HandleCharacterDeletedListHelper(), character_commandscript::HandleCharacterLevelCommand(), character_commandscript::HandleCharacterReputationCommand(), character_commandscript::HandleCharacterTitlesCommand(), cheat_commandscript::HandleCheatStatusCommand(), misc_commandscript::HandleComeToMeCommand(), misc_commandscript::HandleCommentatorCommand(), cheat_commandscript::HandleCoolDownCheatCommand(), misc_commandscript::HandleCooldownCommand(), misc_commandscript::HandleDamageCommand(), debug_commandscript::HandleDebugAreaTriggersCommand(), debug_commandscript::HandleDebugHostileRefListCommand(), debug_commandscript::HandleDebugLoSCommand(), debug_commandscript::HandleDebugSendChannelNotifyCommand(), debug_commandscript::HandleDebugSendChatMsgCommand(), debug_commandscript::HandleDebugSendOpcodeCommand(), debug_commandscript::HandleDebugSendSetPhaseShiftCommand(), debug_commandscript::HandleDebugSendSpellFailCommand(), debug_commandscript::HandleDebugSpawnVehicleCommand(), debug_commandscript::HandleDebugUnitStateCommand(), deserter_commandscript::HandleDeserterAdd(), misc_commandscript::HandleDevCommand(), misc_commandscript::HandleDieCommand(), misc_commandscript::HandleDismountCommand(), event_commandscript::HandleEventActiveListCommand(), cheat_commandscript::HandleExploreCheatCommand(), gobject_commandscript::HandleGameObjectActivateCommand(), gobject_commandscript::HandleGameObjectAddCommand(), gobject_commandscript::HandleGameObjectAddTempCommand(), gobject_commandscript::HandleGameObjectDeleteCommand(), gobject_commandscript::HandleGameObjectMoveCommand(), gobject_commandscript::HandleGameObjectNearCommand(), gobject_commandscript::HandleGameObjectTargetCommand(), gobject_commandscript::HandleGameObjectTurnCommand(), misc_commandscript::HandleGetDistanceCommand(), gm_commandscript::HandleGMChatCommand(), gm_commandscript::HandleGMFlyCommand(), gm_commandscript::HandleGMListFullCommand(), gm_commandscript::HandleGMListIngameCommand(), message_commandscript::HandleGMNameAnnounceCommand(), ticket_commandscript::HandleGMTicketAssignToCommand(), ticket_commandscript::HandleGMTicketCloseByIdCommand(), ticket_commandscript::HandleGMTicketCommentCommand(), ticket_commandscript::HandleGMTicketCompleteCommand(), ticket_commandscript::HandleGMTicketDeleteByIdCommand(), ticket_commandscript::HandleGMTicketResponseDeleteCommand(), ticket_commandscript::HandleGMTicketUnAssignCommand(), gm_commandscript::HandleGMVisibleCommand(), cheat_commandscript::HandleGodModeCheatCommand(), go_commandscript::HandleGoGraveyardCommand(), go_commandscript::HandleGoGridCommand(), go_commandscript::HandleGoTicketCommand(), go_commandscript::HandleGoXYZCommand(), go_commandscript::HandleGoZoneXYCommand(), misc_commandscript::HandleGPSCommand(), misc_commandscript::HandleGroupSummonCommand(), misc_commandscript::HandleGUIDCommand(), honor_commandscript::HandleHonorAddKillCommand(), instance_commandscript::HandleInstanceGetBossStateCommand(), instance_commandscript::HandleInstanceListBindsCommand(), instance_commandscript::HandleInstanceSaveDataCommand(), instance_commandscript::HandleInstanceSetBossStateCommand(), instance_commandscript::HandleInstanceUnbindCommand(), item_commandscript::HandleItemMoveCommand(), misc_commandscript::HandleKickPlayerCommand(), learn_commandscript::HandleLearnAllCraftsCommand(), learn_commandscript::HandleLearnAllGMCommand(), learn_commandscript::HandleLearnAllMyPetTalentsCommand(), learn_commandscript::HandleLearnAllMySpellsCommand(), learn_commandscript::HandleLearnAllMyTalentsCommand(), character_commandscript::HandleLevelUpCommand(), misc_commandscript::HandleLinkGraveCommand(), list_commandscript::HandleListCreatureCommand(), list_commandscript::HandleListObjectCommand(), lookup_commandscript::HandleLookupAreaCommand(), lookup_commandscript::HandleLookupCreatureCommand(), lookup_commandscript::HandleLookupEventCommand(), lookup_commandscript::HandleLookupFactionCommand(), lookup_commandscript::HandleLookupItemCommand(), lookup_commandscript::HandleLookupItemSetCommand(), lookup_commandscript::HandleLookupMapCommand(), lookup_commandscript::HandleLookupObjectCommand(), lookup_commandscript::HandleLookupPlayerIpCommand(), lookup_commandscript::HandleLookupQuestCommand(), lookup_commandscript::HandleLookupSkillCommand(), lookup_commandscript::HandleLookupSpellCommand(), lookup_commandscript::HandleLookupSpellIdCommand(), lookup_commandscript::HandleLookupTaxiNodeCommand(), lookup_commandscript::HandleLookupTeleCommand(), lookup_commandscript::HandleLookupTitleCommand(), misc_commandscript::HandleMailBoxCommand(), mmaps_commandscript::HandleMmapLoadedTilesCommand(), mmaps_commandscript::HandleMmapLocCommand(), mmaps_commandscript::HandleMmapPathCommand(), mmaps_commandscript::HandleMmapStatsCommand(), mmaps_commandscript::HandleMmapTestArea(), modify_commandscript::HandleModifyPhaseCommand(), modify_commandscript::HandleModifyStandStateCommand(), modify_commandscript::HandleMorphResetCommand(), modify_commandscript::HandleMorphTargetCommand(), misc_commandscript::HandleMuteCommand(), message_commandscript::HandleNameAnnounceCommand(), misc_commandscript::HandleNearGraveCommand(), npc_commandscript::HandleNpcAddCommand(), npc_commandscript::HandleNpcAddFormationCommand(), npc_commandscript::HandleNpcAddTempSpawnCommand(), npc_commandscript::HandleNpcAddVendorItemCommand(), npc_commandscript::HandleNpcDeleteVendorItemCommand(), npc_commandscript::HandleNpcFollowCommand(), npc_commandscript::HandleNpcMoveCommand(), npc_commandscript::HandleNpcNearCommand(), npc_commandscript::HandleNpcSetFactionTempIdCommand(), npc_commandscript::HandleNpcSetOriginalFaction(), npc_commandscript::HandleNpcTameCommand(), npc_commandscript::HandleNpcUnFollowCommand(), pet_commandscript::HandlePetCreateCommand(), pet_commandscript::HandlePetLearnCommand(), pet_commandscript::HandlePetUnlearnCommand(), misc_commandscript::HandlePInfoCommand(), misc_commandscript::HandlePossessCommand(), cheat_commandscript::HandlePowerCheatCommand(), reset_commandscript::HandleResetAllCommand(), reset_commandscript::HandleResetSpellsCommand(), reset_commandscript::HandleResetTalentsCommand(), misc_commandscript::HandleRespawnAllCommand(), misc_commandscript::HandleRespawnCommand(), misc_commandscript::HandleSaveCommand(), send_commandscript::HandleSendItemsCommand(), send_commandscript::HandleSendMailCommand(), send_commandscript::HandleSendMoneyCommand(), spectator_commandscript::HandleSpectatorLeaveCommand(), spectator_commandscript::HandleSpectatorResetCommand(), ArenaSpectator::HandleSpectatorSpectateCommand(), spectator_commandscript::HandleSpectatorVersionCommand(), ArenaSpectator::HandleSpectatorWatchCommand(), misc_commandscript::HandleSummonCommand(), cheat_commandscript::HandleTaxiCheatCommand(), tele_commandscript::HandleTeleAddCommand(), tele_commandscript::HandleTeleCommand(), misc_commandscript::HandleUnbindSightCommand(), misc_commandscript::HandleUnPossessCommand(), misc_commandscript::HandleUnstuckCommand(), cheat_commandscript::HandleWaterWalkCheatCommand(), message_commandscript::HandleWhispersCommand(), wp_commandscript::HandleWpAddCommand(), debug_commandscript::HandleWPGPSCommand(), wp_commandscript::HandleWpModifyCommand(), wp_commandscript::HandleWpShowCommand(), list_commandscript::ListAurasCommand(), AddonChannelCommandHandler::Send(), ticket_commandscript::TicketResponseAppend(), and Acore::Impl::ChatCommands::ChatCommandNode::TryExecuteCommand().

◆ GetSessionDbcLocale()

◆ GetSessionDbLocaleIndex()

int ChatHandler::GetSessionDbLocaleIndex ( ) const
virtual

◆ HasLowerSecurity()

bool ChatHandler::HasLowerSecurity ( Player target,
ObjectGuid  guid = ObjectGuid::Empty,
bool  strong = false 
)
58{
59 WorldSession* target_session = nullptr;
60 uint32 target_account = 0;
61
62 if (target)
63 target_session = target->GetSession();
64 else if (guid)
65 target_account = sCharacterCache->GetCharacterAccountIdByGuid(guid);
66
67 if (!target_session && !target_account)
68 {
70 return true;
71 }
72
73 return HasLowerSecurityAccount(target_session, target_account, strong);
74}
bool HasLowerSecurityAccount(WorldSession *target, uint32 account, bool strong=false)
Definition Chat.cpp:76
WorldSession * GetSession() const
Definition Player.h:2005
Player session in the World.
Definition WorldSession.h:330

References Player::GetSession(), HasLowerSecurityAccount(), LANG_PLAYER_NOT_FOUND, sCharacterCache, and SendErrorMessage().

Referenced by modify_commandscript::CheckModifyInt32(), modify_commandscript::CheckModifySpeed(), tele_commandscript::DoNameTeleport(), misc_commandscript::HandleAppearCommand(), character_commandscript::HandleCharacterRenameCommand(), misc_commandscript::HandleCombatStopCommand(), misc_commandscript::HandleDamageCommand(), misc_commandscript::HandleDieCommand(), gear_commandscript::HandleGearRepairCommand(), misc_commandscript::HandleGroupSummonCommand(), honor_commandscript::HandleHonorAddCommand(), honor_commandscript::HandleHonorAddKillCommand(), honor_commandscript::HandleHonorUpdateCommand(), misc_commandscript::HandleKickPlayerCommand(), modify_commandscript::HandleModifyBitCommand(), modify_commandscript::HandleModifyHonorCommand(), modify_commandscript::HandleModifyMoneyCommand(), modify_commandscript::HandleModifyMountCommand(), modify_commandscript::HandleModifyPhaseCommand(), modify_commandscript::HandleModifyRepCommand(), modify_commandscript::HandleModifyScaleCommand(), modify_commandscript::HandleModifySpellCommand(), modify_commandscript::HandleModifyTalentCommand(), modify_commandscript::HandleMorphMountCommand(), modify_commandscript::HandleMorphResetCommand(), modify_commandscript::HandleMorphTargetCommand(), misc_commandscript::HandleMuteCommand(), npc_commandscript::HandleNpcWhisperCommand(), misc_commandscript::HandlePInfoCommand(), misc_commandscript::HandleRecallCommand(), misc_commandscript::HandleSummonCommand(), cheat_commandscript::HandleTaxiCheatCommand(), tele_commandscript::HandleTeleGroupCommand(), titles_commandscript::HandleTitlesAddCommand(), titles_commandscript::HandleTitlesCurrentCommand(), titles_commandscript::HandleTitlesRemoveCommand(), titles_commandscript::HandleTitlesSetMaskCommand(), misc_commandscript::HandleUnmuteCommand(), and misc_commandscript::HandleUnstuckCommand().

◆ HasLowerSecurityAccount()

bool ChatHandler::HasLowerSecurityAccount ( WorldSession target,
uint32  account,
bool  strong = false 
)
77{
78 uint32 target_sec;
79
80 // allow everything from console and RA console
81 if (!m_session)
82 return false;
83
84 // ignore only for non-players for non strong checks (when allow apply command at least to same sec level)
86 return false;
87
88 if (target)
89 target_sec = target->GetSecurity();
90 else if (target_account)
91 target_sec = AccountMgr::GetSecurity(target_account, realm.Id.Realm);
92 else
93 return true; // caller must report error for (target == nullptr && target_account == 0)
94
95 AccountTypes target_ac_sec = AccountTypes(target_sec);
96 if (m_session->GetSecurity() < target_ac_sec || (strong && m_session->GetSecurity() <= target_ac_sec))
97 {
99 return true;
100 }
101
102 return false;
103}
AccountTypes
Definition Common.h:56
@ CONFIG_GM_LOWER_SECURITY
Definition IWorld.h:88
@ LANG_YOURS_SECURITY_IS_LOW
Definition Language.h:430
Realm realm
Definition World.cpp:111
uint32 GetSecurity(uint32 accountId)
Definition AccountMgr.cpp:238
uint32 Realm
Definition Realm.h:43
RealmHandle Id
Definition Realm.h:69

References CONFIG_GM_LOWER_SECURITY, WorldSession::GetSecurity(), AccountMgr::GetSecurity(), Realm::Id, AccountMgr::IsPlayerAccount(), LANG_YOURS_SECURITY_IS_LOW, m_session, realm, RealmHandle::Realm, SendErrorMessage(), and sWorld.

Referenced by account_commandscript::HandleAccountDeleteCommand(), account_commandscript::HandleAccountSet2FACommand(), account_commandscript::HandleAccountSetAddonCommand(), account_commandscript::HandleAccountSetPasswordCommand(), and HasLowerSecurity().

◆ HasSentErrorMessage()

◆ HasSession()

bool ChatHandler::HasSession ( ) const
virtual

Reimplemented in CliHandler.

437{
438 if (!m_session)
439 return false;
440
441 return true;
442}

References m_session.

◆ IsAvailable()

bool ChatHandler::IsAvailable ( uint32  securityLevel) const
52{
53 // check security level only for simple command (without child commands)
54 return IsConsole() ? true : m_session->GetSecurity() >= AccountTypes(securityLevel);
55}
bool IsConsole() const
Definition Chat.h:240

References WorldSession::GetSecurity(), IsConsole(), and m_session.

Referenced by Acore::Impl::ChatCommands::ChatCommandNode::IsInvokerVisible().

◆ IsConsole()

bool ChatHandler::IsConsole ( ) const
inline

◆ IsHumanReadable()

virtual bool ChatHandler::IsHumanReadable ( ) const
inlinevirtual

Reimplemented in AddonChannelCommandHandler.

197{ return true; }

◆ LineFromMessage()

static char * ChatHandler::LineFromMessage ( char *&  pos)
inlinestatic
50{ char* start = strtok(pos, "\n"); pos = nullptr; return start; }

◆ needReportToTarget()

◆ ParseCommands()

bool ChatHandler::ParseCommands ( std::string_view  text)
virtual

Reimplemented in CliHandler, and AddonChannelCommandHandler.

243{
244 ASSERT(!text.empty());
245
246 // chat case (.command or !command format)
247 if ((text[0] != '!') && (text[0] != '.'))
248 return false;
249
250 // ignore single . and ! in line
251 if (text.length() < 2)
252 return false;
253
254 // ignore messages staring from many dots.
255 if (text[1] == text[0])
256 return false;
257
258 // ignore messages with separator after .
260 return false;
261
262 return _ParseCommands(text.substr(1));
263}
bool _ParseCommands(std::string_view text)
Definition Chat.cpp:228
static constexpr char COMMAND_DELIMITER
Definition ChatCommandHelpers.h:37

References _ParseCommands(), ASSERT, and Acore::Impl::ChatCommands::COMMAND_DELIMITER.

Referenced by WorldSession::HandleMessagechatOpcode().

◆ PGetParseModuleString()

template<typename... Args>
std::string ChatHandler::PGetParseModuleString ( std::string  module,
uint32  id,
Args &&...  args 
) const
inline
170 {
171 return Acore::StringFormat(GetModuleString(module, id)->c_str(), std::forward<Args>(args)...);
172 }
std::string const * GetModuleString(std::string module, uint32 id) const
Definition Chat.cpp:46
std::string StringFormat(FormatString< Args... > fmt, Args &&... args)
Default AC string format function.
Definition StringFormat.h:34

References Acore::StringFormat().

◆ PGetParseString()

template<typename... Args>
std::string ChatHandler::PGetParseString ( uint32  entry,
Args &&...  args 
) const
inline

◆ playerLink()

◆ PSendModuleSysMessage()

template<typename... Args>
void ChatHandler::PSendModuleSysMessage ( std::string  module,
uint32  id,
Args &&...  args 
)
inline
163 {
164 if (HasSession())
165 SendSysMessage(PGetParseModuleString(module, id, std::forward<Args>(args)...));
166 }
virtual bool HasSession() const
Definition Chat.cpp:436
std::string PGetParseModuleString(std::string module, uint32 id, Args &&... args) const
Definition Chat.h:169

◆ PSendSysMessage() [1/3]

template<typename... Args>
void ChatHandler::PSendSysMessage ( char const *  fmt,
Args &&...  args 
)
inline
141 {
142 if (HasSession())
143 SendSysMessage(Acore::StringFormat(fmt, std::forward<Args>(args)...));
144 }

References Acore::StringFormat().

◆ PSendSysMessage() [2/3]

void ChatHandler::PSendSysMessage ( std::string_view  str,
bool  escapeCharacters = false 
)
212{
213 SendSysMessage(str, escapeCharacters);
214}

References SendSysMessage().

Referenced by Battleground::_ProcessProgress(), Player::AddItem(), BattlegroundSA::CaptureGraveyard(), cast_commandscript::CheckSpellCastResult(), AchievementMgr::CompletedAchievement(), tele_commandscript::DoNameTeleport(), BattlegroundSA::EventPlayerDamagedGO(), GetPlayerInfo(), account_commandscript::HandleAccountAddonCommand(), account_commandscript::HandleAccountCommand(), account_commandscript::HandleAccountCreateCommand(), account_commandscript::HandleAccountDeleteCommand(), account_commandscript::HandleAccountLockCountryCommand(), account_commandscript::HandleAccountLockIpCommand(), account_commandscript::HandleAccountOnlineListCommand(), account_commandscript::HandleAccountRemoveLockCountryCommand(), account_commandscript::HandleAccountSet2FACommand(), account_commandscript::HandleAccountSetAddonCommand(), account_commandscript::HandleAccountSetGmLevelCommand(), disable_commandscript::HandleAddDisables(), misc_commandscript::HandleAddItemCommand(), misc_commandscript::HandleAddItemSetCommand(), misc_commandscript::HandleAppearCommand(), WorldSession::HandleAreaTriggerOpcode(), arena_commandscript::HandleArenaCaptainCommand(), arena_commandscript::HandleArenaCreateCommand(), arena_commandscript::HandleArenaDisbandCommand(), arena_commandscript::HandleArenaInfoCommand(), arena_commandscript::HandleArenaLookupCommand(), arena_commandscript::HandleArenaRenameCommand(), arena_commandscript::HandleArenaSeasonDeleteTeamsCommand(), arena_commandscript::HandleArenaSeasonRewardCommand(), arena_commandscript::HandleArenaSeasonSetStateCommand(), arena_commandscript::HandleArenaSeasonStartCommand(), ban_commandscript::HandleBanCharacterCommand(), ban_commandscript::HandleBanHelper(), ban_commandscript::HandleBanInfoAccountCommand(), ban_commandscript::HandleBanInfoCharacterCommand(), ban_commandscript::HandleBanInfoHelper(), ban_commandscript::HandleBanInfoIPCommand(), ban_commandscript::HandleBanListAccountCommand(), ban_commandscript::HandleBanListCharacterCommand(), ban_commandscript::HandleBanListHelper(), ban_commandscript::HandleBanListIPCommand(), WorldSession::HandleBattlemasterJoinArena(), WorldSession::HandleBattlemasterJoinOpcode(), cache_commandscript::HandleCacheDeleteCommand(), cache_commandscript::HandleCacheInfoCommand(), cache_commandscript::HandleCacheRefreshCommand(), WorldSession::HandleCharacterAuraFrozen(), character_commandscript::HandleCharacterChangeAccountCommand(), character_commandscript::HandleCharacterChangeFactionCommand(), character_commandscript::HandleCharacterChangeRaceCommand(), character_commandscript::HandleCharacterCheckBagCommand(), character_commandscript::HandleCharacterCheckProfessionCommand(), character_commandscript::HandleCharacterCustomizeCommand(), character_commandscript::HandleCharacterDeletedListHelper(), character_commandscript::HandleCharacterDeletedRestoreHelper(), character_commandscript::HandleCharacterEraseCommand(), character_commandscript::HandleCharacterLevel(), character_commandscript::HandleCharacterLevelCommand(), character_commandscript::HandleCharacterRenameCommand(), character_commandscript::HandleCharacterTitlesCommand(), cheat_commandscript::HandleCheatStatusCommand(), misc_commandscript::HandleCooldownCommand(), debug_commandscript::HandleDebugAnimCommand(), debug_commandscript::HandleDebugAreaTriggersCommand(), debug_commandscript::HandleDebugEnterVehicleCommand(), debug_commandscript::HandleDebugGetItemStateCommand(), debug_commandscript::HandleDebugGetItemValueCommand(), debug_commandscript::HandleDebugGetLootRecipientCommand(), debug_commandscript::HandleDebugGetValueCommand(), debug_commandscript::HandleDebugHostileRefListCommand(), debug_commandscript::HandleDebugLoSCommand(), debug_commandscript::HandleDebugMapDataCommand(), debug_commandscript::HandleDebugMod32ValueCommand(), debug_commandscript::HandleDebugMoveflagsCommand(), debug_commandscript::HandleDebugObjectCountMap(), debug_commandscript::HandleDebugPlayCinematicCommand(), debug_commandscript::HandleDebugPlayMusicCommand(), debug_commandscript::HandleDebugPlaySoundCommand(), debug_commandscript::HandleDebugSendOpcodeCommand(), debug_commandscript::HandleDebugSet32BitCommand(), debug_commandscript::HandleDebugSetValueCommand(), debug_commandscript::HandleDebugSetVehicleIdCommand(), debug_commandscript::HandleDebugThreatListCommand(), debug_commandscript::HandleDebugUpdateCommand(), deserter_commandscript::HandleDeserterAdd(), deserter_commandscript::HandleDeserterRemove(), deserter_commandscript::HandleDeserterRemoveAll(), event_commandscript::HandleEventActiveListCommand(), event_commandscript::HandleEventInfoCommand(), event_commandscript::HandleEventStartCommand(), event_commandscript::HandleEventStopCommand(), cheat_commandscript::HandleExploreCheatCommand(), misc_commandscript::HandleFreezeCommand(), gobject_commandscript::HandleGameObjectActivateCommand(), gobject_commandscript::HandleGameObjectAddCommand(), gobject_commandscript::HandleGameObjectDeleteCommand(), gobject_commandscript::HandleGameObjectInfoCommand(), gobject_commandscript::HandleGameObjectMoveCommand(), gobject_commandscript::HandleGameObjectNearCommand(), gobject_commandscript::HandleGameObjectRespawn(), gobject_commandscript::HandleGameObjectSetStateCommand(), gobject_commandscript::HandleGameObjectTargetCommand(), gobject_commandscript::HandleGameObjectTurnCommand(), gear_commandscript::HandleGearRepairCommand(), gear_commandscript::HandleGearStatsCommand(), misc_commandscript::HandleGetDistanceCommand(), gm_commandscript::HandleGMFlyCommand(), gm_commandscript::HandleGMListFullCommand(), gm_commandscript::HandleGMListIngameCommand(), ticket_commandscript::HandleGMTicketAssignToCommand(), ticket_commandscript::HandleGMTicketCloseByIdCommand(), ticket_commandscript::HandleGMTicketCommentCommand(), ticket_commandscript::HandleGMTicketCompleteCommand(), ticket_commandscript::HandleGMTicketResponseDeleteCommand(), ticket_commandscript::HandleGMTicketResponseShowCommand(), ticket_commandscript::HandleGMTicketUnAssignCommand(), gm_commandscript::HandleGMVisibleCommand(), misc_commandscript::HandleGPSCommand(), group_commandscript::HandleGroupJoinCommand(), group_commandscript::HandleGroupListCommand(), misc_commandscript::HandleGroupSummonCommand(), misc_commandscript::HandleGUIDCommand(), guild_commandscript::HandleGuildInfoCommand(), guild_commandscript::HandleGuildRenameCommand(), instance_commandscript::HandleInstanceGetBossStateCommand(), instance_commandscript::HandleInstanceListBindsCommand(), instance_commandscript::HandleInstanceSetBossStateCommand(), instance_commandscript::HandleInstanceStatsCommand(), instance_commandscript::HandleInstanceUnbindCommand(), Guild::HandleInviteMember(), item_commandscript::HandleItemRefundCommand(), item_commandscript::HandleItemRestoreCommand(), item_commandscript::HandleItemRestoreListCommand(), misc_commandscript::HandleKickPlayerCommand(), learn_commandscript::HandleLearnAllDefaultCommand(), learn_commandscript::HandleLearnAllRecipesCommand(), character_commandscript::HandleLevelUpCommand(), lfg_commandscript::HandleLfgCleanCommand(), lfg_commandscript::HandleLfgGroupInfoCommand(), lfg_commandscript::HandleLfgOptionsCommand(), misc_commandscript::HandleLinkGraveCommand(), list_commandscript::HandleListCreatureCommand(), list_commandscript::HandleListItemCommand(), list_commandscript::HandleListObjectCommand(), lookup_commandscript::HandleLookupAreaCommand(), lookup_commandscript::HandleLookupCreatureCommand(), lookup_commandscript::HandleLookupEventCommand(), lookup_commandscript::HandleLookupFactionCommand(), lookup_commandscript::HandleLookupItemCommand(), lookup_commandscript::HandleLookupItemSetCommand(), lookup_commandscript::HandleLookupMapCommand(), lookup_commandscript::HandleLookupObjectCommand(), lookup_commandscript::HandleLookupQuestCommand(), lookup_commandscript::HandleLookupSkillCommand(), lookup_commandscript::HandleLookupSpellCommand(), lookup_commandscript::HandleLookupSpellIdCommand(), lookup_commandscript::HandleLookupTaxiNodeCommand(), lookup_commandscript::HandleLookupTeleCommand(), lookup_commandscript::HandleLookupTitleCommand(), mmaps_commandscript::HandleMmapLoadedTilesCommand(), mmaps_commandscript::HandleMmapLocCommand(), mmaps_commandscript::HandleMmapPathCommand(), mmaps_commandscript::HandleMmapStatsCommand(), mmaps_commandscript::HandleMmapTestArea(), modify_commandscript::HandleModifyArenaCommand(), modify_commandscript::HandleModifyBitCommand(), modify_commandscript::HandleModifyEnergyCommand(), modify_commandscript::HandleModifyFactionCommand(), modify_commandscript::HandleModifyGenderCommand(), modify_commandscript::HandleModifyHonorCommand(), modify_commandscript::HandleModifyHPCommand(), modify_commandscript::HandleModifyManaCommand(), modify_commandscript::HandleModifyMoneyCommand(), modify_commandscript::HandleModifyRageCommand(), modify_commandscript::HandleModifyRepCommand(), modify_commandscript::HandleModifyRunicPowerCommand(), modify_commandscript::HandleModifyScaleCommand(), modify_commandscript::HandleModifySpellCommand(), misc_commandscript::HandleMovegensCommand(), misc_commandscript::HandleMuteCommand(), misc_commandscript::HandleMuteInfoCommand(), misc_commandscript::HandleMuteInfoHelper(), misc_commandscript::HandleNearGraveCommand(), npc_commandscript::HandleNpcAddFormationCommand(), npc_commandscript::HandleNpcAddVendorItemCommand(), npc_commandscript::HandleNpcDeleteVendorItemCommand(), npc_commandscript::HandleNpcFollowCommand(), npc_commandscript::HandleNpcGuidCommand(), npc_commandscript::HandleNpcInfoCommand(), npc_commandscript::HandleNpcMoveCommand(), npc_commandscript::HandleNpcNearCommand(), npc_commandscript::HandleNpcSetDataCommand(), npc_commandscript::HandleNpcSetLinkCommand(), npc_commandscript::HandleNpcSetMoveTypeCommand(), npc_commandscript::HandleNpcSetSpawnTimeCommand(), npc_commandscript::HandleNpcSetWanderDistanceCommand(), npc_commandscript::HandleNpcTameCommand(), npc_commandscript::HandleNpcUnFollowCommand(), misc_commandscript::HandleOpenDoorCommand(), character_commandscript::HandlePDumpCopyCommand(), character_commandscript::HandlePDumpLoadCommand(), character_commandscript::HandlePDumpWriteCommand(), pet_commandscript::HandlePetLearnCommand(), pet_commandscript::HandlePetUnlearnCommand(), misc_commandscript::HandlePInfoCommand(), misc_commandscript::HandlePlayAllCommand(), WorldSession::HandlePlayerLoginFromDB(), WorldSession::HandlePlayerLoginToCharInWorld(), quest_commandscript::HandleQuestAdd(), quest_commandscript::HandleQuestComplete(), quest_commandscript::HandleQuestRemove(), quest_commandscript::HandleQuestReward(), reload_commandscript::HandleReloadCreatureTemplateCommand(), disable_commandscript::HandleRemoveDisables(), reset_commandscript::HandleResetItemsAllAndDeleteBagsCommand(), reset_commandscript::HandleResetItemsAllCommand(), reset_commandscript::HandleResetItemsEquippedCommand(), reset_commandscript::HandleResetItemsInBagsCommand(), reset_commandscript::HandleResetItemsInBankCommand(), reset_commandscript::HandleResetItemsInCurrenciesListCommand(), reset_commandscript::HandleResetItemsInVendorBuyBackTabCommand(), reset_commandscript::HandleResetItemsKeyringCommand(), reset_commandscript::HandleResetSpellsCommand(), reset_commandscript::HandleResetTalentsCommand(), send_commandscript::HandleSendItemsCommand(), send_commandscript::HandleSendMailCommand(), send_commandscript::HandleSendMessageCommand(), send_commandscript::HandleSendMoneyCommand(), server_commandscript::HandleServerDebugCommand(), server_commandscript::HandleServerInfoCommand(), server_commandscript::HandleServerMotdCommand(), server_commandscript::HandleServerSetMotdCommand(), WorldSession::HandleSetRaidDifficultyOpcode(), misc_commandscript::HandleSetSkillCommand(), player_settings_commandscript::HandleSettingsAnnouncerFlags(), misc_commandscript::HandleSkirmishCommand(), spectator_commandscript::HandleSpectatorCommand(), ArenaSpectator::HandleSpectatorSpectateCommand(), misc_commandscript::HandleSummonCommand(), WorldSession::HandleSummonResponseOpcode(), worldstate_commandscript::HandleSunsReachReclamationCounterCommand(), worldstate_commandscript::HandleSunsReachReclamationPhaseCommand(), worldstate_commandscript::HandleSunsReachReclamationStatusCommand(), worldstate_commandscript::HandleSunsReachReclamationSubPhaseCommand(), worldstate_commandscript::HandleSunwellGateCommand(), worldstate_commandscript::HandleSunwellGateCounterCommand(), cheat_commandscript::HandleTaxiCheatCommand(), tele_commandscript::HandleTeleGroupCommand(), titles_commandscript::HandleTitlesAddCommand(), titles_commandscript::HandleTitlesCurrentCommand(), titles_commandscript::HandleTitlesRemoveCommand(), titles_commandscript::HandleTitlesSetMaskCommand(), ticket_commandscript::HandleToggleGMTicketSystem(), ban_commandscript::HandleUnBanHelper(), misc_commandscript::HandleUnFreezeCommand(), misc_commandscript::HandleUnmuteCommand(), misc_commandscript::HandleUnstuckCommand(), message_commandscript::HandleWhispersCommand(), wp_commandscript::HandleWpAddCommand(), wp_commandscript::HandleWpEventCommand(), debug_commandscript::HandleWPGPSCommand(), wp_commandscript::HandleWpLoadCommand(), wp_commandscript::HandleWpModifyCommand(), wp_commandscript::HandleWpReloadCommand(), wp_commandscript::HandleWpShowCommand(), wp_commandscript::HandleWpUnLoadCommand(), ObjectMgr::IsVendorItemValid(), Channel::JoinChannel(), Channel::KickOrBan(), list_commandscript::ListAurasCommand(), lookup_commandscript::LookupPlayerSearchCommand(), modify_commandscript::NotifyModification(), npc_icc_buff_switcher::OnGossipSelect(), BattlegroundSA::PostUpdateImpl(), Player::PrettyPrintRequirementsAchievementsList(), Player::PrettyPrintRequirementsItemsList(), Player::PrettyPrintRequirementsQuestList(), Player::RewardHonor(), Player::Satisfy(), Acore::Impl::ChatCommands::ChatCommandNode::SendCommandHelp(), Acore::Impl::ChatCommands::ChatCommandNode::SendCommandHelpFor(), BattlegroundQueue::SendJoinMessageArenaQueue(), BattlegroundQueue::SendMessageBGQueue(), ticket_commandscript::TicketResponseAppend(), Acore::Impl::ChatCommands::ChatCommandNode::TryExecuteCommand(), and Player::Whisper().

◆ PSendSysMessage() [3/3]

template<typename... Args>
void ChatHandler::PSendSysMessage ( uint32  entry,
Args &&...  args 
)
inline
148 {
149 if (HasSession())
150 SendSysMessage(PGetParseString(entry, std::forward<Args>(args)...));
151 }
std::string PGetParseString(uint32 entry, Args &&... args) const
Definition Chat.h:154

◆ SendErrorMessage() [1/4]

template<typename... Args>
void ChatHandler::SendErrorMessage ( char const *  fmt,
Args &&...  args 
)
inline
179 {
180 PSendSysMessage(fmt, std::forward<Args>(args)...);
182 }
void PSendSysMessage(std::string_view str, bool escapeCharacters=false)
Definition Chat.cpp:211
void SetSentErrorMessage(bool val)
Definition Chat.h:238

◆ SendErrorMessage() [2/4]

void ChatHandler::SendErrorMessage ( std::string_view  str,
bool  escapeCharacters 
)
223{
224 SendSysMessage(str, escapeCharacters);
226}

References SendSysMessage(), and SetSentErrorMessage().

◆ SendErrorMessage() [3/4]

void ChatHandler::SendErrorMessage ( uint32  entry)
217{
218 SendSysMessage(entry);
220}

References SendSysMessage(), and SetSentErrorMessage().

Referenced by _ParseCommands(), modify_commandscript::CheckModifyInt32(), modify_commandscript::CheckModifySpeed(), cast_commandscript::CheckSpellExistsAndIsValid(), tele_commandscript::DoNameTeleport(), go_commandscript::DoTeleport(), extractPlayerTarget(), GetPlayerGroupAndGUIDByName(), account_commandscript::HandleAccount2FARemoveCommand(), account_commandscript::HandleAccount2FASetupCommand(), account_commandscript::HandleAccountAddonCommand(), account_commandscript::HandleAccountCreateCommand(), account_commandscript::HandleAccountDeleteCommand(), account_commandscript::HandleAccountLockCountryCommand(), account_commandscript::HandleAccountLockIpCommand(), account_commandscript::HandleAccountPasswordCommand(), account_commandscript::HandleAccountRemoveLockCountryCommand(), account_commandscript::HandleAccountSet2FACommand(), account_commandscript::HandleAccountSetAddonCommand(), account_commandscript::HandleAccountSetEmailCommand(), account_commandscript::HandleAccountSetGmLevelCommand(), account_commandscript::HandleAccountSetPasswordCommand(), achievement_commandscript::HandleAchievementAddCommand(), achievement_commandscript::HandleAchievementCheckAllCommand(), disable_commandscript::HandleAddDisables(), misc_commandscript::HandleAddItemCommand(), misc_commandscript::HandleAddItemSetCommand(), misc_commandscript::HandleAppearCommand(), arena_commandscript::HandleArenaCaptainCommand(), arena_commandscript::HandleArenaCreateCommand(), arena_commandscript::HandleArenaDisbandCommand(), arena_commandscript::HandleArenaInfoCommand(), arena_commandscript::HandleArenaRenameCommand(), misc_commandscript::HandleAuraCommand(), misc_commandscript::HandleAuraStacksCommand(), ban_commandscript::HandleBanCharacterCommand(), ban_commandscript::HandleBanHelper(), ban_commandscript::HandleBanInfoAccountCommand(), bf_commandscript::HandleBattlefieldTimer(), cache_commandscript::HandleCacheDeleteCommand(), cache_commandscript::HandleCacheInfoCommand(), cache_commandscript::HandleCacheRefreshCommand(), cast_commandscript::HandleCastBackCommand(), cast_commandscript::HandleCastCommand(), cast_commandscript::HandleCastDestCommand(), cast_commandscript::HandleCastSelfCommand(), cast_commandscript::HandleCastTargetCommad(), misc_commandscript::HandleChangeWeather(), character_commandscript::HandleCharacterChangeAccountCommand(), character_commandscript::HandleCharacterDeletedDeleteCommand(), character_commandscript::HandleCharacterDeletedListCommand(), character_commandscript::HandleCharacterDeletedRestoreCommand(), character_commandscript::HandleCharacterRenameCommand(), character_commandscript::HandleCharacterReputationCommand(), character_commandscript::HandleCharacterTitlesCommand(), misc_commandscript::HandleCombatStopCommand(), misc_commandscript::HandleComeToMeCommand(), misc_commandscript::HandleCommentatorCommand(), misc_commandscript::HandleCooldownCommand(), misc_commandscript::HandleDamageCommand(), debug_commandscript::HandleDebugGetValueCommand(), debug_commandscript::HandleDebugPlayCinematicCommand(), debug_commandscript::HandleDebugPlayMovieCommand(), debug_commandscript::HandleDebugPlayMusicCommand(), debug_commandscript::HandleDebugPlaySoundCommand(), debug_commandscript::HandleDebugSendOpcodeCommand(), debug_commandscript::HandleDebugSet32BitCommand(), debug_commandscript::HandleDebugSetAuraStateCommand(), debug_commandscript::HandleDebugSetValueCommand(), debug_commandscript::HandleDebugUpdateCommand(), debug_commandscript::HandleDebugVisualCommand(), deserter_commandscript::HandleDeserterAdd(), deserter_commandscript::HandleDeserterRemove(), deserter_commandscript::HandleDeserterRemoveAll(), misc_commandscript::HandleDevCommand(), misc_commandscript::HandleDieCommand(), misc_commandscript::HandleDismountCommand(), event_commandscript::HandleEventInfoCommand(), event_commandscript::HandleEventStartCommand(), event_commandscript::HandleEventStopCommand(), cheat_commandscript::HandleExploreCheatCommand(), misc_commandscript::HandleFreezeCommand(), gobject_commandscript::HandleGameObjectActivateCommand(), gobject_commandscript::HandleGameObjectAddCommand(), gobject_commandscript::HandleGameObjectAddTempCommand(), gobject_commandscript::HandleGameObjectDeleteCommand(), gobject_commandscript::HandleGameObjectInfoCommand(), gobject_commandscript::HandleGameObjectMoveCommand(), gobject_commandscript::HandleGameObjectRespawn(), gobject_commandscript::HandleGameObjectSetPhaseCommand(), gobject_commandscript::HandleGameObjectSetStateCommand(), gobject_commandscript::HandleGameObjectTurnCommand(), gm_commandscript::HandleGMChatCommand(), go_commandscript::HandleGoCreatureCIdCommand(), go_commandscript::HandleGoCreatureNameCommand(), go_commandscript::HandleGoCreatureSpawnIdCommand(), go_commandscript::HandleGoGameObjectGOIdCommand(), go_commandscript::HandleGoGameObjectSpawnIdCommand(), go_commandscript::HandleGoGraveyardCommand(), go_commandscript::HandleGoGridCommand(), go_commandscript::HandleGoQuestCommand(), go_commandscript::HandleGoTaxinodeCommand(), go_commandscript::HandleGoTriggerCommand(), go_commandscript::HandleGoXYZCommand(), go_commandscript::HandleGoZoneXYCommand(), misc_commandscript::HandleGroupSummonCommand(), misc_commandscript::HandleGUIDCommand(), guild_commandscript::HandleGuildCreateCommand(), guild_commandscript::HandleGuildRenameCommand(), misc_commandscript::HandleHideAreaCommand(), honor_commandscript::HandleHonorAddCommand(), honor_commandscript::HandleHonorAddKillCommand(), honor_commandscript::HandleHonorUpdateCommand(), instance_commandscript::HandleInstanceGetBossStateCommand(), instance_commandscript::HandleInstanceSaveDataCommand(), instance_commandscript::HandleInstanceSetBossStateCommand(), instance_commandscript::HandleInstanceStatsCommand(), inventory_commandscript::HandleInventoryCountCommand(), item_commandscript::HandleItemRefundCommand(), item_commandscript::HandleItemRestoreCommand(), item_commandscript::HandleItemRestoreListCommand(), misc_commandscript::HandleKickPlayerCommand(), learn_commandscript::HandleLearnAllMyPetTalentsCommand(), learn_commandscript::HandleLearnCommand(), Acore::PlayerCommand::HandleLearnSpellCommand(), misc_commandscript::HandleLinkGraveCommand(), list_commandscript::HandleListCreatureCommand(), list_commandscript::HandleListItemCommand(), list_commandscript::HandleListObjectCommand(), lookup_commandscript::HandleLookupSpellIdCommand(), misc_commandscript::HandleMaxSkillCommand(), modify_commandscript::HandleModifyArenaCommand(), modify_commandscript::HandleModifyBitCommand(), modify_commandscript::HandleModifyFactionCommand(), modify_commandscript::HandleModifyGenderCommand(), modify_commandscript::HandleModifyHonorCommand(), modify_commandscript::HandleModifyMoneyCommand(), modify_commandscript::HandleModifyMountCommand(), modify_commandscript::HandleModifyRepCommand(), modify_commandscript::HandleModifyScaleCommand(), modify_commandscript::HandleModifySpellCommand(), modify_commandscript::HandleModifyTalentCommand(), misc_commandscript::HandleMovegensCommand(), misc_commandscript::HandleMuteCommand(), misc_commandscript::HandleMuteInfoCommand(), misc_commandscript::HandleNearGraveCommand(), npc_commandscript::HandleNpcAddFormationCommand(), npc_commandscript::HandleNpcAddMoveCommand(), npc_commandscript::HandleNpcAddVendorItemCommand(), npc_commandscript::HandleNpcDeleteCommand(), npc_commandscript::HandleNpcDeleteVendorItemCommand(), npc_commandscript::HandleNpcFollowCommand(), npc_commandscript::HandleNpcGuidCommand(), npc_commandscript::HandleNpcInfoCommand(), npc_commandscript::HandleNpcMoveCommand(), npc_commandscript::HandleNpcPlayEmoteCommand(), npc_commandscript::HandleNpcSayCommand(), npc_commandscript::HandleNpcSetDataCommand(), npc_commandscript::HandleNpcSetEntryCommand(), npc_commandscript::HandleNpcSetFactionIdCommand(), npc_commandscript::HandleNpcSetFlagCommand(), npc_commandscript::HandleNpcSetLevelCommand(), npc_commandscript::HandleNpcSetLinkCommand(), npc_commandscript::HandleNpcSetModelCommand(), npc_commandscript::HandleNpcSetMoveTypeCommand(), npc_commandscript::HandleNpcSetPhaseCommand(), npc_commandscript::HandleNpcSetSpawnTimeCommand(), npc_commandscript::HandleNpcTameCommand(), npc_commandscript::HandleNpcTextEmoteCommand(), npc_commandscript::HandleNpcUnFollowCommand(), npc_commandscript::HandleNpcWhisperCommand(), npc_commandscript::HandleNpcYellCommand(), misc_commandscript::HandleOpenDoorCommand(), character_commandscript::HandlePDumpCopyCommand(), character_commandscript::HandlePDumpLoadCommand(), character_commandscript::HandlePDumpWriteCommand(), pet_commandscript::HandlePetCreateCommand(), pet_commandscript::HandlePetLearnCommand(), pet_commandscript::HandlePetUnlearnCommand(), misc_commandscript::HandlePlayAllCommand(), quest_commandscript::HandleQuestAdd(), quest_commandscript::HandleQuestComplete(), quest_commandscript::HandleQuestRemove(), quest_commandscript::HandleQuestReward(), misc_commandscript::HandleRecallCommand(), reload_commandscript::HandleReloadAllScriptsCommand(), reload_commandscript::HandleReloadEventScriptsCommand(), reload_commandscript::HandleReloadSpellScriptsCommand(), reload_commandscript::HandleReloadWardenactionCommand(), reload_commandscript::HandleReloadWpScriptsCommand(), disable_commandscript::HandleRemoveDisables(), reset_commandscript::HandleResetAllCommand(), reset_commandscript::HandleResetTalentsCommand(), misc_commandscript::HandleRespawnCommand(), send_commandscript::HandleSendItemsCommand(), server_commandscript::HandleServerIdleRestartCommand(), server_commandscript::HandleServerIdleShutDownCommand(), server_commandscript::HandleServerRestartCommand(), server_commandscript::HandleServerSetClosedCommand(), server_commandscript::HandleServerSetMotdCommand(), server_commandscript::HandleServerShutDownCommand(), misc_commandscript::HandleSetSkillCommand(), misc_commandscript::HandleShowAreaCommand(), misc_commandscript::HandleSkirmishCommand(), misc_commandscript::HandleSummonCommand(), tele_commandscript::HandleTeleAddCommand(), tele_commandscript::HandleTeleCommand(), tele_commandscript::HandleTeleDelCommand(), tele_commandscript::HandleTeleGroupCommand(), tele_commandscript::HandleTeleNameNpcIdCommand(), tele_commandscript::HandleTeleNameNpcNameCommand(), tele_commandscript::HandleTeleNameNpcSpawnIdCommand(), titles_commandscript::HandleTitlesAddCommand(), titles_commandscript::HandleTitlesCurrentCommand(), titles_commandscript::HandleTitlesRemoveCommand(), titles_commandscript::HandleTitlesSetMaskCommand(), misc_commandscript::HandleUnAuraCommand(), ban_commandscript::HandleUnBanCharacterCommand(), ban_commandscript::HandleUnBanHelper(), misc_commandscript::HandleUnFreezeCommand(), learn_commandscript::HandleUnLearnCommand(), misc_commandscript::HandleUnmuteCommand(), message_commandscript::HandleWhispersCommand(), wp_commandscript::HandleWpLoadCommand(), wp_commandscript::HandleWpShowCommand(), HasLowerSecurity(), HasLowerSecurityAccount(), list_commandscript::ListAurasCommand(), lookup_commandscript::LookupPlayerSearchCommand(), and character_commandscript::ValidatePDumpTarget().

◆ SendErrorMessage() [4/4]

template<typename... Args>
void ChatHandler::SendErrorMessage ( uint32  entry,
Args &&...  args 
)
inline
186 {
187 PSendSysMessage(entry, std::forward<Args>(args)...);
189 }

◆ SendGlobalGMSysMessage()

void ChatHandler::SendGlobalGMSysMessage ( const char *  str)
197{
198 WorldPacket data;
199 for (std::string_view line : Acore::Tokenize(str, '\n', true))
200 {
201 BuildChatPacket(data, CHAT_MSG_SYSTEM, LANG_UNIVERSAL, nullptr, nullptr, line);
202 sWorldSessionMgr->SendGlobalGMMessage(&data);
203 }
204}
@ CHAT_MSG_SYSTEM
Definition SharedDefines.h:3152
@ LANG_UNIVERSAL
Definition SharedDefines.h:735
Definition WorldPacket.h:26
Definition AsioHacksFwd.h:47
std::vector< std::string_view > Tokenize(std::string_view str, char sep, bool keepEmpty)
Definition Tokenize.cpp:20

References BuildChatPacket(), CHAT_MSG_SYSTEM, LANG_UNIVERSAL, sWorldSessionMgr, and Acore::Tokenize().

Referenced by bf_commandscript::HandleBattlefieldEnable(), bf_commandscript::HandleBattlefieldEnd(), bf_commandscript::HandleBattlefieldStart(), bf_commandscript::HandleBattlefieldSwitch(), bf_commandscript::HandleBattlefieldTimer(), ticket_commandscript::HandleGMTicketAssignToCommand(), ticket_commandscript::HandleGMTicketCloseByIdCommand(), ticket_commandscript::HandleGMTicketCommentCommand(), ticket_commandscript::HandleGMTicketCompleteCommand(), ticket_commandscript::HandleGMTicketDeleteByIdCommand(), ticket_commandscript::HandleGMTicketResponseDeleteCommand(), ticket_commandscript::HandleGMTicketUnAssignCommand(), reload_commandscript::HandleReloadAchievementCriteriaDataCommand(), reload_commandscript::HandleReloadAchievementRewardCommand(), reload_commandscript::HandleReloadAcoreStringCommand(), reload_commandscript::HandleReloadAllLootCommand(), reload_commandscript::HandleReloadAllQuestCommand(), reload_commandscript::HandleReloadAllScriptsCommand(), reload_commandscript::HandleReloadAntiDosOpcodePoliciesCommand(), reload_commandscript::HandleReloadAreaTriggerCommand(), reload_commandscript::HandleReloadAreaTriggerTavernCommand(), reload_commandscript::HandleReloadAreaTriggerTeleportCommand(), reload_commandscript::HandleReloadAuctionsCommand(), reload_commandscript::HandleReloadAutobroadcastCommand(), reload_commandscript::HandleReloadBattlegroundTemplate(), reload_commandscript::HandleReloadBroadcastTextCommand(), reload_commandscript::HandleReloadCommandCommand(), reload_commandscript::HandleReloadConditions(), reload_commandscript::HandleReloadConfigCommand(), reload_commandscript::HandleReloadCreatureMovementOverrideCommand(), reload_commandscript::HandleReloadCreatureQuestEnderCommand(), reload_commandscript::HandleReloadCreatureQuestStarterCommand(), reload_commandscript::HandleReloadCreatureTemplateCommand(), reload_commandscript::HandleReloadCreatureText(), reload_commandscript::HandleReloadDisablesCommand(), reload_commandscript::HandleReloadDungeonAccessCommand(), reload_commandscript::HandleReloadEventScriptsCommand(), reload_commandscript::HandleReloadGameEventNPCVendorCommand(), reload_commandscript::HandleReloadGameGraveyardCommand(), reload_commandscript::HandleReloadGameGraveyardZoneCommand(), reload_commandscript::HandleReloadGameTeleCommand(), reload_commandscript::HandleReloadGOQuestEnderCommand(), reload_commandscript::HandleReloadGOQuestStarterCommand(), reload_commandscript::HandleReloadGossipMenuCommand(), reload_commandscript::HandleReloadGossipMenuOptionCommand(), reload_commandscript::HandleReloadItemEnchantementsCommand(), reload_commandscript::HandleReloadItemSetNamesCommand(), reload_commandscript::HandleReloadLfgRewardsCommand(), reload_commandscript::HandleReloadLinkedRespawnCommand(), reload_commandscript::HandleReloadLocalesAchievementRewardCommand(), reload_commandscript::HandleReloadLocalesCreatureCommand(), reload_commandscript::HandleReloadLocalesCreatureTextCommand(), reload_commandscript::HandleReloadLocalesGameobjectCommand(), reload_commandscript::HandleReloadLocalesGossipMenuOptionCommand(), reload_commandscript::HandleReloadLocalesItemCommand(), reload_commandscript::HandleReloadLocalesItemSetNameCommand(), reload_commandscript::HandleReloadLocalesNpcTextCommand(), reload_commandscript::HandleReloadLocalesPageTextCommand(), reload_commandscript::HandleReloadLocalesPointsOfInterestCommand(), reload_commandscript::HandleReloadLocalesQuestCommand(), reload_commandscript::HandleReloadLocalesQuestOfferRewardCommand(), reload_commandscript::HandleReloadLocalesQuestRequestItemsCommand(), reload_commandscript::HandleReloadLootTemplatesCreatureCommand(), reload_commandscript::HandleReloadLootTemplatesDisenchantCommand(), reload_commandscript::HandleReloadLootTemplatesFishingCommand(), reload_commandscript::HandleReloadLootTemplatesGameobjectCommand(), reload_commandscript::HandleReloadLootTemplatesItemCommand(), reload_commandscript::HandleReloadLootTemplatesMailCommand(), reload_commandscript::HandleReloadLootTemplatesMillingCommand(), reload_commandscript::HandleReloadLootTemplatesPickpocketingCommand(), reload_commandscript::HandleReloadLootTemplatesPlayerCommand(), reload_commandscript::HandleReloadLootTemplatesProspectingCommand(), reload_commandscript::HandleReloadLootTemplatesReferenceCommand(), reload_commandscript::HandleReloadLootTemplatesSkinningCommand(), reload_commandscript::HandleReloadLootTemplatesSpellCommand(), reload_commandscript::HandleReloadMailLevelRewardCommand(), reload_commandscript::HandleReloadMailServerTemplateCommand(), reload_commandscript::HandleReloadModuleStringCommand(), reload_commandscript::HandleReloadMotdCommand(), reload_commandscript::HandleReloadNpcTrainerCommand(), reload_commandscript::HandleReloadNpcVendorCommand(), reload_commandscript::HandleReloadOnKillReputationCommand(), reload_commandscript::HandleReloadPageTextsCommand(), reload_commandscript::HandleReloadPointsOfInterestCommand(), reload_commandscript::HandleReloadProfanityNameCommand(), reload_commandscript::HandleReloadQuestAreaTriggersCommand(), reload_commandscript::HandleReloadQuestGreetingCommand(), reload_commandscript::HandleReloadQuestPOICommand(), reload_commandscript::HandleReloadQuestTemplateCommand(), reload_commandscript::HandleReloadReputationRewardRateCommand(), reload_commandscript::HandleReloadReputationSpilloverTemplateCommand(), reload_commandscript::HandleReloadReservedNameCommand(), reload_commandscript::HandleReloadSkillDiscoveryTemplateCommand(), reload_commandscript::HandleReloadSkillExtraItemTemplateCommand(), reload_commandscript::HandleReloadSkillFishingBaseLevelCommand(), reload_commandscript::HandleReloadSkillPerfectItemTemplateCommand(), reload_commandscript::HandleReloadSmartScripts(), reload_commandscript::HandleReloadSpellAreaCommand(), reload_commandscript::HandleReloadSpellBonusesCommand(), reload_commandscript::HandleReloadSpellClickSpellsCommand(), reload_commandscript::HandleReloadSpellGroupsCommand(), reload_commandscript::HandleReloadSpellGroupStackRulesCommand(), reload_commandscript::HandleReloadSpellLinkedSpellCommand(), reload_commandscript::HandleReloadSpellPetAurasCommand(), reload_commandscript::HandleReloadSpellProcEventCommand(), reload_commandscript::HandleReloadSpellProcsCommand(), reload_commandscript::HandleReloadSpellRequiredCommand(), reload_commandscript::HandleReloadSpellScriptsCommand(), reload_commandscript::HandleReloadSpellTargetPositionCommand(), reload_commandscript::HandleReloadSpellThreatsCommand(), reload_commandscript::HandleReloadVehicleAccessoryCommand(), reload_commandscript::HandleReloadVehicleTemplateAccessoryCommand(), reload_commandscript::HandleReloadWardenactionCommand(), reload_commandscript::HandleReloadWpCommand(), and reload_commandscript::HandleReloadWpScriptsCommand().

◆ SendGlobalSysMessage()

void ChatHandler::SendGlobalSysMessage ( const char *  str)
187{
188 WorldPacket data;
189 for (std::string_view line : Acore::Tokenize(str, '\n', true))
190 {
191 BuildChatPacket(data, CHAT_MSG_SYSTEM, LANG_UNIVERSAL, nullptr, nullptr, line);
192 sWorldSessionMgr->SendGlobalMessage(&data);
193 }
194}

References BuildChatPacket(), CHAT_MSG_SYSTEM, LANG_UNIVERSAL, sWorldSessionMgr, and Acore::Tokenize().

Referenced by reload_commandscript::HandleReloadMotdCommand().

◆ SendGMText() [1/3]

template<typename... Args>
void ChatHandler::SendGMText ( char const *  fmt,
Args &&...  args 
)
inline
79 {
80 // GMText should be sent to all sessions
81 DoForAllValidSessions([&](Player* player)
82 {
83 m_session = player->GetSession();
84 SendGMText(Acore::StringFormat(fmt, std::forward<Args>(args)...));
85 });
86 }
void SendGMText(std::string_view str)
Definition Chat.cpp:116
void DoForAllValidSessions(std::function< void(Player *)> exec)
Definition Chat.cpp:444

References Player::GetSession(), and Acore::StringFormat().

◆ SendGMText() [2/3]

void ChatHandler::SendGMText ( std::string_view  str)
117{
118 std::vector<std::string_view> lines = Acore::Tokenize(str, '\n', true);
119 // Session should have permissions to receive global gm messages
121 return;
122
123 for (std::string_view line : lines)
124 {
125 WorldPacket data;
126 ChatHandler::BuildChatPacket(data, CHAT_MSG_SYSTEM, LANG_UNIVERSAL, nullptr, nullptr, line);
127 m_session->SendPacket(&data);
128 }
129}
void SendPacket(WorldPacket const *packet)
Send a packet to the client.
Definition WorldSession.cpp:226

References BuildChatPacket(), CHAT_MSG_SYSTEM, WorldSession::GetSecurity(), AccountMgr::IsPlayerAccount(), LANG_UNIVERSAL, m_session, WorldSession::SendPacket(), and Acore::Tokenize().

Referenced by message_commandscript::HandleGMAnnounceCommand(), message_commandscript::HandleGMNameAnnounceCommand(), WorldSession::HandleGMTicketCreateOpcode(), WorldSession::HandleGMTicketDeleteOpcode(), and WorldSession::HandleGMTicketUpdateOpcode().

◆ SendGMText() [3/3]

template<typename... Args>
void ChatHandler::SendGMText ( uint32  strId,
Args &&...  args 
)
inline
69 {
70 // GMText should be sent to all sessions
71 DoForAllValidSessions([&](Player* player)
72 {
73 m_session = player->GetSession();
74 SendGMText(Acore::StringFormat(GetAcoreString(strId), std::forward<Args>(args)...));
75 });
76 }

References Player::GetSession(), and Acore::StringFormat().

◆ SendNotification() [1/3]

template<typename... Args>
void ChatHandler::SendNotification ( char const *  fmt,
Args &&...  args 
)
inline
61 {
62 if (HasSession())
63 SendNotification(Acore::StringFormat(fmt, std::forward<Args>(args)...));
64 }
void SendNotification(std::string_view str)
Definition Chat.cpp:105

References Acore::StringFormat().

◆ SendNotification() [2/3]

void ChatHandler::SendNotification ( std::string_view  str)
106{
107 std::vector<std::string_view> lines = Acore::Tokenize(str, '\n', true);
108 for (std::string_view line : lines)
109 {
110 WorldPacket data(SMSG_NOTIFICATION, line.size() + 1);
111 data << line.data();
112 m_session->SendPacket(&data);
113 }
114}
@ SMSG_NOTIFICATION
Definition Opcodes.h:489

References m_session, WorldSession::SendPacket(), SMSG_NOTIFICATION, and Acore::Tokenize().

Referenced by InstanceScript::DoSendNotifyToInstance(), Spell::EffectPlaySound(), WorldSession::HandleAcceptTradeOpcode(), WorldSession::HandleBattleFieldPortOpcode(), WorldSession::HandleBattlemasterHelloOpcode(), misc_commandscript::HandleCommentatorCommand(), misc_commandscript::HandleDevCommand(), gm_commandscript::HandleGMChatCommand(), gm_commandscript::HandleGMOffCommand(), gm_commandscript::HandleGMOnCommand(), WorldSession::HandleGMTicketCreateOpcode(), gm_commandscript::HandleGMVisibleCommand(), WorldSession::HandleInitiateTradeOpcode(), WorldSession::HandleMessagechatOpcode(), WorldSession::HandlePlayerLoginFromDB(), WorldSession::HandlePlayerLoginToCharInWorld(), WorldSession::HandlePushQuestToParty(), WorldSession::HandleRaidReadyCheckOpcode(), WorldSession::HandleSendMail(), WorldSession::HandleTextEmoteOpcode(), WorldSession::HandleWhoisOpcode(), WorldSession::HandleWorldTeleportOpcode(), go_tele_to_dalaran_crystal::OnGossipHello(), go_amberpine_outhouse::OnGossipSelect(), Player::OnGossipSelect(), Battleground::ReadyMarkerClicked(), and WorldSession::SendAuctionHello().

◆ SendNotification() [3/3]

template<typename... Args>
void ChatHandler::SendNotification ( uint32  strId,
Args &&...  args 
)
inline
55 {
56 if (HasSession())
57 SendNotification(Acore::StringFormat(GetAcoreString(strId), std::forward<Args>(args)...));
58 }

References Acore::StringFormat().

◆ SendSysMessage() [1/2]

void ChatHandler::SendSysMessage ( std::string_view  str,
bool  escapeCharacters = false 
)
virtual

Reimplemented in AddonChannelCommandHandler, AddonChannelCommandHandler, and CliHandler.

161{
162 std::string msg{ str };
163
164 // Replace every "|" with "||" in msg
165 if (escapeCharacters && msg.find('|') != std::string::npos)
166 {
167 std::vector<std::string_view> tokens = Acore::Tokenize(msg, '|', true);
168 std::ostringstream stream;
169
170 for (std::size_t i = 0; i < tokens.size() - 1; ++i)
171 stream << tokens[i] << "||";
172
173 stream << tokens[tokens.size() - 1];
174
175 msg = stream.str();
176 }
177
178 WorldPacket data;
179 for (std::string_view line : Acore::Tokenize(str, '\n', true))
180 {
181 BuildChatPacket(data, CHAT_MSG_SYSTEM, LANG_UNIVERSAL, nullptr, nullptr, line);
182 m_session->SendPacket(&data);
183 }
184}

References BuildChatPacket(), CHAT_MSG_SYSTEM, LANG_UNIVERSAL, m_session, WorldSession::SendPacket(), and Acore::Tokenize().

Referenced by extractKeyFromLink(), extractKeyFromLink(), go_commandscript::GetCreatureData(), go_commandscript::GetGameObjectData(), reset_commandscript::GetPlayerFromIdentifierOrSelectedTarget(), account_commandscript::HandleAccount2FARemoveCommand(), account_commandscript::HandleAccount2FASetupCommand(), account_commandscript::HandleAccountOnlineListCommand(), account_commandscript::HandleAccountPasswordCommand(), account_commandscript::HandleAccountSetEmailCommand(), account_commandscript::HandleAccountSetPasswordCommand(), bg_commandscript::HandleBagsClearCommand(), ban_commandscript::HandleBanListCharacterCommand(), ban_commandscript::HandleBanListHelper(), ban_commandscript::HandleBanListIPCommand(), WorldSession::HandleCancelMountAuraOpcode(), cheat_commandscript::HandleCasttimeCheatCommand(), WorldSession::HandleCharacterAuraFrozen(), character_commandscript::HandleCharacterDeletedDeleteCommand(), character_commandscript::HandleCharacterDeletedListHelper(), character_commandscript::HandleCharacterDeletedRestoreCommand(), character_commandscript::HandleCharacterReputationCommand(), cheat_commandscript::HandleCheatStatusCommand(), cheat_commandscript::HandleCoolDownCheatCommand(), debug_commandscript::HandleDebugDummyCommand(), debug_commandscript::HandleDebugGetItemStateCommand(), debug_commandscript::HandleDebugHostileRefListCommand(), debug_commandscript::HandleDebugSendLargePacketCommand(), debug_commandscript::HandleDebugThreatListCommand(), event_commandscript::HandleEventActiveListCommand(), gobject_commandscript::HandleGameObjectTargetCommand(), gm_commandscript::HandleGMListFullCommand(), gm_commandscript::HandleGMListIngameCommand(), ticket_commandscript::HandleGMTicketAssignToCommand(), ticket_commandscript::HandleGMTicketCloseByIdCommand(), ticket_commandscript::HandleGMTicketCompleteCommand(), ticket_commandscript::HandleGMTicketDeleteByIdCommand(), ticket_commandscript::HandleGMTicketEscalateCommand(), ticket_commandscript::HandleGMTicketGetByIdCommand(), ticket_commandscript::HandleGMTicketGetByNameCommand(), ticket_commandscript::HandleGMTicketResetCommand(), ticket_commandscript::HandleGMTicketResponseDeleteCommand(), ticket_commandscript::HandleGMTicketResponseShowCommand(), ticket_commandscript::HandleGMTicketUnAssignCommand(), cheat_commandscript::HandleGodModeCheatCommand(), go_commandscript::HandleGoTicketCommand(), misc_commandscript::HandleHideAreaCommand(), inventory_commandscript::HandleInventoryCountCommand(), learn_commandscript::HandleLearnAllCraftsCommand(), learn_commandscript::HandleLearnAllGMCommand(), learn_commandscript::HandleLearnAllLangCommand(), learn_commandscript::HandleLearnAllMyPetTalentsCommand(), learn_commandscript::HandleLearnAllMySpellsCommand(), learn_commandscript::HandleLearnAllMyTalentsCommand(), learn_commandscript::HandleLearnAllRecipesCommand(), lookup_commandscript::HandleLookupAreaCommand(), lookup_commandscript::HandleLookupCreatureCommand(), lookup_commandscript::HandleLookupEventCommand(), lookup_commandscript::HandleLookupFactionCommand(), lookup_commandscript::HandleLookupItemCommand(), lookup_commandscript::HandleLookupItemSetCommand(), lookup_commandscript::HandleLookupMapCommand(), lookup_commandscript::HandleLookupObjectCommand(), lookup_commandscript::HandleLookupQuestCommand(), lookup_commandscript::HandleLookupSkillCommand(), lookup_commandscript::HandleLookupSpellCommand(), lookup_commandscript::HandleLookupSpellIdCommand(), lookup_commandscript::HandleLookupTaxiNodeCommand(), lookup_commandscript::HandleLookupTeleCommand(), lookup_commandscript::HandleLookupTitleCommand(), misc_commandscript::HandleMovegensCommand(), npc_commandscript::HandleNpcAddMoveCommand(), npc_commandscript::HandleNpcDeleteCommand(), npc_commandscript::HandleNpcSetAllowMovementCommand(), npc_commandscript::HandleNpcSetEntryCommand(), npc_commandscript::HandleNpcSetFlagCommand(), npc_commandscript::HandleNpcSetWanderDistanceCommand(), cheat_commandscript::HandlePowerCheatCommand(), reset_commandscript::HandleResetAllCommand(), reset_commandscript::HandleResetSpellsCommand(), reset_commandscript::HandleResetTalentsCommand(), misc_commandscript::HandleSaveAllCommand(), misc_commandscript::HandleSaveCommand(), send_commandscript::HandleSendItemsCommand(), server_commandscript::HandleServerDebugCommand(), server_commandscript::HandleServerExitCommand(), server_commandscript::HandleServerSetClosedCommand(), misc_commandscript::HandleShowAreaCommand(), spectator_commandscript::HandleSpectatorLeaveCommand(), ArenaSpectator::HandleSpectatorSpectateCommand(), misc_commandscript::HandleStringCommand(), tele_commandscript::HandleTeleAddCommand(), tele_commandscript::HandleTeleDelCommand(), tele_commandscript::HandleTeleNameNpcIdCommand(), tele_commandscript::HandleTeleNameNpcNameCommand(), titles_commandscript::HandleTitlesSetMaskCommand(), misc_commandscript::HandleUnFreezeCommand(), Acore::PlayerCommand::HandleUnlearnSpellCommand(), cheat_commandscript::HandleWaterWalkCheatCommand(), message_commandscript::HandleWhispersCommand(), wp_commandscript::HandleWpEventCommand(), wp_commandscript::HandleWpModifyCommand(), wp_commandscript::HandleWpShowCommand(), PSendSysMessage(), Player::Satisfy(), Acore::Impl::ChatCommands::ChatCommandNode::SendCommandHelp(), Acore::Impl::ChatCommands::ChatCommandNode::SendCommandHelpFor(), SendErrorMessage(), SendErrorMessage(), Acore::Impl::ChatCommands::SendErrorMessageToHandler(), SendSysMessage(), Player::SendSystemMessage(), TicketMgr::ShowClosedList(), TicketMgr::ShowEscalatedList(), TicketMgr::ShowList(), and Player::Whisper().

◆ SendSysMessage() [2/2]

void ChatHandler::SendSysMessage ( uint32  entry)
207{
209}

References GetAcoreString(), and SendSysMessage().

◆ SendWorldText() [1/3]

template<typename... Args>
void ChatHandler::SendWorldText ( char const *  fmt,
Args &&...  args 
)
inline
101 {
102 // WorldText should be sent to all sessions
103 DoForAllValidSessions([&](Player* player)
104 {
105 m_session = player->GetSession();
106 SendWorldText(Acore::StringFormat(fmt, std::forward<Args>(args)...));
107 });
108 }
void SendWorldText(std::string_view str)
Definition Chat.cpp:131

References Player::GetSession(), and Acore::StringFormat().

◆ SendWorldText() [2/3]

◆ SendWorldText() [3/3]

template<typename... Args>
void ChatHandler::SendWorldText ( uint32  strId,
Args &&...  args 
)
inline
91 {
92 // WorldText should be sent to all sessions
93 DoForAllValidSessions([&](Player* player)
94 {
95 m_session = player->GetSession();
96 SendWorldText(Acore::StringFormat(GetAcoreString(strId), std::forward<Args>(args)...));
97 });
98 }

References Player::GetSession(), and Acore::StringFormat().

◆ SendWorldTextOptional() [1/3]

template<typename... Args>
void ChatHandler::SendWorldTextOptional ( char const *  fmt,
uint32  flag,
Args &&...  args 
)
inline
123 {
124 // WorldTextOptional should be sent to all sessions
125 DoForAllValidSessions([&](Player* player)
126 {
127 m_session = player->GetSession();
128 SendWorldTextOptional(Acore::StringFormat(fmt, std::forward<Args>(args)...), flag);
129 });
130 }
void SendWorldTextOptional(std::string_view str, uint32 flag)
Definition Chat.cpp:143

References Player::GetSession(), and Acore::StringFormat().

◆ SendWorldTextOptional() [2/3]

void ChatHandler::SendWorldTextOptional ( std::string_view  str,
uint32  flag 
)
144{
145 std::vector<std::string_view> lines = Acore::Tokenize(str, '\n', true);
146
147 Player* player = m_session->GetPlayer();
148 if (sWorld->getBoolConfig(CONFIG_PLAYER_SETTINGS_ENABLED))
150 return;
151
152 for (std::string_view line : lines)
153 {
154 WorldPacket data;
155 ChatHandler::BuildChatPacket(data, CHAT_MSG_SYSTEM, LANG_UNIVERSAL, nullptr, nullptr, line);
156 player->SendDirectMessage(&data);
157 }
158}
@ CONFIG_PLAYER_SETTINGS_ENABLED
Definition IWorld.h:168
const std::string AzerothcorePSSource
Definition PlayerSettings.h:23
@ SETTING_ANNOUNCER_FLAGS
Definition PlayerSettings.h:27
void SendDirectMessage(WorldPacket const *data) const
Definition Player.cpp:5733
PlayerSetting GetPlayerSetting(std::string source, uint8 index)
Definition PlayerSettings.cpp:70
bool HasFlag(uint32 flag)
Definition PlayerSettings.h:42

References AzerothcorePSSource, BuildChatPacket(), CHAT_MSG_SYSTEM, CONFIG_PLAYER_SETTINGS_ENABLED, WorldSession::GetPlayer(), Player::GetPlayerSetting(), PlayerSetting::HasFlag(), LANG_UNIVERSAL, m_session, Player::SendDirectMessage(), SETTING_ANNOUNCER_FLAGS, sWorld, and Acore::Tokenize().

Referenced by BattlegroundQueue::BattlegroundQueueAnnouncerUpdate(), BattlegroundQueue::SendExitMessageArenaQueue(), BattlegroundQueue::SendJoinMessageArenaQueue(), BattlegroundQueue::SendMessageBGQueue(), and AutobroadcastMgr::SendWorldAnnouncement().

◆ SendWorldTextOptional() [3/3]

template<typename... Args>
void ChatHandler::SendWorldTextOptional ( uint32  strId,
uint32  flag,
Args &&...  args 
)
inline
113 {
114 // WorldTextOptional should be sent to all sessions
115 DoForAllValidSessions([&](Player* player)
116 {
117 m_session = player->GetSession();
118 SendWorldTextOptional(Acore::StringFormat(GetAcoreString(strId), std::forward<Args>(args)...), flag);
119 });
120 }

References Player::GetSession(), and Acore::StringFormat().

◆ SetSentErrorMessage()

Member Data Documentation

◆ m_session

◆ sentErrorMessage

bool ChatHandler::sentErrorMessage
private

The documentation for this class was generated from the following files: