From b4f6ca2ca7b30b91ac019fde42633520ef020218 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Mon, 9 Mar 2026 14:03:07 -0700 Subject: [PATCH] Handle SMSG_SERVER_MESSAGE, SMSG_CHAT_SERVER_MESSAGE, SMSG_AREA_TRIGGER_MESSAGE, SMSG_TRIGGER_CINEMATIC - SMSG_SERVER_MESSAGE: parse type+string, show as [Server] chat message - SMSG_CHAT_SERVER_MESSAGE: parse type+string, show as [Announcement] - SMSG_AREA_TRIGGER_MESSAGE: parse len+string, display as system chat - SMSG_TRIGGER_CINEMATIC: consume silently (no cinematic playback) --- src/game/game_handler.cpp | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/src/game/game_handler.cpp b/src/game/game_handler.cpp index e39a6c74..8fbe0549 100644 --- a/src/game/game_handler.cpp +++ b/src/game/game_handler.cpp @@ -2193,6 +2193,39 @@ void GameHandler::handlePacket(network::Packet& packet) { } break; + case Opcode::SMSG_SERVER_MESSAGE: { + // uint32 type, string message + if (packet.getSize() - packet.getReadPos() >= 4) { + /*uint32_t msgType =*/ packet.readUInt32(); + std::string msg = packet.readString(); + if (!msg.empty()) addSystemChatMessage("[Server] " + msg); + } + break; + } + case Opcode::SMSG_CHAT_SERVER_MESSAGE: { + // uint32 type + string text + if (packet.getSize() - packet.getReadPos() >= 4) { + /*uint32_t msgType =*/ packet.readUInt32(); + std::string msg = packet.readString(); + if (!msg.empty()) addSystemChatMessage("[Announcement] " + msg); + } + break; + } + case Opcode::SMSG_AREA_TRIGGER_MESSAGE: { + // uint32 size, then string + if (packet.getSize() - packet.getReadPos() >= 4) { + /*uint32_t len =*/ packet.readUInt32(); + std::string msg = packet.readString(); + if (!msg.empty()) addSystemChatMessage(msg); + } + break; + } + case Opcode::SMSG_TRIGGER_CINEMATIC: + // uint32 cinematicId — we don't play cinematics; consume and skip. + packet.setReadPos(packet.getSize()); + LOG_DEBUG("SMSG_TRIGGER_CINEMATIC: skipped"); + break; + case Opcode::SMSG_LOOT_MONEY_NOTIFY: { // Format: uint32 money + uint8 soleLooter if (packet.getSize() - packet.getReadPos() >= 4) {