From ebde0a771c4e0d2a7ef06de4a39c9ae2ab47bd58 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 2 Apr 2016 21:44:51 +0300 Subject: Sort more packets. Add version checks inside packets. --- src/net/eathena/chatrecv.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/net/eathena/chatrecv.cpp') 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) { -- cgit v1.2.3-70-g09d2