diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-04-02 21:44:51 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-04-02 21:44:51 +0300 |
commit | ebde0a771c4e0d2a7ef06de4a39c9ae2ab47bd58 (patch) | |
tree | 03037ed203a45e754c222f70e0f187a24a828c32 /src/net/eathena/chatrecv.cpp | |
parent | 9ea600fb354e7de0b9a66dc065ca039e3f75d7f8 (diff) | |
download | manaplus-ebde0a771c4e0d2a7ef06de4a39c9ae2ab47bd58.tar.gz manaplus-ebde0a771c4e0d2a7ef06de4a39c9ae2ab47bd58.tar.bz2 manaplus-ebde0a771c4e0d2a7ef06de4a39c9ae2ab47bd58.tar.xz manaplus-ebde0a771c4e0d2a7ef06de4a39c9ae2ab47bd58.zip |
Sort more packets. Add version checks inside packets.
Diffstat (limited to 'src/net/eathena/chatrecv.cpp')
-rw-r--r-- | src/net/eathena/chatrecv.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/net/eathena/chatrecv.cpp b/src/net/eathena/chatrecv.cpp index 2eb763cdf..854647749 100644 --- a/src/net/eathena/chatrecv.cpp +++ b/src/net/eathena/chatrecv.cpp @@ -303,9 +303,13 @@ void ChatRecv::processGmChat2(Net::MessageIn &msg) void ChatRecv::processWhisper(Net::MessageIn &msg) { BLOCK_START("ChatRecv::processWhisper") - const int chatMsgLength = msg.readInt16("len") - 32; + int packetLen = 28; + if (msg.getVersion() >= 20091104) + packetLen += 4; + const int chatMsgLength = msg.readInt16("len") - packetLen; std::string nick = msg.readString(24, "nick"); - msg.readInt32("admin flag"); + if (msg.getVersion() >= 20091104) + msg.readInt32("admin flag"); if (chatMsgLength <= 0) { |