summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
Diffstat (limited to 'src/net')
-rw-r--r--src/net/ea/inventoryhandler.cpp10
-rw-r--r--src/net/ea/inventoryhandler.h3
-rw-r--r--src/net/ea/inventoryrecv.cpp2
-rw-r--r--src/net/eathena/inventoryhandler.cpp24
-rw-r--r--src/net/eathena/inventoryhandler.h6
-rw-r--r--src/net/inventoryhandler.h10
-rw-r--r--src/net/tmwa/inventoryhandler.cpp16
-rw-r--r--src/net/tmwa/inventoryhandler.h6
8 files changed, 41 insertions, 36 deletions
diff --git a/src/net/ea/inventoryhandler.cpp b/src/net/ea/inventoryhandler.cpp
index 8d3ad6c9f..b1aa87020 100644
--- a/src/net/ea/inventoryhandler.cpp
+++ b/src/net/ea/inventoryhandler.cpp
@@ -81,18 +81,18 @@ void InventoryHandler::openStorage(const int type A_UNUSED) const
// Doesn't apply to eAthena, since opening happens through NPCs?
}
-size_t InventoryHandler::getSize(const int type) const
+size_t InventoryHandler::getSize(const InventoryTypeT type) const
{
switch (type)
{
- case InventoryType::INVENTORY:
+ case InventoryType::Inventory:
return 100;
- case InventoryType::STORAGE:
+ case InventoryType::Storage:
return 0; // Comes from server after items
- case InventoryType::TRADE:
+ case InventoryType::Trade:
return 12;
// GUILD_STORAGE
- case InventoryType::TYPE_END:
+ case InventoryType::TypeEnd:
return 0; // Comes from server after items
default:
return 0;
diff --git a/src/net/ea/inventoryhandler.h b/src/net/ea/inventoryhandler.h
index 313485dd4..5c6f4258e 100644
--- a/src/net/ea/inventoryhandler.h
+++ b/src/net/ea/inventoryhandler.h
@@ -56,7 +56,8 @@ class InventoryHandler notfinal : public Net::InventoryHandler
void openStorage(const int type) const override final;
- size_t getSize(const int type) const override final A_WARN_UNUSED;
+ size_t getSize(const InventoryTypeT type) const override final
+ A_WARN_UNUSED;
void pushPickup(const BeingId floorId);
diff --git a/src/net/ea/inventoryrecv.cpp b/src/net/ea/inventoryrecv.cpp
index 7a96e86cd..bda53bab3 100644
--- a/src/net/ea/inventoryrecv.cpp
+++ b/src/net/ea/inventoryrecv.cpp
@@ -148,7 +148,7 @@ void InventoryRecv::processPlayerStorageStatus(Net::MessageIn &msg)
const int size = msg.readInt16("max size");
if (!mStorage)
- mStorage = new Inventory(InventoryType::STORAGE, size);
+ mStorage = new Inventory(InventoryType::Storage, size);
FOR_EACH (Ea::InventoryItems::const_iterator, it, mInventoryItems)
{
diff --git a/src/net/eathena/inventoryhandler.cpp b/src/net/eathena/inventoryhandler.cpp
index 1b781c3be..05d8c77ca 100644
--- a/src/net/eathena/inventoryhandler.cpp
+++ b/src/net/eathena/inventoryhandler.cpp
@@ -119,38 +119,38 @@ void InventoryHandler::dropItem(const Item *const item, const int amount) const
outMsg.writeInt16(static_cast<int16_t>(amount), "amount");
}
-void InventoryHandler::closeStorage(const int type A_UNUSED) const
+void InventoryHandler::closeStorage() const
{
createOutPacket(CMSG_CLOSE_STORAGE);
}
-void InventoryHandler::moveItem2(const int source,
+void InventoryHandler::moveItem2(const InventoryTypeT source,
const int slot,
const int amount,
- const int destination) const
+ const InventoryTypeT destination) const
{
int packet = 0;
int offset = INVENTORY_OFFSET;
- if (source == InventoryType::INVENTORY)
+ if (source == InventoryType::Inventory)
{
- if (destination == InventoryType::STORAGE)
+ if (destination == InventoryType::Storage)
packet = CMSG_MOVE_TO_STORAGE;
- else if (destination == InventoryType::CART)
+ else if (destination == InventoryType::Cart)
packet = CMSG_MOVE_TO_CART;
}
- else if (source == InventoryType::STORAGE)
+ else if (source == InventoryType::Storage)
{
offset = STORAGE_OFFSET;
- if (destination == InventoryType::INVENTORY)
+ if (destination == InventoryType::Inventory)
packet = CMSG_MOVE_FROM_STORAGE;
- else if (destination == InventoryType::CART)
+ else if (destination == InventoryType::Cart)
packet = CMSG_MOVE_FROM_STORAGE_TO_CART;
}
- else if (source == InventoryType::CART)
+ else if (source == InventoryType::Cart)
{
- if (destination == InventoryType::INVENTORY)
+ if (destination == InventoryType::Inventory)
packet = CMSG_MOVE_FROM_CART;
- else if (destination == InventoryType::STORAGE)
+ else if (destination == InventoryType::Storage)
packet = CMSG_MOVE_FROM_CART_TO_STORAGE;
}
diff --git a/src/net/eathena/inventoryhandler.h b/src/net/eathena/inventoryhandler.h
index 924275757..a398fe2eb 100644
--- a/src/net/eathena/inventoryhandler.h
+++ b/src/net/eathena/inventoryhandler.h
@@ -46,12 +46,12 @@ class InventoryHandler final : public Ea::InventoryHandler
void dropItem(const Item *const item,
const int amount) const override final;
- void closeStorage(const int type) const override final;
+ void closeStorage() const override final;
- void moveItem2(const int source,
+ void moveItem2(const InventoryTypeT source,
const int slot,
const int amount,
- const int destination) const override final;
+ const InventoryTypeT destination) const override final;
void useCard(const Item *const item) override final;
diff --git a/src/net/inventoryhandler.h b/src/net/inventoryhandler.h
index a151e39da..c7153ee29 100644
--- a/src/net/inventoryhandler.h
+++ b/src/net/inventoryhandler.h
@@ -55,13 +55,15 @@ class InventoryHandler notfinal
virtual void openStorage(const int type) const = 0;
- virtual void closeStorage(const int type) const = 0;
+ virtual void closeStorage() const = 0;
- virtual void moveItem2(const int source, const int slot,
+ virtual void moveItem2(const InventoryTypeT source,
+ const int slot,
const int amount,
- const int destination) const = 0;
+ const InventoryTypeT destination) const = 0;
- virtual size_t getSize(const int type) const A_WARN_UNUSED = 0;
+ virtual size_t getSize(const InventoryTypeT type) const
+ A_WARN_UNUSED = 0;
virtual Inventory *getStorage() const = 0;
diff --git a/src/net/tmwa/inventoryhandler.cpp b/src/net/tmwa/inventoryhandler.cpp
index 3248ec8f6..f4af144ea 100644
--- a/src/net/tmwa/inventoryhandler.cpp
+++ b/src/net/tmwa/inventoryhandler.cpp
@@ -110,24 +110,26 @@ void InventoryHandler::dropItem(const Item *const item, const int amount) const
outMsg.writeInt16(static_cast<int16_t>(amount), "amount");
}
-void InventoryHandler::closeStorage(const int type A_UNUSED) const
+void InventoryHandler::closeStorage() const
{
createOutPacket(CMSG_CLOSE_STORAGE);
}
-void InventoryHandler::moveItem2(const int source, const int slot,
- const int amount, const int destination) const
+void InventoryHandler::moveItem2(const InventoryTypeT source,
+ const int slot,
+ const int amount,
+ const InventoryTypeT destination) const
{
- if (source == InventoryType::INVENTORY
- && destination == InventoryType::STORAGE)
+ if (source == InventoryType::Inventory &&
+ destination == InventoryType::Storage)
{
createOutPacket(CMSG_MOVE_TO_STORAGE);
outMsg.writeInt16(static_cast<int16_t>(slot + INVENTORY_OFFSET),
"index");
outMsg.writeInt32(amount, "amount");
}
- else if (source == InventoryType::STORAGE
- && destination == InventoryType::INVENTORY)
+ else if (source == InventoryType::Storage &&
+ destination == InventoryType::Inventory)
{
createOutPacket(CMSG_MOVE_FROM_STORAGE);
outMsg.writeInt16(static_cast<int16_t>(slot + STORAGE_OFFSET),
diff --git a/src/net/tmwa/inventoryhandler.h b/src/net/tmwa/inventoryhandler.h
index d0ccedab5..81e300bd3 100644
--- a/src/net/tmwa/inventoryhandler.h
+++ b/src/net/tmwa/inventoryhandler.h
@@ -46,12 +46,12 @@ class InventoryHandler final : public Ea::InventoryHandler
void dropItem(const Item *const item,
const int amount) const override final;
- void closeStorage(const int type) const override final;
+ void closeStorage() const override final;
- void moveItem2(const int source,
+ void moveItem2(const InventoryTypeT source,
const int slot,
const int amount,
- const int destination) const override final;
+ const InventoryTypeT destination) const override final;
void useCard(const Item *const item) override final;