diff options
Diffstat (limited to 'src/net/eathena/chathandler.cpp')
-rw-r--r-- | src/net/eathena/chathandler.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
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") |