mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-28 09:33:52 +00:00
feat: fire CHAT_MSG_* events for all incoming chat messages
The SMSG_MESSAGECHAT handler stored messages in chatHistory and
triggered chat bubbles, but never fired Lua addon events. Chat frame
addons (Prat, Chatter, WIM) and the default ChatFrame all register for
CHAT_MSG_SAY, CHAT_MSG_WHISPER, CHAT_MSG_PARTY, CHAT_MSG_GUILD, etc.
to display incoming messages.
Now fires CHAT_MSG_{type} for every incoming message with the full WoW
event signature: message, senderName, language, channelName, displayName,
specialFlags, zoneChannelID, channelIndex, channelBaseName, unused,
lineID, and senderGUID. Covers all chat types: SAY, YELL, WHISPER,
PARTY, RAID, GUILD, OFFICER, CHANNEL, EMOTE, SYSTEM, MONSTER_SAY, etc.
This commit is contained in:
parent
7425881e98
commit
f37a83fc52
1 changed files with 25 additions and 0 deletions
|
|
@ -13468,6 +13468,31 @@ void GameHandler::handleMessageChat(network::Packet& packet) {
|
|||
}
|
||||
|
||||
LOG_DEBUG("[", getChatTypeString(data.type), "] ", channelInfo, senderInfo, ": ", data.message);
|
||||
|
||||
// Fire CHAT_MSG_* addon events so Lua chat frames and addons receive messages.
|
||||
// WoW event args: message, senderName, language, channelName
|
||||
if (addonEventCallback_) {
|
||||
std::string eventName = "CHAT_MSG_";
|
||||
eventName += getChatTypeString(data.type);
|
||||
std::string lang = std::to_string(static_cast<int>(data.language));
|
||||
// Format sender GUID as hex string for addons that need it
|
||||
char guidBuf[32];
|
||||
snprintf(guidBuf, sizeof(guidBuf), "0x%016llX", (unsigned long long)data.senderGuid);
|
||||
addonEventCallback_(eventName, {
|
||||
data.message,
|
||||
data.senderName,
|
||||
lang,
|
||||
data.channelName,
|
||||
senderInfo, // arg5: displayName
|
||||
"", // arg6: specialFlags
|
||||
"0", // arg7: zoneChannelID
|
||||
"0", // arg8: channelIndex
|
||||
"", // arg9: channelBaseName
|
||||
"0", // arg10: unused
|
||||
"0", // arg11: lineID
|
||||
guidBuf // arg12: senderGUID
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
void GameHandler::sendTextEmote(uint32_t textEmoteId, uint64_t targetGuid) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue