TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
ChatLogScript Class Reference

Public Member Functions

 ChatLogScript ()
 
void OnChat (Player *player, uint32 type, uint32 lang, std::string &msg) override
 
void OnChat (Player *player, uint32, uint32 lang, std::string &msg, Player *receiver) override
 
void OnChat (Player *player, uint32 type, uint32 lang, std::string &msg, Group *group) override
 
void OnChat (Player *player, uint32 type, uint32 lang, std::string &msg, Guild *guild) override
 
void OnChat (Player *player, uint32, uint32, std::string &msg, Channel *channel) override
 
- Public Member Functions inherited from PlayerScript
virtual void OnPVPKill (Player *, Player *)
 
virtual void OnCreatureKill (Player *, Creature *)
 
virtual void OnPlayerKilledByCreature (Creature *, Player *)
 
virtual void OnLevelChanged (Player *, uint8)
 
virtual void OnFreeTalentPointsChanged (Player *, uint32)
 
virtual void OnTalentsReset (Player *, bool)
 
virtual void OnMoneyChanged (Player *, int64 &)
 
virtual void OnMoneyLimit (Player *, int64)
 
virtual void OnGiveXP (Player *, uint32 &, Unit *)
 
virtual void OnReputationChange (Player *, uint32, int32 &, bool)
 
virtual void OnDuelRequest (Player *, Player *)
 
virtual void OnDuelStart (Player *, Player *)
 
virtual void OnDuelEnd (Player *, Player *, DuelCompleteType)
 
virtual void OnClearEmote (Player *)
 
virtual void OnTextEmote (Player *, uint32, uint32, ObjectGuid)
 
virtual void OnSpellCast (Player *, Spell *, bool)
 
virtual void OnLogin (Player *, bool)
 
virtual void OnLogout (Player *)
 
virtual void OnCreate (Player *)
 
virtual void OnDelete (ObjectGuid, uint32)
 
virtual void OnFailedDelete (ObjectGuid, uint32)
 
virtual void OnSave (Player *)
 
virtual void OnBindToInstance (Player *, Difficulty, uint32, bool, uint8)
 
virtual void OnUpdateZone (Player *, uint32, uint32)
 
virtual void OnMapChanged (Player *)
 
virtual void OnQuestStatusChange (Player *, uint32, QuestStatus)
 
- Public Member Functions inherited from UnitScript
virtual void OnHeal (Unit *, Unit *, uint32 &)
 
virtual void OnDamage (Unit *, Unit *, uint32 &)
 
virtual void ModifyPeriodicDamageAurasTick (Unit *, Unit *, uint32 &)
 
virtual void ModifyMeleeDamage (Unit *, Unit *, uint32 &)
 
virtual void ModifySpellDamageTaken (Unit *, Unit *, int32 &)
 
- Public Member Functions inherited from ScriptObject
const std::string & GetName () const
 

Additional Inherited Members

- Protected Member Functions inherited from PlayerScript
 PlayerScript (const char *name)
 
- Protected Member Functions inherited from UnitScript
 UnitScript (const char *name, bool addToScripts=true)
 
- Protected Member Functions inherited from ScriptObject
 ScriptObject (const char *name)
 
virtual ~ScriptObject ()
 

Constructor & Destructor Documentation

ChatLogScript::ChatLogScript ( )
inline
26 : PlayerScript("ChatLogScript") { }
PlayerScript(const char *name)
Definition: ScriptMgr.cpp:1664

Member Function Documentation

void ChatLogScript::OnChat ( Player player,
uint32  type,
uint32  lang,
std::string &  msg 
)
inlineoverridevirtual

Reimplemented from PlayerScript.

29  {
30  switch (type)
31  {
32  case CHAT_MSG_SAY:
33  TC_LOG_DEBUG("chat.log.say", "Player %s says (language %u): %s",
34  player->GetName().c_str(), lang, msg.c_str());
35  break;
36 
37  case CHAT_MSG_EMOTE:
38  TC_LOG_DEBUG("chat.log.emote", "Player %s emotes: %s",
39  player->GetName().c_str(), msg.c_str());
40  break;
41 
42  case CHAT_MSG_YELL:
43  TC_LOG_DEBUG("chat.log.yell", "Player %s yells (language %u): %s",
44  player->GetName().c_str(), lang, msg.c_str());
45  break;
46  }
47  }
Definition: SharedDefines.h:4241
#define TC_LOG_DEBUG(filterType__,...)
Definition: Log.h:198
Definition: SharedDefines.h:4237
Definition: SharedDefines.h:4232
void ChatLogScript::OnChat ( Player player,
uint32  ,
uint32  lang,
std::string &  msg,
Player receiver 
)
inlineoverridevirtual

Reimplemented from PlayerScript.

50  {
51  if (lang != LANG_ADDON)
52  TC_LOG_DEBUG("chat.log.whisper", "Player %s tells %s: %s",
53  player->GetName().c_str(), receiver ? receiver->GetName().c_str() : "<unknown>", msg.c_str());
54  else
55  TC_LOG_DEBUG("chat.log.addon.whisper", "Player %s tells %s: %s",
56  player->GetName().c_str(), receiver ? receiver->GetName().c_str() : "<unknown>", msg.c_str());
57  }
#define TC_LOG_DEBUG(filterType__,...)
Definition: Log.h:198
Definition: SharedDefines.h:985
void ChatLogScript::OnChat ( Player player,
uint32  type,
uint32  lang,
std::string &  msg,
Group group 
)
inlineoverridevirtual

NOTE: LANG_ADDON can only be sent by client in "PARTY", "RAID", "GUILD", "BATTLEGROUND", "WHISPER"

Reimplemented from PlayerScript.

60  {
63  switch (type)
64  {
65  case CHAT_MSG_PARTY:
66  if (lang != LANG_ADDON)
67  TC_LOG_DEBUG("chat.log.party", "Player %s tells group with leader %s: %s",
68  player->GetName().c_str(), group ? group->GetLeaderName() : "<unknown>", msg.c_str());
69  else
70  TC_LOG_DEBUG("chat.log.addon.party", "Player %s tells group with leader %s: %s",
71  player->GetName().c_str(), group ? group->GetLeaderName() : "<unknown>", msg.c_str());
72  break;
73 
75  TC_LOG_DEBUG("chat.log.party", "Leader %s tells group: %s",
76  player->GetName().c_str(), msg.c_str());
77  break;
78 
79  case CHAT_MSG_RAID:
80  if (lang != LANG_ADDON)
81  TC_LOG_DEBUG("chat.log.raid", "Player %s tells raid with leader %s: %s",
82  player->GetName().c_str(), group ? group->GetLeaderName() : "<unknown>", msg.c_str());
83  else
84  TC_LOG_DEBUG("chat.log.addon.raid", "Player %s tells raid with leader %s: %s",
85  player->GetName().c_str(), group ? group->GetLeaderName() : "<unknown>", msg.c_str());
86  break;
87 
89  TC_LOG_DEBUG("chat.log.raid", "Leader player %s tells raid: %s",
90  player->GetName().c_str(), msg.c_str());
91  break;
92 
94  TC_LOG_DEBUG("chat.log.raid", "Leader player %s warns raid with: %s",
95  player->GetName().c_str(), msg.c_str());
96  break;
97 
99  if (lang != LANG_ADDON)
100  TC_LOG_DEBUG("chat.log.bg", "Player %s tells instance with leader %s: %s",
101  player->GetName().c_str(), group ? group->GetLeaderName() : "<unknown>", msg.c_str());
102  else
103  TC_LOG_DEBUG("chat.log.addon.bg", "Player %s tells instance with leader %s: %s",
104  player->GetName().c_str(), group ? group->GetLeaderName() : "<unknown>", msg.c_str());
105  break;
106 
108  TC_LOG_DEBUG("chat.log.bg", "Leader player %s tells instance: %s",
109  player->GetName().c_str(), msg.c_str());
110  break;
111  }
112  }
Definition: SharedDefines.h:4234
Definition: SharedDefines.h:4280
#define TC_LOG_DEBUG(filterType__,...)
Definition: Log.h:198
Definition: SharedDefines.h:4271
Definition: SharedDefines.h:4298
Definition: SharedDefines.h:4233
Definition: SharedDefines.h:4270
const char * GetLeaderName() const
Definition: Group.cpp:2539
Definition: SharedDefines.h:4297
Definition: SharedDefines.h:985

+ Here is the call graph for this function:

void ChatLogScript::OnChat ( Player player,
uint32  type,
uint32  lang,
std::string &  msg,
Guild guild 
)
inlineoverridevirtual

Reimplemented from PlayerScript.

115  {
116  switch (type)
117  {
118  case CHAT_MSG_GUILD:
119  if (lang != LANG_ADDON)
120  TC_LOG_DEBUG("chat.log.guild", "Player %s tells guild %s: %s",
121  player->GetName().c_str(), guild ? guild->GetName().c_str() : "<unknown>", msg.c_str());
122  else
123  TC_LOG_DEBUG("chat.log.addon.guild", "Player %s sends to guild %s: %s",
124  player->GetName().c_str(), guild ? guild->GetName().c_str() : "<unknown>", msg.c_str());
125  break;
126 
127  case CHAT_MSG_OFFICER:
128  TC_LOG_DEBUG("chat.log.guild.officer", "Player %s tells guild %s officers: %s",
129  player->GetName().c_str(), guild ? guild->GetName().c_str() : "<unknown>", msg.c_str());
130  break;
131  }
132  }
std::string const & GetName() const
Definition: Guild.h:766
#define TC_LOG_DEBUG(filterType__,...)
Definition: Log.h:198
Definition: SharedDefines.h:4236
Definition: SharedDefines.h:4235
Definition: SharedDefines.h:985

+ Here is the call graph for this function:

void ChatLogScript::OnChat ( Player player,
uint32  ,
uint32  ,
std::string &  msg,
Channel channel 
)
inlineoverridevirtual

Reimplemented from PlayerScript.

135  {
136  bool isSystem = channel &&
137  (channel->HasFlag(CHANNEL_FLAG_TRADE) ||
138  channel->HasFlag(CHANNEL_FLAG_GENERAL) ||
139  channel->HasFlag(CHANNEL_FLAG_CITY) ||
140  channel->HasFlag(CHANNEL_FLAG_LFG));
141 
142  if (isSystem)
143  TC_LOG_DEBUG("chat.log.system", "Player %s tells channel %s: %s",
144  player->GetName().c_str(), channel->GetName().c_str(), msg.c_str());
145  else
146  {
147  std::string channelName = channel ? channel->GetName() : "<unknown>";
148  TC_LOG_DEBUG("chat.log.channel." + channelName, "Player %s tells channel %s: %s",
149  player->GetName().c_str(), channelName.c_str(), msg.c_str());
150  }
151  }
#define TC_LOG_DEBUG(filterType__,...)
Definition: Log.h:198
Definition: Channel.h:89
bool HasFlag(uint8 flag) const
Definition: Channel.h:181
Definition: Channel.h:88
Definition: Channel.h:85
Definition: Channel.h:87
std::string const & GetName() const
Definition: Channel.h:171

+ Here is the call graph for this function:


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