From 2fbf7747666bd9c33bc758f28e2d5e255e6abd02 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 2 Sep 2014 01:31:01 +0300 Subject: eathena: add handling packet SMSG_COLOR_MESSAGE 0x02c1. --- src/net/eathena/chathandler.cpp | 11 ++++++++++- 1 file changed, 10 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 63a936164..b1ba52cdf 100644 --- a/src/net/eathena/chathandler.cpp +++ b/src/net/eathena/chathandler.cpp @@ -57,6 +57,7 @@ ChatHandler::ChatHandler() : SMSG_GM_CHAT, SMSG_MVP, // MVP SMSG_IGNORE_ALL_RESPONSE, + SMSG_COLOR_MESSAGE, 0 }; handledMessages = _messages; @@ -83,6 +84,7 @@ void ChatHandler::handleMessage(Net::MessageIn &msg) case SMSG_PLAYER_CHAT: case SMSG_GM_CHAT: + case SMSG_COLOR_MESSAGE: processChat(msg); break; @@ -262,7 +264,14 @@ void ChatHandler::processChat(Net::MessageIn &msg) { BLOCK_START("ChatHandler::processChat") const bool normalChat = msg.getId() == SMSG_PLAYER_CHAT; - int chatMsgLength = msg.readInt16() - 4; + const bool coloredChat = msg.getId() == SMSG_COLOR_MESSAGE; + int chatMsgLength = msg.readInt16("len") - 4; + if (coloredChat) + { + msg.readInt32("unused"); + msg.readInt32("chat color"); + chatMsgLength -= 8; + } if (chatMsgLength <= 0) { BLOCK_END("ChatHandler::processChat") -- cgit v1.2.3-60-g2f50