From 564fa0de49a384284868eaddbbdb9f87c58a3661 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 13 Sep 2014 23:37:15 +0300 Subject: eathena: add partial support for packet SMSG_FORMAT_MESSAGE_NUMBER 0x07e2. --- src/net/eathena/chathandler.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src/net/eathena/chathandler.cpp') diff --git a/src/net/eathena/chathandler.cpp b/src/net/eathena/chathandler.cpp index df1c45155..1e5d343e7 100644 --- a/src/net/eathena/chathandler.cpp +++ b/src/net/eathena/chathandler.cpp @@ -61,6 +61,7 @@ ChatHandler::ChatHandler() : SMSG_COLOR_MESSAGE, SMSG_CHAT_IGNORE_LIST, SMSG_FORMAT_MESSAGE, + SMSG_FORMAT_MESSAGE_NUMBER, 0 }; handledMessages = _messages; @@ -93,6 +94,10 @@ void ChatHandler::handleMessage(Net::MessageIn &msg) processFormatMessage(msg); break; + case SMSG_FORMAT_MESSAGE_NUMBER: + processFormatMessageNumber(msg); + break; + case SMSG_COLOR_MESSAGE: processColorChat(msg); break; @@ -286,13 +291,22 @@ void ChatHandler::processChat(Net::MessageIn &msg) void ChatHandler::processFormatMessage(Net::MessageIn &msg) { - BLOCK_START("ChatHandler::processChat") int msgId = msg.readInt16("msg id"); // +++ here need load message from configuration file const std::string chatMsg = strprintf("Message #%d", msgId); processChatContinue(chatMsg); } +void ChatHandler::processFormatMessageNumber(Net::MessageIn &msg) +{ + int msgId = msg.readInt16("msg id"); + int value = msg.readInt32("value"); + // +++ here need load message from configuration file + const std::string chatMsg = strprintf( + "Message #%d, value: %d", msgId, value); + processChatContinue(chatMsg); +} + void ChatHandler::processColorChat(Net::MessageIn &msg) { BLOCK_START("ChatHandler::processChat") -- cgit v1.2.3-70-g09d2