From 5ac1ebb25fd8916c7ee99ad38e0c0297bb1c0178 Mon Sep 17 00:00:00 2001 From: Thorbjørn Lindeijer Date: Thu, 2 May 2024 12:12:37 +0200 Subject: Added handling of SMSG_SCRIPT_MESSAGE These are server chat messages triggered from scripts. In TMW this appears to be used only by the magic system. Added in client protocol version 5 (see issue #71). --- src/net/tmwa/chathandler.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/net/tmwa/chathandler.cpp b/src/net/tmwa/chathandler.cpp index e4a551e6..a1e2d375 100644 --- a/src/net/tmwa/chathandler.cpp +++ b/src/net/tmwa/chathandler.cpp @@ -49,6 +49,7 @@ ChatHandler::ChatHandler() SMSG_WHISPER, SMSG_WHISPER_RESPONSE, SMSG_GM_CHAT, + SMSG_SCRIPT_MESSAGE, 0 }; handledMessages = _messages; @@ -239,6 +240,18 @@ void ChatHandler::handleMessage(MessageIn &msg) } break; } + + case SMSG_SCRIPT_MESSAGE: + { + chatMsgLength = msg.readInt16() - 5; + if (chatMsgLength <= 0) + break; + + msg.readInt8(); // message type + + SERVER_NOTICE(msg.readString(chatMsgLength)) + break; + } } } -- cgit v1.2.3-60-g2f50