diff options
Diffstat (limited to 'src/net/tmwa')
-rw-r--r-- | src/net/tmwa/tradehandler.cpp | 25 | ||||
-rw-r--r-- | src/net/tmwa/tradehandler.h | 2 |
2 files changed, 27 insertions, 0 deletions
diff --git a/src/net/tmwa/tradehandler.cpp b/src/net/tmwa/tradehandler.cpp index 0a67a9202..073fe78ed 100644 --- a/src/net/tmwa/tradehandler.cpp +++ b/src/net/tmwa/tradehandler.cpp @@ -26,6 +26,8 @@ #include "being/playerinfo.h" +#include "gui/windows/tradewindow.h" + #include "net/tmwa/messageout.h" #include "net/tmwa/protocol.h" @@ -153,4 +155,27 @@ void TradeHandler::processTradeRequest(Net::MessageIn &msg) const processTradeRequestContinue(msg.readString(24, "name")); } +void TradeHandler::processTradeItemAdd(Net::MessageIn &msg) +{ + const int amount = msg.readInt32(); + const int type = msg.readInt16(); + const uint8_t identify = msg.readUInt8(); // identified flag + msg.readUInt8(); // attribute + const uint8_t refine = msg.readUInt8(); // refine + msg.skip(8); // card (4 shorts) + + if (tradeWindow) + { + if (type == 0) + { + tradeWindow->setMoney(amount); + } + else + { + tradeWindow->addItem2(type, false, amount, + refine, identify, false); + } + } +} + } // namespace TmwAthena diff --git a/src/net/tmwa/tradehandler.h b/src/net/tmwa/tradehandler.h index 39222e7ba..cdbc3e853 100644 --- a/src/net/tmwa/tradehandler.h +++ b/src/net/tmwa/tradehandler.h @@ -56,6 +56,8 @@ class TradeHandler final : public MessageHandler, public Ea::TradeHandler protected: void processTradeRequest(Net::MessageIn &msg) const; + + static void processTradeItemAdd(Net::MessageIn &msg); }; } // namespace TmwAthena |