summaryrefslogtreecommitdiff
path: root/src/net/eathena/inventoryhandler.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-05-18 20:51:44 +0300
committerAndrei Karas <akaras@inbox.ru>2016-05-18 20:58:26 +0300
commitdc0102e6eb4ca9a202e190e6ee84b7141d4e0fe1 (patch)
treec2ec4843d45d3fc2b800e2fcd659e3d5688c2574 /src/net/eathena/inventoryhandler.cpp
parentd9164626f2ecb62bf03c9c1b6e1e53a12a83c1df (diff)
downloadplus-dc0102e6eb4ca9a202e190e6ee84b7141d4e0fe1.tar.gz
plus-dc0102e6eb4ca9a202e190e6ee84b7141d4e0fe1.tar.bz2
plus-dc0102e6eb4ca9a202e190e6ee84b7141d4e0fe1.tar.xz
plus-dc0102e6eb4ca9a202e190e6ee84b7141d4e0fe1.zip
Add all versions for packet CMSG_PLAYER_INVENTORY_DROP.
Diffstat (limited to 'src/net/eathena/inventoryhandler.cpp')
-rw-r--r--src/net/eathena/inventoryhandler.cpp151
1 files changed, 148 insertions, 3 deletions
diff --git a/src/net/eathena/inventoryhandler.cpp b/src/net/eathena/inventoryhandler.cpp
index 7d3b36f72..8a0670765 100644
--- a/src/net/eathena/inventoryhandler.cpp
+++ b/src/net/eathena/inventoryhandler.cpp
@@ -36,6 +36,7 @@
#include "debug.h"
extern Net::InventoryHandler *inventoryHandler;
+extern int packetVersion;
// this conversion from bit corrupted LOOK_* to EquipSlot
// for how it corrupted, see BeingRecv::processBeingChangeLookContinue
@@ -117,9 +118,153 @@ void InventoryHandler::dropItem(const Item *const item, const int amount) const
return;
createOutPacket(CMSG_PLAYER_INVENTORY_DROP);
- outMsg.writeInt16(CAST_S16(
- item->getInvIndex() + INVENTORY_OFFSET), "index");
- outMsg.writeInt16(CAST_S16(amount), "amount");
+ const int16_t index = CAST_S16(item->getInvIndex() + INVENTORY_OFFSET);
+ if (packetVersion >= 20101124)
+ {
+ outMsg.writeInt16(index, "index");
+ outMsg.writeInt16(CAST_S16(amount), "amount");
+ }
+ if (packetVersion >= 20080827)
+ {
+ outMsg.writeInt16(0, "unknown");
+ outMsg.writeInt16(index, "index");
+ outMsg.writeInt32(0, "unknown");
+ outMsg.writeInt16(0, "unknown");
+ outMsg.writeInt8(0, "unknown");
+ outMsg.writeInt16(CAST_S16(amount), "amount");
+ }
+ else if (packetVersion >= 20070212)
+ {
+ outMsg.writeInt16(0, "unknown");
+ outMsg.writeInt8(0, "unknown");
+ outMsg.writeInt16(index, "index");
+ outMsg.writeInt8(0, "unknown");
+ outMsg.writeInt16(CAST_S16(amount), "amount");
+ }
+ else if (packetVersion >= 20070108)
+ {
+ outMsg.writeInt32(0, "unknown");
+ outMsg.writeInt32(0, "unknown");
+ outMsg.writeInt16(0, "unknown");
+ outMsg.writeInt16(index, "index");
+ outMsg.writeInt32(0, "unknown");
+ outMsg.writeInt16(CAST_S16(amount), "amount");
+ }
+ else if (packetVersion >= 20060327)
+ {
+ outMsg.writeInt32(0, "unknown");
+ outMsg.writeInt16(0, "unknown");
+ outMsg.writeInt16(index, "index");
+ outMsg.writeInt32(0, "unknown");
+ outMsg.writeInt8(0, "unknown");
+ outMsg.writeInt16(CAST_S16(amount), "amount");
+ }
+ else if (packetVersion >= 20050719)
+ {
+ outMsg.writeInt8(0, "unknown");
+ outMsg.writeInt16(index, "index");
+ outMsg.writeInt8(0, "unknown");
+ outMsg.writeInt32(0, "unknown");
+ outMsg.writeInt16(CAST_S16(amount), "amount");
+ }
+ else if (packetVersion >= 20050718)
+ {
+ outMsg.writeInt32(0, "unknown");
+ outMsg.writeInt16(index, "index");
+ outMsg.writeInt16(0, "unknown");
+ outMsg.writeInt16(CAST_S16(amount), "amount");
+ }
+ else if (packetVersion >= 20050628)
+ {
+ outMsg.writeInt8(0, "unknown");
+ outMsg.writeInt16(index, "index");
+ outMsg.writeInt32(0, "unknown");
+ outMsg.writeInt8(0, "unknown");
+ outMsg.writeInt16(CAST_S16(amount), "amount");
+ }
+ else if (packetVersion >= 20050509)
+ {
+ outMsg.writeInt16(0, "unknown");
+ outMsg.writeInt8(0, "unknown");
+ outMsg.writeInt16(index, "index");
+ outMsg.writeInt8(0, "unknown");
+ outMsg.writeInt16(CAST_S16(amount), "amount");
+ }
+ else if (packetVersion >= 20050110)
+ {
+ outMsg.writeInt32(0, "unknown");
+ outMsg.writeInt32(0, "unknown");
+ outMsg.writeInt32(0, "unknown");
+ outMsg.writeInt8(0, "unknown");
+ outMsg.writeInt16(index, "index");
+ outMsg.writeInt8(0, "unknown");
+ outMsg.writeInt16(CAST_S16(amount), "amount");
+ }
+ if (packetVersion >= 20041129)
+ {
+ outMsg.writeInt16(0, "unknown");
+ outMsg.writeInt16(index, "index");
+ outMsg.writeInt32(0, "unknown");
+ outMsg.writeInt16(CAST_S16(amount), "amount");
+ }
+ else if (packetVersion >= 20041025)
+ {
+ outMsg.writeInt32(0, "unknown");
+ outMsg.writeInt16(index, "index");
+ outMsg.writeInt16(0, "unknown");
+ outMsg.writeInt16(CAST_S16(amount), "amount");
+ }
+ else if (packetVersion >= 20041005)
+ {
+ outMsg.writeInt16(0, "unknown");
+ outMsg.writeInt8(0, "unknown");
+ outMsg.writeInt16(index, "index");
+ outMsg.writeInt32(0, "unknown");
+ outMsg.writeInt8(0, "unknown");
+ outMsg.writeInt16(CAST_S16(amount), "amount");
+ }
+ if (packetVersion >= 20040920)
+ {
+ outMsg.writeInt32(0, "unknown");
+ outMsg.writeInt32(0, "unknown");
+ outMsg.writeInt16(0, "unknown");
+ outMsg.writeInt16(index, "index");
+ outMsg.writeInt16(0, "unknown");
+ outMsg.writeInt8(0, "unknown");
+ outMsg.writeInt16(CAST_S16(amount), "amount");
+ }
+ else if (packetVersion >= 20040906)
+ {
+ outMsg.writeInt32(0, "unknown");
+ outMsg.writeInt16(index, "index");
+ outMsg.writeInt32(0, "unknown");
+ outMsg.writeInt16(0, "unknown");
+ outMsg.writeInt8(0, "unknown");
+ outMsg.writeInt16(CAST_S16(amount), "amount");
+ }
+ else if (packetVersion >= 20040809)
+ {
+ outMsg.writeInt32(0, "unknown");
+ outMsg.writeInt16(0, "unknown");
+ outMsg.writeInt16(index, "index");
+ outMsg.writeInt32(0, "unknown");
+ outMsg.writeInt8(0, "unknown");
+ outMsg.writeInt16(CAST_S16(amount), "amount");
+ }
+ else if (packetVersion >= 20040726)
+ {
+ outMsg.writeInt16(0, "unknown");
+ outMsg.writeInt8(0, "unknown");
+ outMsg.writeInt16(index, "index");
+ outMsg.writeInt32(0, "unknown");
+ outMsg.writeInt8(0, "unknown");
+ outMsg.writeInt16(CAST_S16(amount), "amount");
+ }
+ else
+ {
+ outMsg.writeInt16(index, "index");
+ outMsg.writeInt16(CAST_S16(amount), "amount");
+ }
}
void InventoryHandler::closeStorage() const