diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-03-22 20:00:55 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-03-22 20:00:55 +0300 |
commit | b44bcbdbaa5eb7f278444b8b48dbe6b8f6345191 (patch) | |
tree | 89a6497e681fe746b626d94e27fd52745b83b498 /src/net/eathena | |
parent | d4b58f6dce665979a615cf5b73521ee37140e1d0 (diff) | |
download | manaplus-b44bcbdbaa5eb7f278444b8b48dbe6b8f6345191.tar.gz manaplus-b44bcbdbaa5eb7f278444b8b48dbe6b8f6345191.tar.bz2 manaplus-b44bcbdbaa5eb7f278444b8b48dbe6b8f6345191.tar.xz manaplus-b44bcbdbaa5eb7f278444b8b48dbe6b8f6345191.zip |
Fix packet version usage for hercules without evol plugin.
Diffstat (limited to 'src/net/eathena')
-rw-r--r-- | src/net/eathena/inventoryrecv.cpp | 39 | ||||
-rw-r--r-- | src/net/eathena/traderecv.cpp | 3 | ||||
-rw-r--r-- | src/net/eathena/vendingrecv.cpp | 6 |
3 files changed, 36 insertions, 12 deletions
diff --git a/src/net/eathena/inventoryrecv.cpp b/src/net/eathena/inventoryrecv.cpp index 8bc93208f..d282af05e 100644 --- a/src/net/eathena/inventoryrecv.cpp +++ b/src/net/eathena/inventoryrecv.cpp @@ -111,10 +111,15 @@ void InventoryRecv::processPlayerEquipment(Net::MessageIn &msg) equipment->setBackend(&Ea::InventoryRecv::mEquips); } int sz; - if (serverVersion >= 8 && packetVersion >= 20150226) + if ((serverVersion >= 8 || serverVersion == 0) && + packetVersion >= 20150226) + { sz = 57; + } else + { sz = 31; + } const int number = (msg.getLength() - 4) / sz; @@ -132,7 +137,8 @@ void InventoryRecv::processPlayerEquipment(Net::MessageIn &msg) msg.readInt32("hire expire date (?)"); msg.readInt16("equip type"); msg.readInt16("item sprite number"); - if (serverVersion >= 8 && packetVersion >= 20150226) + if ((serverVersion >= 8 || serverVersion == 0) && + packetVersion >= 20150226) { msg.readUInt8("rnd count"); for (int f = 0; f < 5; f ++) @@ -196,7 +202,8 @@ void InventoryRecv::processPlayerInventoryAdd(Net::MessageIn &msg) const unsigned char err = msg.readUInt8("result"); msg.readInt32("hire expire date"); msg.readInt16("bind on equip"); - if (serverVersion >= 8 && packetVersion >= 20150226) + if ((serverVersion >= 8 || serverVersion == 0) && + packetVersion >= 20150226) { for (int f = 0; f < 5; f ++) { @@ -503,10 +510,15 @@ void InventoryRecv::processPlayerStorageEquip(Net::MessageIn &msg) BLOCK_START("InventoryRecv::processPlayerStorageEquip") msg.readInt16("len"); int sz; - if (serverVersion >= 8 && packetVersion >= 20150226) + if ((serverVersion >= 8 || serverVersion == 0) && + packetVersion >= 20150226) + { sz = 57; + } else + { sz = 31; + } const int number = (msg.getLength() - 4 - 24) / sz; msg.readString(24, "storage name"); @@ -525,7 +537,8 @@ void InventoryRecv::processPlayerStorageEquip(Net::MessageIn &msg) msg.readInt32("hire expire date"); msg.readInt16("bind on equip"); msg.readInt16("sprite"); - if (serverVersion >= 8 && packetVersion >= 20150226) + if ((serverVersion >= 8 || serverVersion == 0) && + packetVersion >= 20150226) { msg.readUInt8("rnd count"); for (int f = 0; f < 5; f ++) @@ -569,7 +582,8 @@ void InventoryRecv::processPlayerStorageAdd(Net::MessageIn &msg) int cards[maxCards]; for (int f = 0; f < maxCards; f++) cards[f] = msg.readInt16("card"); - if (serverVersion >= 8 && packetVersion >= 20150226) + if ((serverVersion >= 8 || serverVersion == 0) && + packetVersion >= 20150226) { for (int f = 0; f < 5; f ++) { @@ -770,7 +784,8 @@ void InventoryRecv::processPlayerCartAdd(Net::MessageIn &msg) int cards[maxCards]; for (int f = 0; f < maxCards; f++) cards[f] = msg.readInt16("card"); - if (serverVersion >= 8 && packetVersion >= 20150226) + if ((serverVersion >= 8 || serverVersion == 0) && + packetVersion >= 20150226) { for (int f = 0; f < 5; f ++) { @@ -823,10 +838,15 @@ void InventoryRecv::processPlayerCartEquip(Net::MessageIn &msg) BLOCK_START("InventoryRecv::processPlayerCartEquip") msg.readInt16("len"); int sz; - if (serverVersion >= 8 && packetVersion >= 20150226) + if ((serverVersion >= 8 || serverVersion == 0) && + packetVersion >= 20150226) + { sz = 57; + } else + { sz = 31; + } const int number = (msg.getLength() - 4) / sz; for (int loop = 0; loop < number; loop++) @@ -844,7 +864,8 @@ void InventoryRecv::processPlayerCartEquip(Net::MessageIn &msg) msg.readInt32("hire expire date"); msg.readInt16("bind on equip"); msg.readInt16("sprite"); - if (serverVersion >= 8 && packetVersion >= 20150226) + if ((serverVersion >= 8 || serverVersion == 0) && + packetVersion >= 20150226) { msg.readUInt8("rnd count"); for (int f = 0; f < 5; f ++) diff --git a/src/net/eathena/traderecv.cpp b/src/net/eathena/traderecv.cpp index 3d7d51dfe..b77c8af87 100644 --- a/src/net/eathena/traderecv.cpp +++ b/src/net/eathena/traderecv.cpp @@ -80,7 +80,8 @@ void TradeRecv::processTradeItemAdd(Net::MessageIn &msg) int cards[maxCards]; for (int f = 0; f < maxCards; f++) cards[f] = msg.readInt16("card"); - if (serverVersion >= 8 && packetVersion >= 20150226) + if ((serverVersion >= 8 || serverVersion == 0) && + packetVersion >= 20150226) { for (int f = 0; f < 5; f ++) { diff --git a/src/net/eathena/vendingrecv.cpp b/src/net/eathena/vendingrecv.cpp index 0e6c33434..7e088a2b0 100644 --- a/src/net/eathena/vendingrecv.cpp +++ b/src/net/eathena/vendingrecv.cpp @@ -100,7 +100,8 @@ void VendingRecv::processItemsList(Net::MessageIn &msg) msg.readUInt8("refine"); for (int d = 0; d < maxCards; d ++) cards[d] = msg.readInt16("card"); - if (serverVersion >= 8 && packetVersion >= 20150226) + if ((serverVersion >= 8 || serverVersion == 0) && + packetVersion >= 20150226) { for (int d = 0; d < 5; d ++) { @@ -143,7 +144,8 @@ void VendingRecv::processOpen(Net::MessageIn &msg) msg.readUInt8("refine"); for (int d = 0; d < maxCards; d ++) msg.readInt16("card"); - if (serverVersion >= 8 && packetVersion >= 20150226) + if ((serverVersion >= 8 || serverVersion == 0) && + packetVersion >= 20150226) { for (int d = 0; d < 5; d ++) { |