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

#include "Chat.h"

Inheritance diagram for ChatHandler:
CliHandler

Public Member Functions

 ChatHandler (WorldSession *session)
 
virtual ~ChatHandler ()
 
virtual char const * GetAcoreString (uint32 entry) const
 
virtual void SendSysMessage (std::string_view str, bool escapeCharacters=false)
 
void SendSysMessage (uint32 entry)
 
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
 
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
 
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 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 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
40: m_session(session), sentErrorMessage(false) {}
WorldSession * m_session
Definition: Chat.h:145
bool sentErrorMessage
Definition: Chat.h:148

◆ ~ChatHandler()

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

◆ ChatHandler() [2/2]

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

Member Function Documentation

◆ _ParseCommands()

bool ChatHandler::_ParseCommands ( std::string_view  text)
165{
167 return true;
168
169 // Pretend commands don't exist for regular players
171 return false;
172
173 // Send error message for GMs
175 return true;
176}
#define STRING_VIEW_FMT_ARG(str)
Definition: Define.h:101
@ LANG_CMD_INVALID
Definition: Language.h:38
@ CONFIG_ALLOW_PLAYER_COMMANDS
Definition: IWorld.h:73
#define sWorld
Definition: World.h:447
bool IsPlayerAccount(uint32 gmlevel)
Definition: AccountMgr.cpp:276
AC_GAME_API bool TryExecuteCommand(ChatHandler &handler, std::string_view cmd)
Definition: ChatCommand.cpp:535
void SendErrorMessage(uint32 entry)
Definition: Chat.cpp:152
AccountTypes GetSecurity() const
Definition: WorldSession.h:361

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

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

◆ BuildChatPacket() [1/2]

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
204{
205 size_t receiverGUIDPos = 0;
207 data << uint8(chatType);
208 data << int32(language);
209 data << senderGUID;
210 data << uint32(0); // some flags
211 switch (chatType)
212 {
221 data << uint32(senderName.length() + 1);
222 data << senderName;
223 receiverGUIDPos = data.wpos();
224 data << receiverGUID;
225 if (receiverGUID && !receiverGUID.IsPlayer() && !receiverGUID.IsPet())
226 {
227 data << uint32(receiverName.length() + 1);
228 data << receiverName;
229 }
230 break;
232 data << uint32(senderName.length() + 1);
233 data << senderName;
234 receiverGUIDPos = data.wpos();
235 data << receiverGUID;
236 break;
240 receiverGUIDPos = data.wpos();
241 data << receiverGUID;
242 if (receiverGUID && !receiverGUID.IsPlayer())
243 {
244 data << uint32(receiverName.length() + 1);
245 data << receiverName;
246 }
247 break;
250 receiverGUIDPos = data.wpos();
251 data << receiverGUID;
252 break;
253 default:
254 if (gmMessage)
255 {
256 data << uint32(senderName.length() + 1);
257 data << senderName;
258 }
259
260 if (chatType == CHAT_MSG_CHANNEL)
261 {
262 ASSERT(channelName.length() > 0);
263 data << channelName;
264 }
265
266 receiverGUIDPos = data.wpos();
267 data << receiverGUID;
268 break;
269 }
270
271 data << uint32(message.length() + 1);
272 data << message;
273 data << uint8(chatTag);
274
275 if (chatType == CHAT_MSG_ACHIEVEMENT || chatType == CHAT_MSG_GUILD_ACHIEVEMENT)
276 data << uint32(achievementId);
277
278 return receiverGUIDPos;
279}
#define ASSERT
Definition: Errors.h:68
std::int32_t int32
Definition: Define.h:104
std::uint8_t uint8
Definition: Define.h:110
std::uint32_t uint32
Definition: Define.h:108
@ 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
@ SMSG_GM_MESSAGECHAT
Definition: Opcodes.h:977
@ SMSG_MESSAGECHAT
Definition: Opcodes.h:180
void Initialize(uint16 opcode, size_t newres=200)
Definition: WorldPacket.h:69
size_t wpos() const
Definition: ByteBuffer.h:330

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()(), CreatureTextBuilder::operator()(), PlayerTextBuilder::operator()(), Channel::Say(), Player::Say(), SendGlobalGMSysMessage(), SendGlobalSysMessage(), World::SendGlobalText(), SendSysMessage(), Battleground::SendWarningToAll(), World::SendZoneText(), instance_hyjal::instance_mount_hyjal_InstanceMapScript::SetData(), Player::TextEmote(), instance_icecrown_citadel::instance_icecrown_citadel_InstanceMapScript::Update(), Player::Whisper(), Unit::Whisper(), Player::Yell(), and Battleground::YellToAll().

◆ BuildChatPacket() [2/2]

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
283{
284 ObjectGuid senderGUID;
285 std::string senderName = "";
286 uint8 chatTag = 0;
287 bool gmMessage = false;
288 ObjectGuid receiverGUID;
289 std::string receiverName = "";
290 if (sender)
291 {
292 senderGUID = sender->GetGUID();
293 senderName = sender->GetNameForLocaleIdx(locale);
294 if (Player const* playerSender = sender->ToPlayer())
295 {
296 chatTag = playerSender->GetChatTag();
297 gmMessage = playerSender->IsGameMaster();
298 }
299 }
300
301 if (receiver)
302 {
303 receiverGUID = receiver->GetGUID();
304 receiverName = receiver->GetNameForLocaleIdx(locale);
305 }
306
307 return BuildChatPacket(data, chatType, language, senderGUID, receiverGUID, message, chatTag, senderName, receiverName, achievementId, gmMessage, channelName);
308}
static 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:201
Player * ToPlayer()
Definition: Object.h:195
Definition: ObjectGuid.h:120
Definition: Player.h:1056

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

◆ extractKeyFromLink() [1/2]

char * ChatHandler::extractKeyFromLink ( char *  text,
char const *const *  linkTypes,
int *  found_idx,
char **  something1 = nullptr 
)
421{
422 // skip empty
423 if (!text)
424 return nullptr;
425
426 // skip spaces
427 while (*text == ' ' || *text == '\t' || *text == '\b')
428 ++text;
429
430 if (!*text)
431 return nullptr;
432
433 // return non link case
434 if (text[0] != '|')
435 return strtok(text, " ");
436
437 // [name] Shift-click form |color|linkType:key|h[name]|h|r
438 // or
439 // [name] Shift-click form |color|linkType:key:something1:...:somethingN|h[name]|h|r
440 // or
441 // [name] Shift-click form |linkType:key|h[name]|h|r
442
443 char* tail;
444
445 if (text[1] == 'c')
446 {
447 char* check = strtok(text, "|"); // skip color
448 if (!check)
449 return nullptr; // end of data
450
451 tail = strtok(nullptr, ""); // tail
452 }
453 else
454 tail = text + 1; // skip first |
455
456 char* cLinkType = strtok(tail, ":"); // linktype
457 if (!cLinkType)
458 return nullptr; // end of data
459
460 for (int i = 0; linkTypes[i]; ++i)
461 {
462 if (strcmp(cLinkType, linkTypes[i]) == 0)
463 {
464 char* cKeys = strtok(nullptr, "|"); // extract keys and values
465 char* cKeysTail = strtok(nullptr, "");
466
467 char* cKey = strtok(cKeys, ":|"); // extract key
468 if (something1)
469 *something1 = strtok(nullptr, ":|"); // extract something
470
471 strtok(cKeysTail, "]"); // restart scan tail and skip name with possible spaces
472 strtok(nullptr, " "); // skip link tail (to allow continue strtok(nullptr, s) use after return from function
473 if (found_idx)
474 *found_idx = i;
475 return cKey;
476 }
477 }
478
479 strtok(nullptr, " "); // skip link tail (to allow continue strtok(nullptr, s) use after return from function
481 return nullptr;
482}
@ LANG_WRONG_LINK_TYPE
Definition: Language.h:537
virtual void SendSysMessage(std::string_view str, bool escapeCharacters=false)
Definition: Chat.cpp:101

References LANG_WRONG_LINK_TYPE, and SendSysMessage().

◆ extractKeyFromLink() [2/2]

char * ChatHandler::extractKeyFromLink ( char *  text,
char const *  linkType,
char **  something1 = nullptr 
)
373{
374 // skip empty
375 if (!text)
376 return nullptr;
377
378 // skip spaces
379 while (*text == ' ' || *text == '\t' || *text == '\b')
380 ++text;
381
382 if (!*text)
383 return nullptr;
384
385 // return non link case
386 if (text[0] != '|')
387 return strtok(text, " ");
388
389 // [name] Shift-click form |color|linkType:key|h[name]|h|r
390 // or
391 // [name] Shift-click form |color|linkType:key:something1:...:somethingN|h[name]|h|r
392
393 char* check = strtok(text, "|"); // skip color
394 if (!check)
395 return nullptr; // end of data
396
397 char* cLinkType = strtok(nullptr, ":"); // linktype
398 if (!cLinkType)
399 return nullptr; // end of data
400
401 if (strcmp(cLinkType, linkType) != 0)
402 {
403 strtok(nullptr, " "); // skip link tail (to allow continue strtok(nullptr, s) use after retturn from function
405 return nullptr;
406 }
407
408 char* cKeys = strtok(nullptr, "|"); // extract keys and values
409 char* cKeysTail = strtok(nullptr, "");
410
411 char* cKey = strtok(cKeys, ":|"); // extract key
412 if (something1)
413 *something1 = strtok(nullptr, ":|"); // extract something
414
415 strtok(cKeysTail, "]"); // restart scan tail and skip name with possible spaces
416 strtok(nullptr, " "); // skip link tail (to allow continue strtok(nullptr, s) use after return from function
417 return cKey;
418}

References LANG_WRONG_LINK_TYPE, and SendSysMessage().

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

◆ extractLowGuidFromLink()

ObjectGuid::LowType ChatHandler::extractLowGuidFromLink ( char *  text,
HighGuid guidHigh 
)
617{
618 int type = 0;
619
620 // |color|Hcreature:creature_guid|h[name]|h|r
621 // |color|Hgameobject:go_guid|h[name]|h|r
622 // |color|Hplayer:name|h[name]|h|r
623 char* idS = extractKeyFromLink(text, guidKeys, &type);
624 if (!idS)
625 return 0;
626
627 switch (type)
628 {
630 {
631 guidHigh = HighGuid::Player;
632
633 std::string name = idS;
634 if (!normalizePlayerName(name))
635 return 0;
636
637 if (Player* player = ObjectAccessor::FindPlayerByName(name, false))
638 return player->GetGUID().GetCounter();
639
640 if (ObjectGuid guid = sCharacterCache->GetCharacterGuidByName(name))
641 return guid.GetCounter();
642
643 return 0;
644 }
646 {
647 guidHigh = HighGuid::Unit;
648
649 ObjectGuid::LowType lowguid = (uint32)atol(idS);
650
651 if (sObjectMgr->GetCreatureData(lowguid))
652 return lowguid;
653 else
654 return 0;
655 }
657 {
658 guidHigh = HighGuid::GameObject;
659
660 ObjectGuid::LowType lowguid = (uint32)atol(idS);
661
662 if (sObjectMgr->GetGameObjectData(lowguid))
663 return lowguid;
664 else
665 return 0;
666 }
667 }
668
669 // unknown type?
670 return 0;
671}
#define sCharacterCache
Definition: CharacterCache.h:83
@ SPELL_LINK_PLAYER
Definition: Chat.cpp:603
@ SPELL_LINK_CREATURE
Definition: Chat.cpp:604
@ SPELL_LINK_GAMEOBJECT
Definition: Chat.cpp:605
static char const *const guidKeys[]
Definition: Chat.cpp:608
bool normalizePlayerName(std::string &name)
Definition: ObjectMgr.cpp:262
#define sObjectMgr
Definition: ObjectMgr.h:1640
Player * FindPlayerByName(std::string const &name, bool checkInWorld=true)
Definition: ObjectAccessor.cpp:274
char * extractKeyFromLink(char *text, char const *linkType, char **something1=nullptr)
Definition: Chat.cpp:372
uint32 LowType
Definition: ObjectGuid.h:124

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

◆ extractPlayerNameFromLink()

std::string ChatHandler::extractPlayerNameFromLink ( char *  text)
674{
675 // |color|Hplayer:name|h[name]|h|r
676 char* name_str = extractKeyFromLink(text, "Hplayer");
677 if (!name_str)
678 return "";
679
680 std::string name = name_str;
681 if (!normalizePlayerName(name))
682 return "";
683
684 return name;
685}

References extractKeyFromLink(), and normalizePlayerName().

Referenced by extractPlayerTarget().

◆ extractPlayerTarget()

bool ChatHandler::extractPlayerTarget ( char *  args,
Player **  player,
ObjectGuid player_guid = nullptr,
std::string *  player_name = nullptr 
)
688{
689 if (args && *args)
690 {
691 std::string name = extractPlayerNameFromLink(args);
692 if (name.empty())
693 {
695 return false;
696 }
697
698 Player* pl = ObjectAccessor::FindPlayerByName(name, false);
699
700 // if allowed player pointer
701 if (player)
702 *player = pl;
703
704 // if need guid value from DB (in name case for check player existence)
705 ObjectGuid guid = !pl && (player_guid || player_name) ? sCharacterCache->GetCharacterGuidByName(name) : ObjectGuid::Empty;
706
707 // if allowed player guid (if no then only online players allowed)
708 if (player_guid)
709 *player_guid = pl ? pl->GetGUID() : guid;
710
711 if (player_name)
712 *player_name = pl || guid ? name : "";
713 }
714 else
715 {
716 // populate strtok buffer to prevent crashes
717 static char dummy[1] = "";
718 strtok(dummy, "");
719
721 // if allowed player pointer
722 if (player)
723 *player = pl;
724
725 // if allowed player guid (if no then only online players allowed)
726 if (player_guid)
727 *player_guid = pl ? pl->GetGUID() : ObjectGuid::Empty;
728
729 if (player_name)
730 *player_name = pl ? pl->GetName() : "";
731 }
732
733 // some from req. data must be provided (note: name is empty if player not exist)
734 if ((!player || !*player) && (!player_guid || !*player_guid) && (!player_name || player_name->empty()))
735 {
737 return false;
738 }
739
740 return true;
741}
@ LANG_PLAYER_NOT_FOUND
Definition: Language.h:522
std::string extractPlayerNameFromLink(char *text)
Definition: Chat.cpp:673
Player * getSelectedPlayer() const
Definition: Chat.cpp:310
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:106
std::string const & GetName() const
Definition: Object.h:446
static ObjectGuid const Empty
Definition: ObjectGuid.h:122

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

◆ extractQuotedArg()

char * ChatHandler::extractQuotedArg ( char *  args)
744{
745 if (!*args)
746 return nullptr;
747
748 if (*args == '"')
749 return strtok(args + 1, "\"");
750 else
751 {
752 // skip spaces
753 while (*args == ' ')
754 {
755 args += 1;
756 continue;
757 }
758
759 // return nullptr if we reached the end of the string
760 if (!*args)
761 return nullptr;
762
763 // since we skipped all spaces, we expect another token now
764 if (*args == '"')
765 {
766 // return an empty string if there are 2 "" in a row.
767 // strtok doesn't handle this case
768 if (*(args + 1) == '"')
769 {
770 strtok(args, " ");
771 static char arg[1];
772 arg[0] = '\0';
773 return arg;
774 }
775 else
776 return strtok(args + 1, "\"");
777 }
778 else
779 return nullptr;
780 }
781}

◆ extractSpellIdFromLink()

uint32 ChatHandler::extractSpellIdFromLink ( char *  text)
548{
549 // number or [name] Shift-click form |color|Henchant:recipe_spell_id|h[prof_name: recipe_name]|h|r
550 // number or [name] Shift-click form |color|Hglyph:glyph_slot_id:glyph_prop_id|h[%s]|h|r
551 // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r
552 // number or [name] Shift-click form |color|Htalent:talent_id, rank|h[name]|h|r
553 // number or [name] Shift-click form |color|Htrade:spell_id, skill_id, max_value, cur_value|h[name]|h|r
554 int type = 0;
555 char* param1_str = nullptr;
556 char* idS = extractKeyFromLink(text, spellKeys, &type, &param1_str);
557 if (!idS)
558 return 0;
559
560 uint32 id = (uint32)atol(idS);
561
562 switch (type)
563 {
564 case SPELL_LINK_SPELL:
565 return id;
567 {
568 // talent
569 TalentEntry const* talentEntry = sTalentStore.LookupEntry(id);
570 if (!talentEntry)
571 return 0;
572
573 int32 rank = param1_str ? (uint32)atol(param1_str) : 0;
574 if (rank >= MAX_TALENT_RANK)
575 return 0;
576
577 if (rank < 0)
578 rank = 0;
579
580 return talentEntry->RankID[rank];
581 }
583 case SPELL_LINK_TRADE:
584 return id;
585 case SPELL_LINK_GLYPH:
586 {
587 uint32 glyph_prop_id = param1_str ? (uint32)atol(param1_str) : 0;
588
589 GlyphPropertiesEntry const* glyphPropEntry = sGlyphPropertiesStore.LookupEntry(glyph_prop_id);
590 if (!glyphPropEntry)
591 return 0;
592
593 return glyphPropEntry->SpellId;
594 }
595 }
596
597 // unknown type?
598 return 0;
599}
@ SPELL_LINK_SPELL
Definition: Chat.cpp:530
@ SPELL_LINK_GLYPH
Definition: Chat.cpp:534
@ SPELL_LINK_TALENT
Definition: Chat.cpp:531
@ SPELL_LINK_ENCHANT
Definition: Chat.cpp:532
@ SPELL_LINK_TRADE
Definition: Chat.cpp:533
static char const *const spellKeys[]
Definition: Chat.cpp:537
DBCStorage< TalentEntry > sTalentStore(TalentEntryfmt)
DBCStorage< GlyphPropertiesEntry > sGlyphPropertiesStore(GlyphPropertiesfmt)
#define MAX_TALENT_RANK
Definition: DBCStructure.h:1919
Definition: DBCStructure.h:1012
uint32 SpellId
Definition: DBCStructure.h:1014
Definition: DBCStructure.h:1924
std::array< uint32, MAX_TALENT_RANK > RankID
Definition: DBCStructure.h:1929

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()

char const * ChatHandler::GetAcoreString ( uint32  entry) const
virtual

Reimplemented in CliHandler.

43{
44 return m_session->GetAcoreString(entry);
45}
char const * GetAcoreString(uint32 entry) const
Definition: WorldSession.cpp:820

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(), message_commandscript::HandleWhispersCommand(), list_commandscript::ListAurasCommand(), and SendSysMessage().

◆ GetCreatureFromPlayerMapByDbGuid()

Creature * ChatHandler::GetCreatureFromPlayerMapByDbGuid ( ObjectGuid::LowType  lowguid)
498{
499 if (!m_session)
500 return nullptr;
501
502 // Select the first alive creature or a dead one if not found
503 Creature* creature = nullptr;
504
505 auto bounds = m_session->GetPlayer()->GetMap()->GetCreatureBySpawnIdStore().equal_range(lowguid);
506 for (auto it = bounds.first; it != bounds.second; ++it)
507 {
508 creature = it->second;
509 if (it->second->IsAlive())
510 break;
511 }
512
513 return creature;
514}
Definition: Creature.h:46
Map * GetMap() const
Definition: Object.h:517
CreatureBySpawnIdContainer & GetCreatureBySpawnIdStore()
Definition: Map.h:519
Player * GetPlayer() const
Definition: WorldSession.h:364

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

Referenced by npc_commandscript::HandleNpcSetMoveTypeCommand().

◆ GetNameLink() [1/2]

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

Reimplemented in CliHandler.

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

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::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
800{
801 return playerLink(chr->GetName());
802}
std::string playerLink(std::string const &name) const
Definition: Chat.h:128

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

◆ GetNearbyGameObject()

GameObject * ChatHandler::GetNearbyGameObject ( ) const
485{
486 if (!m_session)
487 return nullptr;
488
489 Player* pl = m_session->GetPlayer();
490 GameObject* obj = nullptr;
494 return obj;
495}
#define SIZE_OF_GRIDS
Definition: MapDefines.h:25
Definition: GameObject.h:122
static void VisitGridObjects(WorldObject const *obj, T &visitor, float radius, bool dont_load=true)
Definition: CellImpl.h:179
Definition: GridNotifiers.h:332
Definition: GridNotifiers.h:700

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

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

◆ GetObjectFromPlayerMapByDbGuid()

◆ GetPlayer()

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

References WorldSession::GetPlayer(), and m_session.

Referenced by Acore::ChatCommands::PlayerIdentifier::FromSelf(), Acore::ChatCommands::PlayerIdentifier::FromTarget(), debug_commandscript::HandleDebugEnterVehicleCommand(), debug_commandscript::HandleDebugGetItemStateCommand(), debug_commandscript::HandleDebugGetItemValueCommand(), debug_commandscript::HandleDebugItemExpireCommand(), 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(), and player_settings_commandscript::HandleSettingsAnnouncerFlags().

◆ GetPlayerGroupAndGUIDByName()

bool ChatHandler::GetPlayerGroupAndGUIDByName ( const char *  cname,
Player *&  player,
Group *&  group,
ObjectGuid guid,
bool  offline = false 
)
838{
839 player = nullptr;
840 guid = ObjectGuid::Empty;
841
842 if (cname)
843 {
844 std::string name = cname;
845 if (!name.empty())
846 {
847 if (!normalizePlayerName(name))
848 {
850 return false;
851 }
852
853 player = ObjectAccessor::FindPlayerByName(name, false);
854 if (offline)
855 {
856 guid = sCharacterCache->GetCharacterGuidByName(name);
857 }
858 }
859 }
860
861 if (player)
862 {
863 group = player->GetGroup();
864 if (!guid || !offline)
865 guid = player->GetGUID();
866 }
867 else
868 {
869 if (getSelectedPlayer())
870 player = getSelectedPlayer();
871 else
872 player = m_session->GetPlayer();
873
874 if (!guid || !offline)
875 guid = player->GetGUID();
876 group = player->GetGroup();
877 }
878
879 return true;
880}
Group * GetGroup()
Definition: Player.h:2431

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
347{
348 if (!m_session)
349 return nullptr;
350
352}
Creature * GetCreatureOrPetOrVehicle(WorldObject const &, ObjectGuid const)
Definition: ObjectAccessor.cpp:237
ObjectGuid GetTarget() const
Definition: Unit.h:2447

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
334{
335 if (!m_session)
336 return nullptr;
337
339
340 if (!guid)
341 return GetNearbyGameObject();
342
344}
Unit * GetUnit(WorldObject const &, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:202
GameObject * GetNearbyGameObject() const
Definition: Chat.cpp:484

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
311{
312 if (!m_session)
313 return nullptr;
314
315 ObjectGuid selected = m_session->GetPlayer()->GetTarget();
316 if (!selected)
317 return m_session->GetPlayer();
318
320}
Player * FindConnectedPlayer(ObjectGuid const guid)
Definition: ObjectAccessor.cpp:260

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
323{
324 if (!m_session)
325 return nullptr;
326
327 if (Unit* selected = m_session->GetPlayer()->GetSelectedUnit())
328 return selected;
329
330 return m_session->GetPlayer();
331}
Unit * GetSelectedUnit() const
Definition: Player.cpp:11454
Definition: Unit.h:1302

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

Referenced by misc_commandscript::HandleAuraCommand(), 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
139{ return m_session; }

Referenced by ticket_commandscript::_HandleGMTicketResponseAppendCommand(), 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(), gm_commandscript::HandleGMOffCommand(), gm_commandscript::HandleGMOnCommand(), ticket_commandscript::HandleGMTicketAssignToCommand(), ticket_commandscript::HandleGMTicketCloseByIdCommand(), ticket_commandscript::HandleGMTicketCommentCommand(), ticket_commandscript::HandleGMTicketCompleteCommand(), ticket_commandscript::HandleGMTicketDeleteByIdCommand(), 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(), 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 
)
54{
55 WorldSession* target_session = nullptr;
56 uint32 target_account = 0;
57
58 if (target)
59 target_session = target->GetSession();
60 else if (guid)
61 target_account = sCharacterCache->GetCharacterAccountIdByGuid(guid);
62
63 if (!target_session && !target_account)
64 {
66 return true;
67 }
68
69 return HasLowerSecurityAccount(target_session, target_account, strong);
70}
bool HasLowerSecurityAccount(WorldSession *target, uint32 account, bool strong=false)
Definition: Chat.cpp:72
WorldSession * GetSession() const
Definition: Player.h:1961
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::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(), and misc_commandscript::HandleUnmuteCommand().

◆ HasLowerSecurityAccount()

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

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()

bool ChatHandler::HasSentErrorMessage ( ) const
inline

◆ IsAvailable()

bool ChatHandler::IsAvailable ( uint32  securityLevel) const
48{
49 // check security level only for simple command (without child commands)
50 return IsConsole() ? true : m_session->GetSecurity() >= AccountTypes(securityLevel);
51}
bool IsConsole() const
Definition: Chat.h:137

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
100{ return true; }

◆ LineFromMessage()

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

Referenced by World::SendGlobalText().

◆ needReportToTarget()

◆ ParseCommands()

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

Reimplemented in CliHandler.

179{
180 ASSERT(!text.empty());
181
182 // chat case (.command or !command format)
183 if ((text[0] != '!') && (text[0] != '.'))
184 return false;
185
186 // ignore single . and ! in line
187 if (text.length() < 2)
188 return false;
189
190 // ignore messages staring from many dots.
191 if (text[1] == text[0])
192 return false;
193
194 // ignore messages with separator after .
196 return false;
197
198 return _ParseCommands(text.substr(1));
199}
static constexpr char COMMAND_DELIMITER
Definition: ChatCommandHelpers.h:38
bool _ParseCommands(std::string_view text)
Definition: Chat.cpp:164

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

◆ PGetParseString()

template<typename... Args>
std::string ChatHandler::PGetParseString ( uint32  entry,
Args &&...  args 
) const
inline
73 {
74 return Acore::StringFormat(GetAcoreString(entry), std::forward<Args>(args)...);
75 }
std::string StringFormat(Format &&fmt, Args &&... args)
Default AC string format function.
Definition: StringFormat.h:30
virtual char const * GetAcoreString(uint32 entry) const
Definition: Chat.cpp:42

References Acore::StringFormat().

Referenced by GmTicket::FormatMessageString(), ticket_commandscript::HandleGMTicketCommentCommand(), and ticket_commandscript::HandleGMTicketCompleteCommand().

◆ playerLink()

◆ PSendSysMessage() [1/2]

template<typename... Args>
void ChatHandler::PSendSysMessage ( char const *  fmt,
Args &&...  args 
)
inline
61 {
62 SendSysMessage(Acore::StringFormat(fmt, std::forward<Args>(args)...).c_str());
63 }

References Acore::StringFormat().

Referenced by ticket_commandscript::_HandleGMTicketResponseAppendCommand(), Player::AddItem(), cast_commandscript::CheckSpellCastResult(), AchievementMgr::CompletedAchievement(), tele_commandscript::DoNameTeleport(), 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(), 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::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::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::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(), 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::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::HandleStringCommand(), misc_commandscript::HandleSummonCommand(), WorldSession::HandleSummonResponseOpcode(), 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(), 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(), Player::PrettyPrintRequirementsAchievementsList(), Player::PrettyPrintRequirementsItemsList(), Player::PrettyPrintRequirementsQuestList(), Player::RewardHonor(), Player::Satisfy(), Acore::Impl::ChatCommands::ChatCommandNode::SendCommandHelp(), Acore::Impl::ChatCommands::ChatCommandNode::SendCommandHelpFor(), BattlegroundQueue::SendJoinMessageArenaQueue(), BattlegroundQueue::SendMessageBGQueue(), Acore::Impl::ChatCommands::ChatCommandNode::TryExecuteCommand(), and Player::Whisper().

◆ PSendSysMessage() [2/2]

template<typename... Args>
void ChatHandler::PSendSysMessage ( uint32  entry,
Args &&...  args 
)
inline
67 {
68 SendSysMessage(PGetParseString(entry, std::forward<Args>(args)...).c_str());
69 }
std::string PGetParseString(uint32 entry, Args &&... args) const
Definition: Chat.h:72

◆ SendErrorMessage() [1/4]

template<typename... Args>
void ChatHandler::SendErrorMessage ( char const *  fmt,
Args &&...  args 
)
inline
82 {
83 PSendSysMessage(fmt, std::forward<Args>(args)...);
85 }
void SetSentErrorMessage(bool val)
Definition: Chat.h:135
void PSendSysMessage(char const *fmt, Args &&... args)
Definition: Chat.h:60

◆ SendErrorMessage() [2/4]

void ChatHandler::SendErrorMessage ( std::string_view  str,
bool  escapeCharacters 
)
159{
160 SendSysMessage(str, escapeCharacters);
162}

References SendSysMessage(), and SetSentErrorMessage().

◆ SendErrorMessage() [3/4]

void ChatHandler::SendErrorMessage ( uint32  entry)
153{
154 SendSysMessage(entry);
156}

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::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(), 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::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(), 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::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
89 {
90 PSendSysMessage(entry, std::forward<Args>(args)...);
92 }

◆ SendGlobalGMSysMessage()

void ChatHandler::SendGlobalGMSysMessage ( const char *  str)
138{
139 WorldPacket data;
140 for (std::string_view line : Acore::Tokenize(str, '\n', true))
141 {
142 BuildChatPacket(data, CHAT_MSG_SYSTEM, LANG_UNIVERSAL, nullptr, nullptr, line);
143 sWorld->SendGlobalGMMessage(&data);
144 }
145}
@ CHAT_MSG_SYSTEM
Definition: SharedDefines.h:3152
@ LANG_UNIVERSAL
Definition: SharedDefines.h:735
std::vector< std::string_view > Tokenize(std::string_view str, char sep, bool keepEmpty)
Definition: Tokenize.cpp:20
Definition: WorldPacket.h:27

References BuildChatPacket(), CHAT_MSG_SYSTEM, LANG_UNIVERSAL, sWorld, 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::HandleGMTicketUnAssignCommand(), reload_commandscript::HandleReloadAchievementCriteriaDataCommand(), reload_commandscript::HandleReloadAchievementRewardCommand(), reload_commandscript::HandleReloadAcoreStringCommand(), reload_commandscript::HandleReloadAllLootCommand(), reload_commandscript::HandleReloadAllQuestCommand(), reload_commandscript::HandleReloadAllScriptsCommand(), 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::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::HandleReloadLocalesQuestGreetingCommand(), 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::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::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)

◆ SendSysMessage() [1/2]

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

Reimplemented in CliHandler.

102{
103 std::string msg{ str };
104
105 // Replace every "|" with "||" in msg
106 if (escapeCharacters && msg.find('|') != std::string::npos)
107 {
108 std::vector<std::string_view> tokens = Acore::Tokenize(msg, '|', true);
109 std::ostringstream stream;
110
111 for (size_t i = 0; i < tokens.size() - 1; ++i)
112 stream << tokens[i] << "||";
113
114 stream << tokens[tokens.size() - 1];
115
116 msg = stream.str();
117 }
118
119 WorldPacket data;
120 for (std::string_view line : Acore::Tokenize(str, '\n', true))
121 {
122 BuildChatPacket(data, CHAT_MSG_SYSTEM, LANG_UNIVERSAL, nullptr, nullptr, line);
123 m_session->SendPacket(&data);
124 }
125}
void SendPacket(WorldPacket const *packet)
Send a packet to the client.
Definition: WorldSession.cpp:212

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

Referenced by extractKeyFromLink(), go_commandscript::GetCreatureData(), go_commandscript::GetGameObjectData(), account_commandscript::HandleAccount2FARemoveCommand(), account_commandscript::HandleAccount2FASetupCommand(), account_commandscript::HandleAccountOnlineListCommand(), account_commandscript::HandleAccountPasswordCommand(), 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::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(), Player::Satisfy(), Acore::Impl::ChatCommands::ChatCommandNode::SendCommandHelp(), Acore::Impl::ChatCommands::ChatCommandNode::SendCommandHelpFor(), 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)
148{
150}

References GetAcoreString(), and SendSysMessage().

◆ SetSentErrorMessage()

Member Data Documentation

◆ m_session

◆ sentErrorMessage

bool ChatHandler::sentErrorMessage
private