summaryrefslogtreecommitdiff
path: root/src/net/ea
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-10-23 12:43:12 +0300
committerAndrei Karas <akaras@inbox.ru>2014-10-23 19:46:19 +0300
commit1bfa2fef834bf52155b25e79bc4742363ae1ceac (patch)
treea65a94f40a9e1d3c70ad287b2b12947d9e77b33e /src/net/ea
parent54d87dc0e28e1e031db1f2fdb18407a0bf15b3ef (diff)
downloadmv-1bfa2fef834bf52155b25e79bc4742363ae1ceac.tar.gz
mv-1bfa2fef834bf52155b25e79bc4742363ae1ceac.tar.bz2
mv-1bfa2fef834bf52155b25e79bc4742363ae1ceac.tar.xz
mv-1bfa2fef834bf52155b25e79bc4742363ae1ceac.zip
Add packet fields comments in inventoryhandler.
Diffstat (limited to 'src/net/ea')
-rw-r--r--src/net/ea/inventoryhandler.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/net/ea/inventoryhandler.cpp b/src/net/ea/inventoryhandler.cpp
index 8bf795deb..6c0194bd3 100644
--- a/src/net/ea/inventoryhandler.cpp
+++ b/src/net/ea/inventoryhandler.cpp
@@ -193,8 +193,8 @@ void InventoryHandler::processPlayerInventoryRemove(Net::MessageIn &msg)
Inventory *const inventory = localPlayer
? PlayerInfo::getInventory() : nullptr;
- const int index = msg.readInt16() - INVENTORY_OFFSET;
- const int amount = msg.readInt16();
+ const int index = msg.readInt16("index") - INVENTORY_OFFSET;
+ const int amount = msg.readInt16("amount");
if (inventory)
{
if (Item *const item = inventory->getItem(index))
@@ -214,11 +214,11 @@ void InventoryHandler::processPlayerInventoryUse(Net::MessageIn &msg)
Inventory *const inventory = localPlayer
? PlayerInfo::getInventory() : nullptr;
- const int index = msg.readInt16() - INVENTORY_OFFSET;
- msg.readInt16(); // item id
- msg.readInt32(); // id
- const int amount = msg.readInt16();
- msg.readUInt8(); // type
+ const int index = msg.readInt16("index") - INVENTORY_OFFSET;
+ msg.readInt16("item id");
+ msg.readInt32("id?");
+ const int amount = msg.readInt16("amount");
+ msg.readUInt8("type");
if (inventory)
{
@@ -239,10 +239,10 @@ void InventoryHandler::processItemUseResponse(Net::MessageIn &msg)
Inventory *const inventory = localPlayer
? PlayerInfo::getInventory() : nullptr;
- const int index = msg.readInt16() - INVENTORY_OFFSET;
- const int amount = msg.readInt16();
+ const int index = msg.readInt16("index") - INVENTORY_OFFSET;
+ const int amount = msg.readInt16("amount");
- if (msg.readUInt8() == 0)
+ if (msg.readUInt8("result") == 0)
{
NotifyManager::notify(NotifyTypes::USE_FAILED);
}
@@ -270,8 +270,8 @@ void InventoryHandler::processPlayerStorageStatus(Net::MessageIn &msg)
* server. It always comes after the two SMSG_PLAYER_STORAGE_...
* packets that update storage contents.
*/
- msg.readInt16(); // Used count
- const int size = msg.readInt16(); // Max size
+ msg.readInt16("used count");
+ const int size = msg.readInt16("max size");
if (!mStorage)
mStorage = new Inventory(Inventory::STORAGE, size);
@@ -303,8 +303,8 @@ void InventoryHandler::processPlayerStorageRemove(Net::MessageIn &msg)
{
BLOCK_START("InventoryHandler::processPlayerStorageRemove")
// Move an item out of storage
- const int index = msg.readInt16() - STORAGE_OFFSET;
- const int amount = msg.readInt16();
+ const int index = msg.readInt16("index") - STORAGE_OFFSET;
+ const int amount = msg.readInt16("amount");
if (mStorage)
{
if (Item *const item = mStorage->getItem(index))
@@ -339,7 +339,7 @@ void InventoryHandler::processPlayerStorageClose(Net::MessageIn &msg A_UNUSED)
void InventoryHandler::processPlayerAttackRange(Net::MessageIn &msg)
{
BLOCK_START("InventoryHandler::processPlayerAttackRange")
- const int range = msg.readInt16();
+ const int range = msg.readInt16("range");
if (localPlayer)
localPlayer->setAttackRange(range);
PlayerInfo::setStatBase(Attributes::ATTACK_RANGE, range);
@@ -350,7 +350,7 @@ void InventoryHandler::processPlayerAttackRange(Net::MessageIn &msg)
void InventoryHandler::processPlayerArrowEquip(Net::MessageIn &msg)
{
BLOCK_START("InventoryHandler::processPlayerArrowEquip")
- int index = msg.readInt16();
+ int index = msg.readInt16("index");
if (index <= 1)
return;