From 90ae388802f612863d2b76e4acd152f8899d4894 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 26 Sep 2018 22:13:59 +0300 Subject: Add packet SMSG_PLAYER_COMBINED_EQUIPMENT 0x0b0a. --- src/net/eathena/inventoryrecv.cpp | 52 +++++++++++++++++++++++++++++++++++++++ src/net/eathena/inventoryrecv.h | 6 +++++ src/net/eathena/packetsin.inc | 3 +++ 3 files changed, 61 insertions(+) diff --git a/src/net/eathena/inventoryrecv.cpp b/src/net/eathena/inventoryrecv.cpp index 2ca1f11c8..7547d03c7 100644 --- a/src/net/eathena/inventoryrecv.cpp +++ b/src/net/eathena/inventoryrecv.cpp @@ -1589,4 +1589,56 @@ void InventoryRecv::processInventoryContinue(Net::MessageIn &msg, } } +void InventoryRecv::processPlayerCombinedEquipment1(Net::MessageIn &msg) +{ + UNIMPLEMENTEDPACKET; + const int dataLen = msg.readInt32("len") - 4; + processEquipmentContinue(msg, + dataLen, + NetInventoryType::Storage); +} + +void InventoryRecv::processPlayerCombinedEquipment2(Net::MessageIn &msg) +{ + UNIMPLEMENTEDPACKET; + const int dataLen = msg.readInt32("len") - 5; + const NetInventoryTypeT invType = static_cast( + msg.readUInt8("type")); + processEquipmentContinue(msg, + dataLen, + invType); +} + +void InventoryRecv::processEquipmentContinue(Net::MessageIn &msg, + const int len, + const NetInventoryTypeT invType + A_UNUSED) +{ + const int packetLen = 47 + itemIdLen * 5; + const int number = len / packetLen; + + for (int loop = 0; loop < number; loop++) + { + msg.readInt16("index"); + msg.readItemId("item id"); + msg.readUInt8("item type"); + msg.readInt32("location"); + msg.readInt32("wear state"); + msg.readInt8("refine"); + for (int f = 0; f < maxCards; f++) + msg.readItemId("card"); + msg.readInt32("hire expire date (?)"); + msg.readInt16("equip type"); + msg.readInt16("item sprite number"); + msg.readUInt8("option count"); + for (int f = 0; f < 5; f ++) + { + msg.readInt16("option index"); + msg.readInt16("option value"); + msg.readUInt8("option param"); + } + msg.readUInt8("flags"); + } +} + } // namespace EAthena diff --git a/src/net/eathena/inventoryrecv.h b/src/net/eathena/inventoryrecv.h index 37e52a8fe..28037063a 100644 --- a/src/net/eathena/inventoryrecv.h +++ b/src/net/eathena/inventoryrecv.h @@ -85,11 +85,17 @@ namespace EAthena void processInventoryEnd2(Net::MessageIn &msg); void processPlayerCombinedInventory1(Net::MessageIn &msg); void processPlayerCombinedInventory2(Net::MessageIn &msg); + void processPlayerCombinedEquipment1(Net::MessageIn &msg); + void processPlayerCombinedEquipment2(Net::MessageIn &msg); int getSlot(const int eAthenaSlot) A_WARN_UNUSED; void processInventoryContinue(Net::MessageIn &msg, const int len, const NetInventoryTypeT invType); + void processEquipmentContinue(Net::MessageIn &msg, + const int len, + const NetInventoryTypeT invType + A_UNUSED); } // namespace InventoryRecv } // namespace EAthena diff --git a/src/net/eathena/packetsin.inc b/src/net/eathena/packetsin.inc index e8901a7b1..b631ed895 100644 --- a/src/net/eathena/packetsin.inc +++ b/src/net/eathena/packetsin.inc @@ -1311,6 +1311,7 @@ if (packetVersionRe >= 20180829) packet(SMSG_INVENTORY_START1, 0x0b08, 26, &InventoryRecv::processInventoryStart1, 20180829); packet(SMSG_INVENTORY_END1, 0x0b0b, 3, &InventoryRecv::processInventoryEnd1, 20180829); packet(SMSG_PLAYER_COMBINED_INVENTORY1, 0x0b09, -1, &InventoryRecv::processPlayerCombinedInventory1, 20180829); + packet(SMSG_PLAYER_COMBINED_EQUIPMENT1, 0x0b0a, -1, &InventoryRecv::processPlayerCombinedEquipment1, 20180829); } // 20180912 re @@ -1319,6 +1320,7 @@ if (packetVersionRe >= 20180912) packet(SMSG_INVENTORY_START2, 0x0b08, 27, &InventoryRecv::processInventoryStart2, 20180912); packet(SMSG_INVENTORY_END2, 0x0b0b, 4, &InventoryRecv::processInventoryEnd2, 20180912); packet(SMSG_PLAYER_COMBINED_INVENTORY2, 0x0b09, -1, &InventoryRecv::processPlayerCombinedInventory2, 20180912); + packet(SMSG_PLAYER_COMBINED_EQUIPMENT2, 0x0b0a, -1, &InventoryRecv::processPlayerCombinedEquipment2, 20180912); } // 20180919 re @@ -1333,6 +1335,7 @@ if (packetVersionZero >= 20180919) packet(SMSG_INVENTORY_START3, 0x0b08, -1, &InventoryRecv::processInventoryStart3, 20180919); packet(SMSG_INVENTORY_END2, 0x0b0b, 4, &InventoryRecv::processInventoryEnd2, 20180919); packet(SMSG_PLAYER_COMBINED_INVENTORY2, 0x0b09, -1, &InventoryRecv::processPlayerCombinedInventory2, 20180919); + packet(SMSG_PLAYER_COMBINED_EQUIPMENT2, 0x0b0a, -1, &InventoryRecv::processPlayerCombinedEquipment2, 20180919); } // 0 -- cgit v1.2.3-60-g2f50