fix(Scripts/ChatLogger): Differentiate addon whisper from player whisper (#19441)

* fix(Scripts/ChatLogger): Differentiate addon whisper from player whisper

* closes https://github.com/azerothcore/azerothcore-wotlk/issues/19439
* closes https://github.com/azerothcore/azerothcore-wotlk/issues/17570

* fix build
This commit is contained in:
Kitzunu
2024-07-19 15:26:34 +02:00
committed by GitHub
parent dc11b64b4b
commit 332446b8aa
2 changed files with 28 additions and 3 deletions

View File

@@ -64,10 +64,15 @@ public:
player->GetName(), chatType, lang, msg);
}
void OnChat(Player* player, uint32 /*type*/, uint32 /*lang*/, std::string& msg, Player* receiver) override
void OnChat(Player* player, uint32 /*type*/, uint32 lang, std::string& msg, Player* receiver) override
{
LOG_INFO("chat.whisper", "Player {} tells {}: {}",
player->GetName(), receiver ? receiver->GetName() : "<unknown>", msg);
//! NOTE:
//! LANG_ADDON can only be sent by client in "PARTY", "RAID", "GUILD", "BATTLEGROUND", "WHISPER"
std::string logType = (lang != LANG_ADDON) ? "chat." : "chat.addon.";
std::string msgType = "whisper";
LOG_INFO(logType + msgType, "Player {} {} {}: {}",
player->GetName(), msgType, receiver ? receiver->GetName() : "<unknown>", msg);
}
void OnChat(Player* player, uint32 type, uint32 lang, std::string& msg, Group* group) override