From 4d02075c3daaefca2dcad72546e1e45b4219b5ad Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 23 Oct 2014 20:23:04 +0300 Subject: Add packet fields comments in tradehandler. --- src/net/eathena/tradehandler.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/net/eathena/tradehandler.cpp') diff --git a/src/net/eathena/tradehandler.cpp b/src/net/eathena/tradehandler.cpp index 15eb5c4bf..3d76d9e78 100644 --- a/src/net/eathena/tradehandler.cpp +++ b/src/net/eathena/tradehandler.cpp @@ -123,7 +123,7 @@ void TradeHandler::request(const Being *const being) const return; createOutPacket(CMSG_TRADE_REQUEST); - outMsg.writeInt32(being->getId()); + outMsg.writeInt32(being->getId(), "player id"); } void TradeHandler::respond(const bool accept) const @@ -132,7 +132,7 @@ void TradeHandler::respond(const bool accept) const PlayerInfo::setTrading(false); createOutPacket(CMSG_TRADE_RESPONSE); - outMsg.writeInt8(static_cast(accept ? 3 : 4)); + outMsg.writeInt8(static_cast(accept ? 3 : 4), "accept"); } void TradeHandler::addItem(const Item *const item, const int amount) const @@ -143,15 +143,16 @@ void TradeHandler::addItem(const Item *const item, const int amount) const mItemIndex = item->getInvIndex(); mQuantity = amount; createOutPacket(CMSG_TRADE_ITEM_ADD_REQUEST); - outMsg.writeInt16(static_cast(mItemIndex + INVENTORY_OFFSET)); - outMsg.writeInt32(amount); + outMsg.writeInt16(static_cast(mItemIndex + INVENTORY_OFFSET), + "index"); + outMsg.writeInt32(amount, "amount"); } void TradeHandler::setMoney(const int amount) const { createOutPacket(CMSG_TRADE_ITEM_ADD_REQUEST); - outMsg.writeInt16(0); - outMsg.writeInt32(amount); + outMsg.writeInt16(0, "index"); + outMsg.writeInt32(amount, "amount"); } void TradeHandler::confirm() const -- cgit v1.2.3-70-g09d2