From 84ec06e6d2814ec0cbef904fb352baf1f43bf7c7 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 25 Sep 2018 08:38:59 +0300 Subject: Add packet SMSG_ITEM_MOVE_FAILED 0x0aa7. --- src/net/eathena/inventoryrecv.cpp | 16 ++++++++++++++++ src/net/eathena/inventoryrecv.h | 1 + src/net/eathena/packetsin.inc | 13 +++++++++++++ 3 files changed, 30 insertions(+) (limited to 'src/net/eathena') diff --git a/src/net/eathena/inventoryrecv.cpp b/src/net/eathena/inventoryrecv.cpp index c17db75d1..dbf7b8610 100644 --- a/src/net/eathena/inventoryrecv.cpp +++ b/src/net/eathena/inventoryrecv.cpp @@ -1490,4 +1490,20 @@ void InventoryRecv::processPlayerInventoryUse(Net::MessageIn &msg) BLOCK_END("InventoryRecv::processPlayerInventoryUse") } +void InventoryRecv::processItemMoveFailed(Net::MessageIn &msg) +{ + Inventory *const inventory = localPlayer != nullptr + ? PlayerInfo::getInventory() : nullptr; + const int index = msg.readInt16("index") - INVENTORY_OFFSET; + msg.readInt16("unknown"); // 1 + if (inventory != nullptr) + { + if (Item *const item = inventory->getItem(index)) + { + NotifyManager::notify(NotifyTypes::DELETE_ITEM_DROPPED, + item->getName()); + } + } +} + } // namespace EAthena diff --git a/src/net/eathena/inventoryrecv.h b/src/net/eathena/inventoryrecv.h index 544c6a817..b019643fe 100644 --- a/src/net/eathena/inventoryrecv.h +++ b/src/net/eathena/inventoryrecv.h @@ -74,6 +74,7 @@ namespace EAthena void processMergeItem(Net::MessageIn &msg); void processMergeItemResponse(Net::MessageIn &msg); void processPlayerInventoryUse(Net::MessageIn &msg); + void processItemMoveFailed(Net::MessageIn &msg); int getSlot(const int eAthenaSlot) A_WARN_UNUSED; } // namespace InventoryRecv diff --git a/src/net/eathena/packetsin.inc b/src/net/eathena/packetsin.inc index 0ea950d92..263ca4a1e 100644 --- a/src/net/eathena/packetsin.inc +++ b/src/net/eathena/packetsin.inc @@ -985,6 +985,18 @@ if (packetVersion >= 20161026) packet(SMSG_GUILD_MEMBER_LIST, 0x0aa5, -1, &GuildRecv::processGuildMemberList, 20161026); } +// 20161130 re +if (packetVersionRe >= 20161130) +{ + packet(SMSG_ITEM_MOVE_FAILED, 0x0aa7, 6, &InventoryRecv::processItemMoveFailed, 20161130); +} + +// 20161214 main +if (packetVersionMain >= 20161214) +{ + packet(SMSG_ITEM_MOVE_FAILED, 0x0aa7, 6, &InventoryRecv::processItemMoveFailed, 20161214); +} + // 20170315 if (packetVersion >= 20170315) { @@ -1037,6 +1049,7 @@ packet(SMSG_PLAYER_GET_EXP2, 0x0acc, 18, &PlayerRecv::processPlay if (packets_zero == true) { packet(SMSG_ITEM_DROPPED, 0x0add, 22, &ItemRecv::processItemDropped, 20171018); + packet(SMSG_ITEM_MOVE_FAILED, 0x0aa7, 6, &InventoryRecv::processItemMoveFailed, 20171018); } // 20171207 -- cgit v1.2.3-70-g09d2