diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-09-02 01:31:01 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-09-06 01:18:55 +0300 |
commit | 2fbf7747666bd9c33bc758f28e2d5e255e6abd02 (patch) | |
tree | fb7d4fa4ad6c225c195f741cf463201fb489855b /src/net | |
parent | 41b5a7c2e41e161aa34579a1271d7a4842f02faf (diff) | |
download | manaverse-2fbf7747666bd9c33bc758f28e2d5e255e6abd02.tar.gz manaverse-2fbf7747666bd9c33bc758f28e2d5e255e6abd02.tar.bz2 manaverse-2fbf7747666bd9c33bc758f28e2d5e255e6abd02.tar.xz manaverse-2fbf7747666bd9c33bc758f28e2d5e255e6abd02.zip |
eathena: add handling packet SMSG_COLOR_MESSAGE 0x02c1.
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/eathena/chathandler.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
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") |