diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-09-16 11:49:43 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-09-16 11:49:43 +0300 |
commit | 3ff2ba0b4a6bf7e0f693d0d72ca5360767d3cc2c (patch) | |
tree | e91b6f167d8e062b4cc23efb3ca4ce194a088877 | |
parent | f1d3e3325d28a43f838052385ad798527dff9c2d (diff) | |
download | manaverse-3ff2ba0b4a6bf7e0f693d0d72ca5360767d3cc2c.tar.gz manaverse-3ff2ba0b4a6bf7e0f693d0d72ca5360767d3cc2c.tar.bz2 manaverse-3ff2ba0b4a6bf7e0f693d0d72ca5360767d3cc2c.tar.xz manaverse-3ff2ba0b4a6bf7e0f693d0d72ca5360767d3cc2c.zip |
eathena: add packet CMSG_PLAYER_FAVORITE_ITEM 0x0907.
-rw-r--r-- | src/net/eathena/inventoryhandler.cpp | 10 | ||||
-rw-r--r-- | src/net/eathena/inventoryhandler.h | 3 | ||||
-rw-r--r-- | src/net/eathena/protocol.h | 1 | ||||
-rw-r--r-- | src/net/inventoryhandler.h | 3 | ||||
-rw-r--r-- | src/net/tmwa/inventoryhandler.cpp | 5 | ||||
-rw-r--r-- | src/net/tmwa/inventoryhandler.h | 3 |
6 files changed, 25 insertions, 0 deletions
diff --git a/src/net/eathena/inventoryhandler.cpp b/src/net/eathena/inventoryhandler.cpp index 7666825de..610b27194 100644 --- a/src/net/eathena/inventoryhandler.cpp +++ b/src/net/eathena/inventoryhandler.cpp @@ -258,6 +258,16 @@ void InventoryHandler::insertCard(const int cardIndex, "item index"); } +void InventoryHandler::favoriteItem(const Item *const item, + const bool favorite) const +{ + MessageOut outMsg(CMSG_PLAYER_FAVORITE_ITEM); + outMsg.writeInt16(static_cast<int16_t>(item->getInvIndex() + + INVENTORY_OFFSET), + "item index"); + outMsg.writeInt8(favorite, "favorite flag"); +} + void InventoryHandler::processPlayerEquipment(Net::MessageIn &msg) { BLOCK_START("InventoryHandler::processPlayerEquipment") diff --git a/src/net/eathena/inventoryhandler.h b/src/net/eathena/inventoryhandler.h index ae4f864d6..8f5280e2f 100644 --- a/src/net/eathena/inventoryhandler.h +++ b/src/net/eathena/inventoryhandler.h @@ -63,6 +63,9 @@ class InventoryHandler final : public MessageHandler, void insertCard(const int cardIndex, const int itemIndex) const override final; + void favoriteItem(const Item *const item, + const bool favorite) const override final; + protected: void processPlayerEquipment(Net::MessageIn &msg); diff --git a/src/net/eathena/protocol.h b/src/net/eathena/protocol.h index 3889a2c1c..1a913b75d 100644 --- a/src/net/eathena/protocol.h +++ b/src/net/eathena/protocol.h @@ -259,6 +259,7 @@ #define CMSG_PLAYER_INSERT_CARD 0x017c #define CMSG_PLAYER_VIEW_EQUIPMENT 0x02d6 #define CMSG_PLAYER_SET_EQUIPMENT_VISIBLE 0x02d8 +#define CMSG_PLAYER_FAVORITE_ITEM 0x0907 #define CMSG_ITEM_PICKUP 0x07e4 #define CMSG_PLAYER_CHANGE_DIR 0x0202 diff --git a/src/net/inventoryhandler.h b/src/net/inventoryhandler.h index 4eab4d24b..7caad3994 100644 --- a/src/net/inventoryhandler.h +++ b/src/net/inventoryhandler.h @@ -79,6 +79,9 @@ class InventoryHandler notfinal virtual void insertCard(const int cardIndex, const int itemIndex) const = 0; + + virtual void favoriteItem(const Item *const item, + const bool favorite) const = 0; }; } // namespace Net diff --git a/src/net/tmwa/inventoryhandler.cpp b/src/net/tmwa/inventoryhandler.cpp index 3476cb10a..811ce6c3b 100644 --- a/src/net/tmwa/inventoryhandler.cpp +++ b/src/net/tmwa/inventoryhandler.cpp @@ -226,6 +226,11 @@ void InventoryHandler::insertCard(const int cardIndex A_UNUSED, { } +void InventoryHandler::favoriteItem(const Item *const item A_UNUSED, + const bool favorite A_UNUSED) const +{ +} + void InventoryHandler::processPlayerEquipment(Net::MessageIn &msg) { BLOCK_START("InventoryHandler::processPlayerEquipment") diff --git a/src/net/tmwa/inventoryhandler.h b/src/net/tmwa/inventoryhandler.h index 3d9fea657..b352e3b7f 100644 --- a/src/net/tmwa/inventoryhandler.h +++ b/src/net/tmwa/inventoryhandler.h @@ -63,6 +63,9 @@ class InventoryHandler final : public MessageHandler, void insertCard(const int cardIndex, const int itemIndex) const override final; + void favoriteItem(const Item *const item, + const bool favorite) const override final; + protected: void processPlayerEquipment(Net::MessageIn &msg); |