From 901b607d96bb59c012e679918d9ca083d2ad3c2f Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 16 Dec 2014 16:13:08 +0300 Subject: Move processTradeResponse from ea namespace into tmwa. --- src/net/tmwa/tradehandler.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/net/tmwa/tradehandler.cpp') diff --git a/src/net/tmwa/tradehandler.cpp b/src/net/tmwa/tradehandler.cpp index 141f2d8ce..f85bdfc49 100644 --- a/src/net/tmwa/tradehandler.cpp +++ b/src/net/tmwa/tradehandler.cpp @@ -27,7 +27,9 @@ #include "notifymanager.h" #include "being/playerinfo.h" +#include "being/playerrelations.h" +#include "gui/windows/confirmdialog.h" #include "gui/windows/tradewindow.h" #include "net/serverfeatures.h" @@ -45,6 +47,9 @@ extern Net::TradeHandler *tradeHandler; +extern std::string tradePartnerName; +extern ConfirmDialog *confirmDlg; + namespace TmwAthena { @@ -252,4 +257,17 @@ void TradeHandler::processTradeItemAddResponse(Net::MessageIn &msg) } } +void TradeHandler::processTradeResponse(Net::MessageIn &msg) +{ + if (confirmDlg || tradePartnerName.empty() + || !player_relations.hasPermission(tradePartnerName, + PlayerRelation::TRADE)) + { + tradeHandler->respond(false); + return; + } + const uint8_t type = msg.readUInt8("type"); + processTradeResponseContinue(type); +} + } // namespace TmwAthena -- cgit v1.2.3-70-g09d2