66 TC_LOG_ERROR(
"network",
"CHAT: Wrong message type received: {}", type);
73 TC_LOG_ERROR(
"entities.player.cheat",
"CMSG_MESSAGECHAT: Possible hacking-attempt: {} tried to send a message in universal language",
GetPlayerInfo());
96 bool foundAura =
false;
97 for (Unit::AuraEffectList::const_iterator i = langAuras.begin(); i != langAuras.end(); ++i)
99 if ((*i)->GetMiscValue() ==
int32(lang))
131 TC_LOG_ERROR(
"network",
"Player {} {} sent a chatmessage with an invalid language/message type combination",
146 if (!ModLangAuras.empty())
147 lang = ModLangAuras.front()->GetMiscValue();
192 std::string to, channel, msg;
221 if (msg.size() > 255)
252 std::string::size_type pos = msg.find_first_of(
"\n\r");
255 else if (pos != std::string::npos)
262 TC_LOG_ERROR(
"network",
"Player {} {} sent a message containing invalid character {} - blocked",
GetPlayer()->GetName(),
270 auto end = std::unique(msg.begin(), msg.end(), [](
char c1,
char c2) { return (c1 ==
' ') && (c2 ==
' '); });
271 msg.erase(end, msg.end());
516 sScriptMgr->OnPlayerChat(sender, type, lang, msg, chn);
517 chn->Say(sender->
GetGUID(), msg, lang);
542 sScriptMgr->OnPlayerChat(sender, type, lang, msg);
565 sScriptMgr->OnPlayerChat(sender, type, lang, msg);
569 TC_LOG_ERROR(
"network",
"CHAT: unknown message type {}, lang: {}", type, lang);
600 uint32 namlen = name.size();
633 uint32 text_emote, emoteNum;
636 recvData >> text_emote;
637 recvData >> emoteNum;
732 data <<
uint8(restriction);
@ ACHIEVEMENT_CRITERIA_TYPE_DO_EMOTE
DBCStorage< EmotesTextEntry > sEmotesTextStore(EmotesTextEntryfmt)
@ LANG_NOT_LEARNED_LANGUAGE
@ LANG_WAIT_BEFORE_SPEAKING
@ LANG_PLAYER_AFK_DEFAULT
@ LANG_PLAYER_DND_DEFAULT
#define TC_LOG_DEBUG(filterType__,...)
#define TC_LOG_ERROR(filterType__,...)
LanguageDesc const * GetLanguageDescByID(uint32 lang)
bool normalizePlayerName(std::string &name)
#define MAX_CHAT_MSG_TYPE
@ CHAT_MSG_BATTLEGROUND_LEADER
@ SPELL_AURA_COMPREHEND_LANGUAGE
@ SPELL_AURA_MOD_LANGUAGE
std::string secsToTimeString(uint64 timeInSecs, TimeFormat timeFormat, bool hoursOnly)
std::string ReadCString(bool requireValidUtf8=true)
static Channel * GetChannelForPlayerByNamePart(std::string const &namePart, Player *playerSearcher)
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="")
uint8 GetMemberGroup(ObjectGuid guid) const
bool IsAssistant(ObjectGuid guid) const
bool IsLeader(ObjectGuid guid) const
void BroadcastPacket(WorldPacket const *packet, bool ignorePlayersInBGRaid, int group=-1, ObjectGuid ignoredPlayer=ObjectGuid::Empty)
static ObjectGuid GetGUID(Object const *o)
void WhisperAddon(std::string const &text, Player *receiver)
bool IsGameMasterAcceptingWhispers() const
bool IsInWhisperWhiteList(ObjectGuid guid)
void SendDirectMessage(WorldPacket const *data) const
void UpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscValue1=0, uint32 miscValue2=0, WorldObject *ref=nullptr)
Group * GetOriginalGroup() const
WorldSession * GetSession() const
bool HasSkill(uint32 skill) const
ObjectGuid::LowType GetGuildId() const
bool IsGameMaster() const
void UpdateSpeakTime(ChatFloodThrottle::Index index)
void AddWhisperWhiteList(ObjectGuid guid)
bool isAcceptWhispers() const
void Yell(std::string_view text, Language language, WorldObject const *=nullptr) override
Handles yelled message in regular chat based on declared language and in config pre-defined Range.
void Say(std::string_view text, Language language, WorldObject const *=nullptr) override
Handles said message in regular chat based on declared language and in config pre-defined Range.
void TextEmote(std::string_view text, WorldObject const *=nullptr, bool=false) override
Outputs an universal text which is supposed to be an action.
void Whisper(std::string_view text, Language language, Player *receiver, bool=false) override
Handles whispers from Addons and players based on sender, receiver's guid and language.
EmoteChatBuilder(Player const &player, uint32 text_emote, uint32 emote_num, Unit const *target)
void operator()(WorldPacket &data, LocaleConstant loc_idx)
AuraEffectList const & GetAuraEffectsByType(AuraType type) const
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
void SetEmoteState(Emote emote)
bool HasUnitState(const uint32 f) const
void HandleEmoteCommand(Emote emoteId)
std::list< AuraEffect * > AuraEffectList
std::string const & GetName() const
virtual std::string const & GetNameForLocaleIdx(LocaleConstant) const
void Initialize(uint16 opcode, size_t newres=200)
char const * GetTrinityString(uint32 entry) const
void HandleChatIgnoredOpcode(WorldPacket &recvPacket)
void SendPlayerNotFoundNotice(std::string const &name)
void SendPacket(WorldPacket const *packet)
Send a packet to the client.
void SendNotification(const char *format,...) ATTR_PRINTF(2
void HandleTextEmoteOpcode(WorldPacket &recvPacket)
void HandleEmoteOpcode(WorldPackets::Chat::EmoteClient &packet)
std::string GetPlayerInfo() const
Player * GetPlayer() const
void SendPlayerAmbiguousNotice(std::string const &name)
bool HasPermission(uint32 permissionId)
void SendWrongFactionNotice()
void SendChatRestrictedNotice(ChatRestrictionType restriction)
std::unique_ptr< Warden > _warden
void HandleMessagechatOpcode(WorldPacket &recvPacket)
void HandleChannelDeclineInvite(WorldPacket &recvPacket)
bool ValidateHyperlinksAndMaybeKick(std::string const &str)
@ SMSG_CHAT_WRONG_FACTION
@ SMSG_CHAT_PLAYER_NOT_FOUND
@ SMSG_CHAT_PLAYER_AMBIGUOUS
@ CONFIG_CHAT_CHANNEL_LEVEL_REQ
@ CONFIG_CHAT_YELL_LEVEL_REQ
@ CONFIG_CHAT_WHISPER_LEVEL_REQ
@ CONFIG_CHAT_EMOTE_LEVEL_REQ
@ CONFIG_CHAT_SAY_LEVEL_REQ
@ CONFIG_LISTEN_RANGE_TEXTEMOTE
@ CONFIG_CHAT_PARTY_RAID_WARNINGS
@ CONFIG_CHAT_FAKE_MESSAGE_PREVENTING
@ CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP
@ CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD
TC_GAME_API Unit * GetUnit(WorldObject const &, ObjectGuid const &guid)
TC_GAME_API Player * FindConnectedPlayerByName(std::string_view name)
TC_GAME_API Player * FindConnectedPlayer(ObjectGuid const &)
CellCoord ComputeCellCoord(float x, float y)
@ RBAC_PERM_TWO_SIDE_INTERACTION_CHAT
@ RBAC_PERM_CAN_FILTER_WHISPERS
@ RBAC_PERM_SKIP_CHECK_CHAT_CHANNEL_REQ
void Visit(CellCoord const &, TypeContainerVisitor< T, CONTAINER > &visitor, Map &, WorldObject const &obj, float radius) const