diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-04-02 21:25:09 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-04-02 21:25:09 +0300 |
commit | 9ea600fb354e7de0b9a66dc065ca039e3f75d7f8 (patch) | |
tree | a94ca9bfd4ec2c0f671892bb5645abf8cb15e760 /src/net/eathena/vendingrecv.cpp | |
parent | 0ab403f92f7827afc45c4e07d3527a405e2e88e8 (diff) | |
download | manaplus-9ea600fb354e7de0b9a66dc065ca039e3f75d7f8.tar.gz manaplus-9ea600fb354e7de0b9a66dc065ca039e3f75d7f8.tar.bz2 manaplus-9ea600fb354e7de0b9a66dc065ca039e3f75d7f8.tar.xz manaplus-9ea600fb354e7de0b9a66dc065ca039e3f75d7f8.zip |
Sort more packets. Add version checks inside packets.
Diffstat (limited to 'src/net/eathena/vendingrecv.cpp')
-rw-r--r-- | src/net/eathena/vendingrecv.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/net/eathena/vendingrecv.cpp b/src/net/eathena/vendingrecv.cpp index 3b3b000e5..4c609a766 100644 --- a/src/net/eathena/vendingrecv.cpp +++ b/src/net/eathena/vendingrecv.cpp @@ -143,7 +143,14 @@ void VendingRecv::processBuyAck(Net::MessageIn &msg) void VendingRecv::processOpen(Net::MessageIn &msg) { - const int count = (msg.readInt16("len") - 8) / 22; + int packetLen = 22; + if ((serverVersion >= 8 || serverVersion == 0) && + msg.getVersion() >= 20150226) + { + packetLen += 25; + } + + const int count = (msg.readInt16("len") - 8) / packetLen; msg.readInt32("id"); for (int f = 0; f < count; f ++) { @@ -159,7 +166,7 @@ void VendingRecv::processOpen(Net::MessageIn &msg) msg.readInt16("card"); // ++ need change to msg.getVersion() if ((serverVersion >= 8 || serverVersion == 0) && - packetVersion >= 20150226) + msg.getVersion() >= 20150226) { for (int d = 0; d < 5; d ++) { |