summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-12-16 16:13:08 +0300
committerAndrei Karas <akaras@inbox.ru>2014-12-16 16:13:08 +0300
commit901b607d96bb59c012e679918d9ca083d2ad3c2f (patch)
tree65208846072189c6c8b9c9185d4d7bcaa6ec0f4f
parente79d2d215ed5c3a4aee43535fb72c12366c32cea (diff)
downloadmv-901b607d96bb59c012e679918d9ca083d2ad3c2f.tar.gz
mv-901b607d96bb59c012e679918d9ca083d2ad3c2f.tar.bz2
mv-901b607d96bb59c012e679918d9ca083d2ad3c2f.tar.xz
mv-901b607d96bb59c012e679918d9ca083d2ad3c2f.zip
Move processTradeResponse from ea namespace into tmwa.
-rw-r--r--src/net/ea/tradehandler.cpp13
-rw-r--r--src/net/ea/tradehandler.h2
-rw-r--r--src/net/tmwa/tradehandler.cpp18
-rw-r--r--src/net/tmwa/tradehandler.h2
4 files changed, 20 insertions, 15 deletions
diff --git a/src/net/ea/tradehandler.cpp b/src/net/ea/tradehandler.cpp
index 2a478d953..d99f5da59 100644
--- a/src/net/ea/tradehandler.cpp
+++ b/src/net/ea/tradehandler.cpp
@@ -64,19 +64,6 @@ void TradeHandler::removeItem(const int slotNum A_UNUSED,
{
}
-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);
-}
-
void TradeHandler::processTradeResponseContinue(const uint8_t type)
{
switch (type)
diff --git a/src/net/ea/tradehandler.h b/src/net/ea/tradehandler.h
index 186a9f981..d9cff1cdb 100644
--- a/src/net/ea/tradehandler.h
+++ b/src/net/ea/tradehandler.h
@@ -44,8 +44,6 @@ class TradeHandler notfinal : public Net::TradeHandler
const int amount) const override final;
protected:
- static void processTradeResponse(Net::MessageIn &msg);
-
static void processTradeOk(Net::MessageIn &msg);
static void processTradeCancel(Net::MessageIn &msg);
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
diff --git a/src/net/tmwa/tradehandler.h b/src/net/tmwa/tradehandler.h
index 715c69838..5cfd3300c 100644
--- a/src/net/tmwa/tradehandler.h
+++ b/src/net/tmwa/tradehandler.h
@@ -60,6 +60,8 @@ class TradeHandler final : public MessageHandler, public Ea::TradeHandler
static void processTradeItemAdd(Net::MessageIn &msg);
static void processTradeItemAddResponse(Net::MessageIn &msg);
+
+ static void processTradeResponse(Net::MessageIn &msg);
};
} // namespace TmwAthena