From 549d21c0c9995c2120ea539cfb3551817df214a2 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 4 Sep 2014 19:33:37 +0300 Subject: Move processTradeItemAdd from ea namespace into eathena and tmwa. --- src/net/eathena/tradehandler.cpp | 25 +++++++++++++++++++++++++ src/net/eathena/tradehandler.h | 2 ++ 2 files changed, 27 insertions(+) (limited to 'src/net/eathena') diff --git a/src/net/eathena/tradehandler.cpp b/src/net/eathena/tradehandler.cpp index f73584deb..4de0ee779 100644 --- a/src/net/eathena/tradehandler.cpp +++ b/src/net/eathena/tradehandler.cpp @@ -26,6 +26,8 @@ #include "being/playerinfo.h" +#include "gui/windows/tradewindow.h" + #include "net/eathena/messageout.h" #include "net/eathena/protocol.h" @@ -166,4 +168,27 @@ void TradeHandler::processTradeResponse2(Net::MessageIn &msg) const msg.readInt16("base level"); } +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 EAthena diff --git a/src/net/eathena/tradehandler.h b/src/net/eathena/tradehandler.h index f112c8426..929b48ced 100644 --- a/src/net/eathena/tradehandler.h +++ b/src/net/eathena/tradehandler.h @@ -58,6 +58,8 @@ class TradeHandler final : public MessageHandler, public Ea::TradeHandler void processTradeRequest(Net::MessageIn &msg) const; void processTradeResponse2(Net::MessageIn &msg) const; + + static void processTradeItemAdd(Net::MessageIn &msg); }; } // namespace EAthena -- cgit v1.2.3-70-g09d2