summaryrefslogtreecommitdiff
path: root/src/net/eathena/inventoryhandler.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-01-24 19:06:48 +0300
committerAndrei Karas <akaras@inbox.ru>2015-01-24 19:06:48 +0300
commit5b3354c4a84ff2c4223ec4a2f5b97685d777d615 (patch)
tree9622ad7752341abc2cd23ecb9539597b615720e0 /src/net/eathena/inventoryhandler.cpp
parentdb37480e7d36bb58b10ee1a4671ec18880e2bda2 (diff)
downloadplus-5b3354c4a84ff2c4223ec4a2f5b97685d777d615.tar.gz
plus-5b3354c4a84ff2c4223ec4a2f5b97685d777d615.tar.bz2
plus-5b3354c4a84ff2c4223ec4a2f5b97685d777d615.tar.xz
plus-5b3354c4a84ff2c4223ec4a2f5b97685d777d615.zip
eathena: add packet SMSG_PLAYER_CART_ITEMS 0x0993.
Diffstat (limited to 'src/net/eathena/inventoryhandler.cpp')
-rw-r--r--src/net/eathena/inventoryhandler.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/net/eathena/inventoryhandler.cpp b/src/net/eathena/inventoryhandler.cpp
index f29638829..edba33ce9 100644
--- a/src/net/eathena/inventoryhandler.cpp
+++ b/src/net/eathena/inventoryhandler.cpp
@@ -100,6 +100,7 @@ InventoryHandler::InventoryHandler() :
SMSG_CART_REMOVE,
SMSG_PLAYER_CART_ADD,
SMSG_PLAYER_CART_EQUIP,
+ SMSG_PLAYER_CART_ITEMS,
0
};
handledMessages = _messages;
@@ -216,6 +217,10 @@ void InventoryHandler::handleMessage(Net::MessageIn &msg)
processPlayerCartEquip(msg);
break;
+ case SMSG_PLAYER_CART_ITEMS:
+ processPlayerCartItems(msg);
+ break;
+
default:
break;
}
@@ -860,4 +865,33 @@ void InventoryHandler::processPlayerCartEquip(Net::MessageIn &msg)
BLOCK_END("InventoryHandler::processPlayerCartEquip")
}
+void InventoryHandler::processPlayerCartItems(Net::MessageIn &msg)
+{
+ BLOCK_START("InventoryHandler::processPlayerCartItems")
+ mInventoryItems.clear();
+
+ msg.readInt16("len");
+ const int number = (msg.getLength() - 4) / 23;
+
+ for (int loop = 0; loop < number; loop++)
+ {
+ const int index = msg.readInt16("item index") - STORAGE_OFFSET;
+ const int itemId = msg.readInt16("item id");
+ const int itemType = msg.readUInt8("item type");
+ const int amount = msg.readInt16("count");
+ msg.readInt32("wear state / equip");
+ int cards[4];
+ for (int f = 0; f < 4; f++)
+ cards[f] = msg.readInt16("card");
+ msg.readInt32("hire expire date (?)");
+ ItemFlags flags;
+ flags.byte = msg.readUInt8("flags");
+
+ mCartItems.push_back(Ea::InventoryItem(index, itemId, itemType,
+ cards, amount, 0, 1, flags.bits.isIdentified,
+ flags.bits.isDamaged, flags.bits.isFavorite, false));
+ }
+ BLOCK_END("InventoryHandler::processPlayerCartItems")
+}
+
} // namespace EAthena