diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-09-03 20:04:28 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-09-06 01:18:56 +0300 |
commit | db1548f44fb972c0c60b742dfece7e1f442e0378 (patch) | |
tree | 8edc5a23f78c17afa2ae7f271af3c6b32b264bf6 /src/net | |
parent | 28741b7ba3eea91a80fef6e1b2e57553c67bf6ea (diff) | |
download | ManaVerse-db1548f44fb972c0c60b742dfece7e1f442e0378.tar.gz ManaVerse-db1548f44fb972c0c60b742dfece7e1f442e0378.tar.bz2 ManaVerse-db1548f44fb972c0c60b742dfece7e1f442e0378.tar.xz ManaVerse-db1548f44fb972c0c60b742dfece7e1f442e0378.zip |
eathena: fix a bit support for packet SMSG_PLAYER_INVENTORY 0x0991.
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/ea/eaprotocol.h | 1 | ||||
-rw-r--r-- | src/net/eathena/inventoryhandler.cpp | 42 | ||||
-rw-r--r-- | src/net/eathena/packets.h | 2 | ||||
-rw-r--r-- | src/net/eathena/protocol.h | 2 |
4 files changed, 20 insertions, 27 deletions
diff --git a/src/net/ea/eaprotocol.h b/src/net/ea/eaprotocol.h index 153a59a86..226bb7401 100644 --- a/src/net/ea/eaprotocol.h +++ b/src/net/ea/eaprotocol.h @@ -70,7 +70,6 @@ static const int STORAGE_OFFSET = 1; #define SMSG_PLAYER_CHAT 0x008e /**< Player talks */ #define SMSG_PLAYER_CHAT2 0x0224 /**< Player talks */ -#define SMSG_PLAYER_INVENTORY 0x01ee #define SMSG_CHAR_CREATE_SUCCEEDED2 0x0221 #define SMSG_BEING_CHAT2 0x0223 /**< A being talks in channels */ diff --git a/src/net/eathena/inventoryhandler.cpp b/src/net/eathena/inventoryhandler.cpp index 6567eedc2..1d32cda58 100644 --- a/src/net/eathena/inventoryhandler.cpp +++ b/src/net/eathena/inventoryhandler.cpp @@ -351,42 +351,36 @@ void InventoryHandler::processPlayerInventory(Net::MessageIn &msg) mInventoryItems.clear(); } - msg.readInt16(); // length - const int number = (msg.getLength() - 4) / 18; + msg.readInt16("len"); + const int number = (msg.getLength() - 4) / 23; for (int loop = 0; loop < number; loop++) { - int cards[4]; - const int index = msg.readInt16() - (playerInvintory + const int index = msg.readInt16("item index") - (playerInvintory ? INVENTORY_OFFSET : STORAGE_OFFSET); - const int itemId = msg.readInt16(); - const uint8_t itemType = msg.readUInt8(); - uint8_t identified = msg.readUInt8(); - const int amount = msg.readInt16(); - const int arrow = msg.readInt16(); - for (int i = 0; i < 4; i++) - cards[i] = msg.readInt16(); - - if (mDebugInventory) - { - logger->log("Index: %d, ID: %d, Type: %d, Identified: %d, " - "Qty: %d, Cards: %d, %d, %d, %d", - index, itemId, itemType, identified, amount, - cards[0], cards[1], cards[2], cards[3]); - } - - if (serverVersion < 1 && identified > 1) - identified = 1; + const int itemId = msg.readInt16("item id"); + const uint8_t itemType = msg.readUInt8("item type"); + const int amount = msg.readInt16("count"); + msg.readInt16("count"); + msg.readInt16("wear state / equip"); + msg.readInt16("card0"); + msg.readInt16("card1"); + msg.readInt16("card2"); + msg.readInt16("card3"); + msg.readInt32("hire expire date (?)"); + msg.readInt8("flags"); + // need get actual identify flag + uint8_t identified = 1; if (playerInvintory) { // Trick because arrows are not considered equipment - const bool isEquipment = arrow & 0x8000; +// const bool isEquipment = arrow & 0x8000; if (inventory) { inventory->setItem(index, itemId, amount, - 0, identified, isEquipment); + 0, identified, false); } } else diff --git a/src/net/eathena/packets.h b/src/net/eathena/packets.h index ac52ebc5f..103c311fe 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, // #0x0980 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 31, -1, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, + 0, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 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 45c7e9592..449fe0d48 100644 --- a/src/net/eathena/protocol.h +++ b/src/net/eathena/protocol.h @@ -68,7 +68,7 @@ #define SMSG_PLAYER_GET_EXP 0x07f6 #define SMSG_WHO_ANSWER 0x00c2 #define SMSG_PLAYER_WARP 0x0091 /**< Warp player to map/location */ -#define SMSG_PLAYER_INVENTORY 0x01ee +#define SMSG_PLAYER_INVENTORY 0x0991 #define SMSG_PLAYER_INVENTORY_ADD 0x0990 #define SMSG_PLAYER_INVENTORY_REMOVE 0x00af #define SMSG_PLAYER_INVENTORY_USE 0x01c8 |