summaryrefslogtreecommitdiff
path: root/src/net/tmwa/chathandler.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-08-23 15:35:00 +0300
committerAndrei Karas <akaras@inbox.ru>2015-08-23 15:35:00 +0300
commitd72a885e0b2c8a2b50a846b5c083fd158078f9c5 (patch)
treee44902674ed2548c21a61eb1d7b407e54270c407 /src/net/tmwa/chathandler.cpp
parentf628081eaf70d48102ce64f6cc0f2337e2f97b78 (diff)
downloadplus-d72a885e0b2c8a2b50a846b5c083fd158078f9c5.tar.gz
plus-d72a885e0b2c8a2b50a846b5c083fd158078f9c5.tar.bz2
plus-d72a885e0b2c8a2b50a846b5c083fd158078f9c5.tar.xz
plus-d72a885e0b2c8a2b50a846b5c083fd158078f9c5.zip
Change protocol version to 5. Add packet SMSG_SCRIPT_MESSAGE (tmwa).
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 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
{