summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/net/ea/inventoryhandler.cpp22
-rw-r--r--src/net/ea/inventoryhandler.h23
-rw-r--r--src/net/eathena/inventoryhandler.h26
-rw-r--r--src/net/tmwa/inventoryhandler.h16
4 files changed, 47 insertions, 40 deletions
diff --git a/src/net/ea/inventoryhandler.cpp b/src/net/ea/inventoryhandler.cpp
index 2c8c64cda..f4250efc5 100644
--- a/src/net/ea/inventoryhandler.cpp
+++ b/src/net/ea/inventoryhandler.cpp
@@ -88,14 +88,22 @@ const Equipment::Slot EQUIP_CONVERT[] =
namespace Ea
{
-InventoryHandler::InventoryHandler() :
- mEquips(),
- mInventoryItems(),
- mStorage(nullptr),
- mStorageWindow(nullptr),
- mDebugInventory(true),
- mSentPickups()
+EquipBackend InventoryHandler::mEquips;
+InventoryItems InventoryHandler::mInventoryItems;
+Inventory *InventoryHandler::mStorage = nullptr;
+InventoryWindow *InventoryHandler::mStorageWindow = nullptr;
+PickupQueue InventoryHandler::mSentPickups;
+bool InventoryHandler::mDebugInventory = true;
+
+InventoryHandler::InventoryHandler()
{
+ mEquips.clear();
+ mInventoryItems.clear();
+ mStorage = nullptr;
+ mStorageWindow = nullptr;
+ while (!mSentPickups.empty())
+ mSentPickups.pop();
+ mDebugInventory = true;
}
InventoryHandler::~InventoryHandler()
diff --git a/src/net/ea/inventoryhandler.h b/src/net/ea/inventoryhandler.h
index e0bfb6a1f..f82cf5780 100644
--- a/src/net/ea/inventoryhandler.h
+++ b/src/net/ea/inventoryhandler.h
@@ -43,6 +43,7 @@ namespace Ea
{
typedef std::vector<InventoryItem> InventoryItems;
+typedef std::queue<int> PickupQueue;
class InventoryHandler notfinal : public Net::InventoryHandler
{
@@ -86,15 +87,15 @@ class InventoryHandler notfinal : public Net::InventoryHandler
static void processItemUseResponse(Net::MessageIn &msg);
- void processPlayerStorageStatus(Net::MessageIn &msg);
+ static void processPlayerStorageStatus(Net::MessageIn &msg);
- void processPlayerStorageRemove(Net::MessageIn &msg);
+ static void processPlayerStorageRemove(Net::MessageIn &msg);
- void processPlayerStorageClose(Net::MessageIn &msg);
+ static void processPlayerStorageClose(Net::MessageIn &msg);
static void processPlayerAttackRange(Net::MessageIn &msg);
- void processPlayerArrowEquip(Net::MessageIn &msg);
+ static void processPlayerArrowEquip(Net::MessageIn &msg);
void closeStorage() override final;
@@ -106,14 +107,12 @@ class InventoryHandler notfinal : public Net::InventoryHandler
protected:
InventoryHandler();
- EquipBackend mEquips;
- InventoryItems mInventoryItems;
- Inventory *mStorage;
- InventoryWindow *mStorageWindow;
- bool mDebugInventory;
-
- typedef std::queue<int> PickupQueue;
- PickupQueue mSentPickups;
+ static EquipBackend mEquips;
+ static InventoryItems mInventoryItems;
+ static Inventory *mStorage;
+ static InventoryWindow *mStorageWindow;
+ static PickupQueue mSentPickups;
+ static bool mDebugInventory;
};
} // namespace Ea
diff --git a/src/net/eathena/inventoryhandler.h b/src/net/eathena/inventoryhandler.h
index 74f46785d..0b9a70237 100644
--- a/src/net/eathena/inventoryhandler.h
+++ b/src/net/eathena/inventoryhandler.h
@@ -69,31 +69,31 @@ class InventoryHandler final : public MessageHandler,
void selectEgg(const Item *const item) const override final;
protected:
- void processPlayerEquipment(Net::MessageIn &msg);
+ static void processPlayerEquipment(Net::MessageIn &msg);
- void processPlayerInventoryAdd(Net::MessageIn &msg);
+ static void processPlayerInventoryAdd(Net::MessageIn &msg);
- void processPlayerInventory(Net::MessageIn &msg);
+ static void processPlayerInventory(Net::MessageIn &msg);
- void processPlayerStorage(Net::MessageIn &msg);
+ static void processPlayerStorage(Net::MessageIn &msg);
- void processPlayerEquip(Net::MessageIn &msg);
+ static void processPlayerEquip(Net::MessageIn &msg);
- void processPlayerUnEquip(Net::MessageIn &msg);
+ static void processPlayerUnEquip(Net::MessageIn &msg);
- void processPlayerInventoryRemove2(Net::MessageIn &msg);
+ static void processPlayerInventoryRemove2(Net::MessageIn &msg);
- void processPlayerStorageEquip(Net::MessageIn &msg);
+ static void processPlayerStorageEquip(Net::MessageIn &msg);
- void processPlayerStorageAdd(Net::MessageIn &msg);
+ static void processPlayerStorageAdd(Net::MessageIn &msg);
- void processPlayerUseCard(Net::MessageIn &msg);
+ static void processPlayerUseCard(Net::MessageIn &msg);
- void processPlayerInsertCard(Net::MessageIn &msg);
+ static void processPlayerInsertCard(Net::MessageIn &msg);
- void processPlayerItemRentalTime(Net::MessageIn &msg);
+ static void processPlayerItemRentalTime(Net::MessageIn &msg);
- void processPlayerItemRentalExpired(Net::MessageIn &msg);
+ static void processPlayerItemRentalExpired(Net::MessageIn &msg);
};
} // namespace EAthena
diff --git a/src/net/tmwa/inventoryhandler.h b/src/net/tmwa/inventoryhandler.h
index beaf560a2..23b8e0f4b 100644
--- a/src/net/tmwa/inventoryhandler.h
+++ b/src/net/tmwa/inventoryhandler.h
@@ -69,21 +69,21 @@ class InventoryHandler final : public MessageHandler,
void selectEgg(const Item *const item) const override final;
protected:
- void processPlayerEquipment(Net::MessageIn &msg);
+ static void processPlayerEquipment(Net::MessageIn &msg);
- void processPlayerInventoryAdd(Net::MessageIn &msg);
+ static void processPlayerInventoryAdd(Net::MessageIn &msg);
- void processPlayerInventory(Net::MessageIn &msg);
+ static void processPlayerInventory(Net::MessageIn &msg);
- void processPlayerStorage(Net::MessageIn &msg);
+ static void processPlayerStorage(Net::MessageIn &msg);
- void processPlayerEquip(Net::MessageIn &msg);
+ static void processPlayerEquip(Net::MessageIn &msg);
- void processPlayerUnEquip(Net::MessageIn &msg);
+ static void processPlayerUnEquip(Net::MessageIn &msg);
- void processPlayerStorageEquip(Net::MessageIn &msg);
+ static void processPlayerStorageEquip(Net::MessageIn &msg);
- void processPlayerStorageAdd(Net::MessageIn &msg);
+ static void processPlayerStorageAdd(Net::MessageIn &msg);
};
} // namespace TmwAthena