diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-09-06 19:42:23 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-09-06 19:42:23 +0300 |
commit | bd194dcc0f06959322253c91761a93d53c468ca0 (patch) | |
tree | 1e284da05159c77c63795ddda0d4bfbba3501f5a /src/net | |
parent | 0d990d032d98ea26da479b6378087d0d7dd2a91e (diff) | |
download | manaplus-bd194dcc0f06959322253c91761a93d53c468ca0.tar.gz manaplus-bd194dcc0f06959322253c91761a93d53c468ca0.tar.bz2 manaplus-bd194dcc0f06959322253c91761a93d53c468ca0.tar.xz manaplus-bd194dcc0f06959322253c91761a93d53c468ca0.zip |
eathena: fix packet SMSG_PLAYER_STORAGE_EQUIP 0x0996.
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/eathena/inventoryhandler.cpp | 45 | ||||
-rw-r--r-- | src/net/eathena/packets.h | 2 | ||||
-rw-r--r-- | src/net/eathena/protocol.h | 2 |
3 files changed, 21 insertions, 28 deletions
diff --git a/src/net/eathena/inventoryhandler.cpp b/src/net/eathena/inventoryhandler.cpp index 63cf388c9..bcef71974 100644 --- a/src/net/eathena/inventoryhandler.cpp +++ b/src/net/eathena/inventoryhandler.cpp @@ -460,37 +460,30 @@ void InventoryHandler::processPlayerInventoryRemove2(Net::MessageIn &msg) void InventoryHandler::processPlayerStorageEquip(Net::MessageIn &msg) { BLOCK_START("InventoryHandler::processPlayerStorageEquip") - msg.readInt16(); // length - const int number = (msg.getLength() - 4) / 20; + msg.readInt16("len"); + const int number = (msg.getLength() - 4 - 24) / 31; + msg.readString(24, "storage name"); for (int loop = 0; loop < number; loop++) { - int cards[4]; - const int index = msg.readInt16() - STORAGE_OFFSET; - const int itemId = msg.readInt16(); - const uint8_t itemType = msg.readUInt8(); - uint8_t identified = msg.readUInt8(); + const int index = msg.readInt16("index") - STORAGE_OFFSET; + const int itemId = msg.readInt16("item id"); + msg.readUInt8("item type"); const int amount = 1; - msg.readInt16(); // Equip Point? - msg.readInt16(); // Another Equip Point? - msg.readUInt8(); // Attribute (broken) - const uint8_t refine = msg.readUInt8(); - for (int i = 0; i < 4; i++) - cards[i] = msg.readInt16(); - - if (mDebugInventory) - { - logger->log("Index: %d, ID: %d, Type: %d, Identified: %u, " - "Qty: %d, Cards: %d, %d, %d, %d, Refine: %u", - index, itemId, itemType, - static_cast<unsigned int>(identified), amount, - cards[0], cards[1], cards[2], cards[3], - static_cast<unsigned int>(refine)); - } - - if (serverVersion < 1 && identified > 1U) - identified = 1U; + msg.readInt32("location"); + msg.readInt32("wear state"); + const uint8_t refine = msg.readUInt8("refine level"); + msg.readInt16("card0"); + msg.readInt16("card1"); + msg.readInt16("card2"); + msg.readInt16("card3"); + msg.readInt32("hire expire date"); + msg.readInt16("bind on equip"); + msg.readInt16("sprite"); + msg.readInt8("flags"); + // need get identified from flags + uint8_t identified = 1; mInventoryItems.push_back(Ea::InventoryItem(index, itemId, amount, refine, identified, false)); } diff --git a/src/net/eathena/packets.h b/src/net/eathena/packets.h index b9bd143f3..f3d9d3c11 100644 --- a/src/net/eathena/packets.h +++ b/src/net/eathena/packets.h @@ -248,7 +248,7 @@ int16_t packet_lengths[] = 31, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, // #0x0980 0, 0, 0, 29, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 31, -1, -1, 0, 0, 0, 0, 0, 0, 11, 9, 8, 0, 0, 0, 0, + 31, -1, -1, 0, 0, 0, -1, 0, 0, 11, 9, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // #0x09C0 diff --git a/src/net/eathena/protocol.h b/src/net/eathena/protocol.h index ba435aa10..9c2f25d43 100644 --- a/src/net/eathena/protocol.h +++ b/src/net/eathena/protocol.h @@ -151,7 +151,7 @@ #define SMSG_PARTY_INVITATION_STATS 0x02c9 #define SMSG_PLAYER_STORAGE_ITEMS 0x01f0 /**< Item list for storage */ -#define SMSG_PLAYER_STORAGE_EQUIP 0x00a6 /**< Equipment list for storage */ +#define SMSG_PLAYER_STORAGE_EQUIP 0x0996 /**< Equipment list for storage */ #define SMSG_PLAYER_STORAGE_STATUS 0x00f2 /**< Slots used and total slots */ #define SMSG_PLAYER_STORAGE_ADD 0x00f4 /**< Add item/equip to storage */ // Remove item/equip from storage |