TrinityCore
Loading...
Searching...
No Matches
ChatHandler Class Reference

#include <Chat.h>

+ Inheritance diagram for ChatHandler:

Public Member Functions

bool IsConsole () const
 
WorldSessionGetSession ()
 
WorldSession const * GetSession () const
 
PlayerGetPlayer () const
 
 ChatHandler (WorldSession *session)
 
virtual ~ChatHandler ()
 
virtual char const * GetTrinityString (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
 
bool _ParseCommands (std::string_view text)
 
virtual bool ParseCommands (std::string_view text)
 
void SendGlobalSysMessage (const char *str)
 
virtual bool IsHumanReadable () const
 
virtual bool HasPermission (uint32 permission) 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, bool strong=false)
 
bool HasLowerSecurityAccount (WorldSession *target, uint32 account, bool strong=false)
 
void SendGlobalGMSysMessage (const char *str)
 
PlayergetSelectedPlayer ()
 
CreaturegetSelectedCreature ()
 
UnitgetSelectedUnit ()
 
WorldObjectgetSelectedObject ()
 
PlayergetSelectedPlayerOrSelf ()
 
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)
 
ObjectGuid::LowType extractLowGuidFromLink (char *text, HighGuid &guidHigh)
 
bool GetPlayerGroupAndGUIDByName (char const *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 const *chr) const
 
GameObjectGetNearbyGameObject ()
 
GameObjectGetObjectFromPlayerMapByDbGuid (ObjectGuid::LowType lowguid)
 
CreatureGetCreatureFromPlayerMapByDbGuid (ObjectGuid::LowType lowguid)
 
bool HasSentErrorMessage () const
 
void SetSentErrorMessage (bool val)
 

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)
 
template<typename... Args>
static std::string PGetParseString (std::string_view fmt, Args &&... args)
 
static std::string StringVPrintf (std::string_view messageFormat, fmt::printf_args messageFormatArgs)
 

Protected Member Functions

 ChatHandler ()
 

Private Attributes

WorldSessionm_session
 
bool sentErrorMessage
 

Detailed Description

Definition at line 42 of file Chat.h.

Constructor & Destructor Documentation

◆ ChatHandler() [1/2]

ChatHandler::ChatHandler ( WorldSession session)
inlineexplicit

Definition at line 49 of file Chat.h.

◆ ~ChatHandler()

virtual ChatHandler::~ChatHandler ( )
inlinevirtual

Definition at line 50 of file Chat.h.

◆ ChatHandler() [2/2]

ChatHandler::ChatHandler ( )
inlineexplicitprotected

Definition at line 136 of file Chat.h.

Member Function Documentation

◆ _ParseCommands()

bool ChatHandler::_ParseCommands ( std::string_view  text)

Definition at line 155 of file Chat.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ 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

Definition at line 193 of file Chat.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ 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

Definition at line 273 of file Chat.cpp.

+ Here is the call graph for this function:

◆ extractKeyFromLink() [1/2]

char * ChatHandler::extractKeyFromLink ( char *  text,
char const *const *  linkTypes,
int *  found_idx,
char **  something1 = nullptr 
)

Definition at line 412 of file Chat.cpp.

+ Here is the call graph for this function:

◆ extractKeyFromLink() [2/2]

char * ChatHandler::extractKeyFromLink ( char *  text,
char const *  linkType,
char **  something1 = nullptr 
)

Definition at line 364 of file Chat.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ extractLowGuidFromLink()

ObjectGuid::LowType ChatHandler::extractLowGuidFromLink ( char *  text,
HighGuid guidHigh 
)

Definition at line 530 of file Chat.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ extractPlayerNameFromLink()

std::string ChatHandler::extractPlayerNameFromLink ( char *  text)

Definition at line 575 of file Chat.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ extractPlayerTarget()

bool ChatHandler::extractPlayerTarget ( char *  args,
Player **  player,
ObjectGuid player_guid = nullptr,
std::string *  player_name = nullptr 
)

Definition at line 589 of file Chat.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ extractQuotedArg()

char * ChatHandler::extractQuotedArg ( char *  args)

Definition at line 646 of file Chat.cpp.

+ Here is the caller graph for this function:

◆ GetCreatureFromPlayerMapByDbGuid()

Creature * ChatHandler::GetCreatureFromPlayerMapByDbGuid ( ObjectGuid::LowType  lowguid)

Definition at line 499 of file Chat.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetNameLink() [1/2]

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

Reimplemented in CliHandler.

Definition at line 46 of file Chat.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetNameLink() [2/2]

std::string ChatHandler::GetNameLink ( Player const *  chr) const

Definition at line 702 of file Chat.cpp.

+ Here is the call graph for this function:

◆ GetNearbyGameObject()

GameObject * ChatHandler::GetNearbyGameObject ( )

Definition at line 476 of file Chat.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetObjectFromPlayerMapByDbGuid()

GameObject * ChatHandler::GetObjectFromPlayerMapByDbGuid ( ObjectGuid::LowType  lowguid)

Definition at line 489 of file Chat.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetPlayer()

Player * ChatHandler::GetPlayer ( ) const

Definition at line 34 of file Chat.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetPlayerGroupAndGUIDByName()

bool ChatHandler::GetPlayerGroupAndGUIDByName ( char const *  cname,
Player *&  player,
Group *&  group,
ObjectGuid guid,
bool  offline = false 
)

Definition at line 738 of file Chat.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSelectedCreature()

Creature * ChatHandler::getSelectedCreature ( )

Definition at line 338 of file Chat.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSelectedObject()

WorldObject * ChatHandler::getSelectedObject ( )

Definition at line 325 of file Chat.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSelectedPlayer()

Player * ChatHandler::getSelectedPlayer ( )

Definition at line 302 of file Chat.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSelectedPlayerOrSelf()

Player * ChatHandler::getSelectedPlayerOrSelf ( )

Definition at line 346 of file Chat.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSelectedUnit()

Unit * ChatHandler::getSelectedUnit ( )

Definition at line 314 of file Chat.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetSession() [1/2]

WorldSession * ChatHandler::GetSession ( )
inline

Definition at line 46 of file Chat.h.

◆ GetSession() [2/2]

WorldSession const * ChatHandler::GetSession ( ) const
inline

Definition at line 47 of file Chat.h.

◆ GetSessionDbcLocale()

LocaleConstant ChatHandler::GetSessionDbcLocale ( ) const
virtual

Reimplemented in CliHandler.

Definition at line 692 of file Chat.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetSessionDbLocaleIndex()

int ChatHandler::GetSessionDbLocaleIndex ( ) const
virtual

Reimplemented in CliHandler.

Definition at line 697 of file Chat.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetTrinityString()

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

Reimplemented in CliHandler.

Definition at line 36 of file Chat.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HasLowerSecurity()

bool ChatHandler::HasLowerSecurity ( Player target,
ObjectGuid  guid,
bool  strong = false 
)

Definition at line 51 of file Chat.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HasLowerSecurityAccount()

bool ChatHandler::HasLowerSecurityAccount ( WorldSession target,
uint32  account,
bool  strong = false 
)

Definition at line 71 of file Chat.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HasPermission()

bool ChatHandler::HasPermission ( uint32  permission) const
virtual

Reimplemented in CliHandler.

Definition at line 41 of file Chat.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HasSentErrorMessage()

bool ChatHandler::HasSentErrorMessage ( ) const
inline

Definition at line 133 of file Chat.h.

+ Here is the caller graph for this function:

◆ IsConsole()

bool ChatHandler::IsConsole ( ) const
inline

Definition at line 45 of file Chat.h.

+ Here is the caller graph for this function:

◆ IsHumanReadable()

virtual bool ChatHandler::IsHumanReadable ( ) const
inlinevirtual

Reimplemented in AddonChannelCommandHandler.

Definition at line 100 of file Chat.h.

◆ LineFromMessage()

static char * ChatHandler::LineFromMessage ( char *&  pos)
inlinestatic

Definition at line 60 of file Chat.h.

+ Here is the caller graph for this function:

◆ needReportToTarget()

bool ChatHandler::needReportToTarget ( Player chr) const
virtual

Reimplemented in CliHandler.

Definition at line 686 of file Chat.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ParseCommands()

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

Reimplemented in CliHandler, and AddonChannelCommandHandler.

Definition at line 170 of file Chat.cpp.

+ Here is the call graph for this function:

◆ PGetParseString() [1/2]

template<typename... Args>
static std::string ChatHandler::PGetParseString ( std::string_view  fmt,
Args &&...  args 
)
inlinestatic

Definition at line 81 of file Chat.h.

+ Here is the caller graph for this function:

◆ PGetParseString() [2/2]

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

Definition at line 87 of file Chat.h.

◆ playerLink()

std::string ChatHandler::playerLink ( std::string const &  name) const
inline

Definition at line 127 of file Chat.h.

+ Here is the caller graph for this function:

◆ PSendSysMessage() [1/2]

template<typename... Args>
void ChatHandler::PSendSysMessage ( char const *  fmt,
Args &&...  args 
)
inline

Definition at line 69 of file Chat.h.

◆ PSendSysMessage() [2/2]

template<typename... Args>
void ChatHandler::PSendSysMessage ( uint32  entry,
Args &&...  args 
)
inline

Definition at line 75 of file Chat.h.

◆ SendGlobalGMSysMessage()

void ChatHandler::SendGlobalGMSysMessage ( const char *  str)

Definition at line 135 of file Chat.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SendGlobalSysMessage()

void ChatHandler::SendGlobalSysMessage ( const char *  str)

Definition at line 125 of file Chat.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SendSysMessage() [1/2]

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

Reimplemented in AddonChannelCommandHandler, CliHandler, and AddonChannelCommandHandler.

Definition at line 101 of file Chat.cpp.

+ Here is the call graph for this function:

◆ SendSysMessage() [2/2]

void ChatHandler::SendSysMessage ( uint32  entry)

Definition at line 145 of file Chat.cpp.

+ Here is the call graph for this function:

◆ SetSentErrorMessage()

void ChatHandler::SetSentErrorMessage ( bool  val)
inline

Definition at line 134 of file Chat.h.

◆ StringVPrintf()

std::string ChatHandler::StringVPrintf ( std::string_view  messageFormat,
fmt::printf_args  messageFormatArgs 
)
static

Definition at line 150 of file Chat.cpp.

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_session

WorldSession* ChatHandler::m_session
private

Definition at line 139 of file Chat.h.

◆ sentErrorMessage

bool ChatHandler::sentErrorMessage
private

Definition at line 142 of file Chat.h.


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