diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-04-03 23:31:37 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-04-03 23:31:37 +0300 |
commit | bae0bf20b36f224796af64298f6139365e97b815 (patch) | |
tree | d78fcfa947199c569ec9d03136fae7df0852aeb3 | |
parent | f644bad683cf30f2f98fd6cd911b8bf53e98e01c (diff) | |
download | manaverse-bae0bf20b36f224796af64298f6139365e97b815.tar.gz manaverse-bae0bf20b36f224796af64298f6139365e97b815.tar.bz2 manaverse-bae0bf20b36f224796af64298f6139365e97b815.tar.xz manaverse-bae0bf20b36f224796af64298f6139365e97b815.zip |
Add packet SMSG_PLAYER_CART_ITEMS 0x0123.
-rw-r--r-- | src/net/eathena/inventoryrecv.cpp | 38 | ||||
-rw-r--r-- | src/net/eathena/packetsin.inc | 1 |
2 files changed, 33 insertions, 6 deletions
diff --git a/src/net/eathena/inventoryrecv.cpp b/src/net/eathena/inventoryrecv.cpp index 9a4c83760..c3f752a6d 100644 --- a/src/net/eathena/inventoryrecv.cpp +++ b/src/net/eathena/inventoryrecv.cpp @@ -1057,26 +1057,52 @@ void InventoryRecv::processPlayerCartEquip(Net::MessageIn &msg) void InventoryRecv::processPlayerCartItems(Net::MessageIn &msg) { +//+++ BLOCK_START("InventoryRecv::processPlayerCartItems") Ea::InventoryRecv::mInventoryItems.clear(); msg.readInt16("len"); - const int number = (msg.getLength() - 4) / 23; + int packetLen = 7; + if (msg.getVersion() >= 20120925) + packetLen += 4 + 1; + else + packetLen += 1 + 2; + if (packetVersion >= 5) + packetLen += 8; + if (msg.getVersion() >= 20080102) + packetLen += 4; + + const int number = (msg.getLength() - 4) / packetLen; for (int loop = 0; loop < number; loop++) { const int index = msg.readInt16("item index") - INVENTORY_OFFSET; const int itemId = msg.readInt16("item id"); const ItemTypeT itemType = static_cast<ItemTypeT>( msg.readUInt8("item type")); + if (msg.getVersion() < 20120925) + msg.readUInt8("identified"); const int amount = msg.readInt16("count"); - msg.readInt32("wear state / equip"); + if (msg.getVersion() >= 20120925) + msg.readInt32("wear state / equip"); int cards[maxCards]; - for (int f = 0; f < maxCards; f++) - cards[f] = msg.readInt16("card"); - msg.readInt32("hire expire date (?)"); + if (msg.getVersion() >= 5) + { + for (int f = 0; f < maxCards; f++) + cards[f] = msg.readInt16("card"); + } + else + { + for (int f = 0; f < maxCards; f++) + cards[f] = 0; + } + if (msg.getVersion() >= 20080102) + msg.readInt32("hire expire date (?)"); ItemFlags flags; - flags.byte = msg.readUInt8("flags"); + if (msg.getVersion() >= 20120925) + flags.byte = msg.readUInt8("flags"); + else + flags.byte = 0; mCartItems.push_back(Ea::InventoryItem(index, itemId, diff --git a/src/net/eathena/packetsin.inc b/src/net/eathena/packetsin.inc index 4cbee5ef9..b4ef62394 100644 --- a/src/net/eathena/packetsin.inc +++ b/src/net/eathena/packetsin.inc @@ -46,6 +46,7 @@ packet(SMSG_PLAYER_STATUS_CHANGE, 0x0119, 13, &BeingRecv::processPlaye packet(SMSG_SKILL_DAMAGE, 0x0114, 31, &BeingRecv::processSkillDamage, 1); packet(SMSG_SKILL_ENTRY, 0x011f, 16, &BeingRecv::processSkillEntry, 1); packet(SMSG_PLAYER_CART_EQUIP, 0x0122, -1, &InventoryRecv::processPlayerCartEquip, 1); +packet(SMSG_PLAYER_CART_ITEMS, 0x0123, -1, &InventoryRecv::processPlayerCartItems, 1); packet(SMSG_PLAYER_CART_ADD, 0x0124, 21, &InventoryRecv::processPlayerCartAdd, 1); packet(SMSG_VENDING_ITEMS_LIST, 0x0133, -1, &VendingRecv::processItemsList, 1); packet(SMSG_VENDING_OPEN, 0x0136, -1, &VendingRecv::processOpen, 1); |