summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-04-02 22:45:33 +0300
committerAndrei Karas <akaras@inbox.ru>2016-04-02 22:45:33 +0300
commitc2b28b1860ce02a4e9b9b6694e801de83652440e (patch)
treea075b59576032f724dce86f17825cac59f7b8487 /src
parent3f8ef45a5f6918d2e0e9e25533e77133f0192464 (diff)
downloadplus-c2b28b1860ce02a4e9b9b6694e801de83652440e.tar.gz
plus-c2b28b1860ce02a4e9b9b6694e801de83652440e.tar.bz2
plus-c2b28b1860ce02a4e9b9b6694e801de83652440e.tar.xz
plus-c2b28b1860ce02a4e9b9b6694e801de83652440e.zip
Sort more packets. Add version checks inside packets.
Diffstat (limited to 'src')
-rw-r--r--src/net/eathena/inventoryrecv.cpp12
-rw-r--r--src/net/eathena/packetsin.inc7
2 files changed, 16 insertions, 3 deletions
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<ItemTypeT>(
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