From d72a885e0b2c8a2b50a846b5c083fd158078f9c5 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 23 Aug 2015 15:35:00 +0300 Subject: Change protocol version to 5. Add packet SMSG_SCRIPT_MESSAGE (tmwa). --- src/net/tmwa/chathandler.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/net/tmwa/chathandler.cpp') diff --git a/src/net/tmwa/chathandler.cpp b/src/net/tmwa/chathandler.cpp index a11c6149f..78d0f86ab 100644 --- a/src/net/tmwa/chathandler.cpp +++ b/src/net/tmwa/chathandler.cpp @@ -62,6 +62,7 @@ ChatHandler::ChatHandler() : SMSG_GM_CHAT, SMSG_MVP_EFFECT, SMSG_IGNORE_ALL_RESPONSE, + SMSG_SCRIPT_MESSAGE, 0 }; handledMessages = _messages; @@ -103,6 +104,10 @@ void ChatHandler::handleMessage(Net::MessageIn &msg) processIgnoreAllResponse(msg); break; + case SMSG_SCRIPT_MESSAGE: + processScriptMessage(msg); + break; + default: break; } @@ -622,6 +627,14 @@ void ChatHandler::processBeingChat(Net::MessageIn &msg) BLOCK_END("ChatHandler::processBeingChat") } +void ChatHandler::processScriptMessage(Net::MessageIn &msg) +{ + const int sz = msg.readInt16("len") - 5; + msg.readUInt8("message type"); + const std::string message = msg.readString(sz, "message"); + localChatTab->chatLog(message, ChatMsgType::BY_SERVER); +} + void ChatHandler::talkPet(const std::string &restrict text, const std::string &restrict channel) const { -- cgit v1.2.3-70-g09d2