From be425c94dc69bc98f2aeb2b1e4f27868ccae075c Mon Sep 17 00:00:00 2001 From: Kelsi Date: Sat, 14 Feb 2026 14:37:53 -0800 Subject: [PATCH] Fix SMSG_MESSAGECHAT parser missing receiverGuid for most chat types The parser was not reading the uint64 receiverGuid that WoW 3.3.5 sends for SAY/GUILD/PARTY/YELL/WHISPER/RAID/etc types, causing all incoming chat from other players to misparse (blank messages, wrong type displayed). Also fix TEXT_EMOTE display to not prepend "You " for incoming emotes from other players, and fix CHANNEL/ACHIEVEMENT types to read the correct receiverGuid field. --- src/game/world_packets.cpp | 22 ++++++++++------------ src/ui/game_screen.cpp | 3 ++- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/src/game/world_packets.cpp b/src/game/world_packets.cpp index d36518f9..982b3d7f 100644 --- a/src/game/world_packets.cpp +++ b/src/game/world_packets.cpp @@ -1184,6 +1184,8 @@ bool MessageChatParser::parse(network::Packet& packet, MessageChatData& data) { packet.readUInt32(); // Type-specific data + // WoW 3.3.5 SMSG_MESSAGECHAT format: after senderGuid+unk, most types + // have a receiverGuid (uint64). Some types have extra fields before it. switch (data.type) { case ChatType::MONSTER_SAY: case ChatType::MONSTER_YELL: @@ -1196,33 +1198,29 @@ bool MessageChatParser::parse(network::Packet& packet, MessageChatData& data) { data.senderName[i] = static_cast(packet.readUInt8()); } } - - // Read receiver GUID (usually 0 for monsters) + // Read receiver GUID data.receiverGuid = packet.readUInt64(); break; } - case ChatType::WHISPER_INFORM: { - // Read receiver name - data.receiverName = packet.readString(); - break; - } - case ChatType::CHANNEL: { - // Read channel name + // Read channel name, then receiver GUID data.channelName = packet.readString(); + data.receiverGuid = packet.readUInt64(); break; } case ChatType::ACHIEVEMENT: case ChatType::GUILD_ACHIEVEMENT: { - // Read achievement ID - packet.readUInt32(); + // Read target GUID + data.receiverGuid = packet.readUInt64(); break; } default: - // No additional data for most types + // SAY, GUILD, PARTY, YELL, WHISPER, WHISPER_INFORM, RAID, etc. + // All have receiverGuid (typically senderGuid repeated) + data.receiverGuid = packet.readUInt64(); break; } diff --git a/src/ui/game_screen.cpp b/src/ui/game_screen.cpp index fbc3ae0c..fcee6d61 100644 --- a/src/ui/game_screen.cpp +++ b/src/ui/game_screen.cpp @@ -627,7 +627,8 @@ void GameScreen::renderChatWindow(game::GameHandler& gameHandler) { if (msg.type == game::ChatType::SYSTEM) { renderTextWithLinks(msg.message, color); } else if (msg.type == game::ChatType::TEXT_EMOTE) { - std::string full = "You " + msg.message; + // Local emotes (senderGuid==0) need "You " prefix; incoming already have sender name + std::string full = (msg.senderGuid == 0) ? ("You " + msg.message) : msg.message; renderTextWithLinks(full, color); } else if (!msg.senderName.empty()) { if (msg.type == game::ChatType::MONSTER_SAY || msg.type == game::ChatType::MONSTER_YELL) {