summaryrefslogtreecommitdiff
path: root/src/net/tmwa/chathandler.cpp
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-05-02 12:12:37 +0200
committerThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-06-03 12:30:07 +0200
commitcdf986b813d267b1d31a28400c0ee38d5e485154 (patch)
tree0d4eabb45a803f112ef4205b46efa0715d24c2b0 /src/net/tmwa/chathandler.cpp
parentb8c311b41840f0c7c13b96ecc9faff02f9962165 (diff)
downloadmana-cdf986b813d267b1d31a28400c0ee38d5e485154.tar.gz
mana-cdf986b813d267b1d31a28400c0ee38d5e485154.tar.bz2
mana-cdf986b813d267b1d31a28400c0ee38d5e485154.tar.xz
mana-cdf986b813d267b1d31a28400c0ee38d5e485154.zip
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).
Diffstat (limited to 'src/net/tmwa/chathandler.cpp')
-rw-r--r--src/net/tmwa/chathandler.cpp13
1 files changed, 13 insertions, 0 deletions
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;
+ }
}
}