From c2b28b1860ce02a4e9b9b6694e801de83652440e Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 2 Apr 2016 22:45:33 +0300 Subject: Sort more packets. Add version checks inside packets. --- src/net/eathena/inventoryrecv.cpp | 12 +++++++++--- src/net/eathena/packetsin.inc | 7 +++++++ 2 files changed, 16 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/net/eathena/inventoryrecv.cpp b/src/net/eathena/inventoryrecv.cpp index 8a809c825..9587da970 100644 --- a/src/net/eathena/inventoryrecv.cpp +++ b/src/net/eathena/inventoryrecv.cpp @@ -198,12 +198,18 @@ void InventoryRecv::processPlayerInventoryAdd(Net::MessageIn &msg) int cards[maxCards]; for (int f = 0; f < maxCards; f++) cards[f] = msg.readInt16("card"); - const int equipType = msg.readInt32("location"); + int equipType; + if (msg.getVersion() >= 20120925) + equipType = msg.readInt32("location"); + else + equipType = msg.readInt16("location"); const ItemTypeT itemType = static_cast( msg.readUInt8("item type")); const unsigned char err = msg.readUInt8("result"); - msg.readInt32("hire expire date"); - msg.readInt16("bind on equip"); + if (msg.getVersion() >= 20061218) + msg.readInt32("hire expire date"); + if (msg.getVersion() >= 20071002) + msg.readInt16("bind on equip"); if ((serverVersion >= 8 || serverVersion == 0) && msg.getVersion() >= 20150226) { diff --git a/src/net/eathena/packetsin.inc b/src/net/eathena/packetsin.inc index 59d771b8a..d8256e53e 100644 --- a/src/net/eathena/packetsin.inc +++ b/src/net/eathena/packetsin.inc @@ -383,6 +383,12 @@ if (packetVersion >= 20060424) packet(SMSG_MERCENARY_UPDATE, 0x02a2, 8, &MercenaryRecv::processMercenaryUpdate, 20060424); } +// 20061218 +if (packetVersion >= 20061218) +{ + packet(SMSG_PLAYER_INVENTORY_ADD, 0x029a, 27, &InventoryRecv::processPlayerInventoryAdd, 20061218); +} + // 20070227 if (packetVersion >= 20070227) { @@ -416,6 +422,7 @@ if (packetVersion >= 20071002) packet(SMSG_PLAYER_CART_ITEMS, 0x01ef, -1, &InventoryRecv::processPlayerCartItems, 20071002); packet(SMSG_PLAYER_STORAGE_ITEMS, 0x0295, -1, &InventoryRecv::processPlayerStorage, 20071002); packet(SMSG_PARTY_ITEM_PICKUP, 0x02b8, 22, &PartyRecv::processPartyItemPickup, 20071002); + packet(SMSG_PLAYER_INVENTORY_ADD, 0x02d4, 29, &InventoryRecv::processPlayerInventoryAdd, 20071002); } // 20071023 -- cgit v1.2.3-60-g2f50