summaryrefslogtreecommitdiff
path: root/src/net/ea
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/ea')
-rw-r--r--src/net/ea/tradehandler.cpp13
-rw-r--r--src/net/ea/tradehandler.h6
2 files changed, 9 insertions, 10 deletions
diff --git a/src/net/ea/tradehandler.cpp b/src/net/ea/tradehandler.cpp
index 41e8be6d7..1b0067f7c 100644
--- a/src/net/ea/tradehandler.cpp
+++ b/src/net/ea/tradehandler.cpp
@@ -64,20 +64,20 @@ void TradeHandler::removeItem(const int slotNum A_UNUSED,
{
}
-void TradeHandler::processTradeResponse(Net::MessageIn &msg) const
+void TradeHandler::processTradeResponse(Net::MessageIn &msg)
{
if (confirmDlg || tradePartnerName.empty()
|| !player_relations.hasPermission(tradePartnerName,
PlayerRelation::TRADE))
{
- respond(false);
+ tradeHandler->respond(false);
return;
}
const uint8_t type = msg.readUInt8("type");
processTradeResponseContinue(type);
}
-void TradeHandler::processTradeResponseContinue(const uint8_t type) const
+void TradeHandler::processTradeResponseContinue(const uint8_t type)
{
switch (type)
{
@@ -164,14 +164,13 @@ void TradeHandler::processTradeComplete(Net::MessageIn &msg A_UNUSED)
}
void TradeHandler::processTradeRequestContinue(const std::string &partner)
- const
{
if (player_relations.hasPermission(partner,
PlayerRelation::TRADE))
{
if (PlayerInfo::isTrading() || confirmDlg)
{
- respond(false);
+ tradeHandler->respond(false);
return;
}
@@ -194,13 +193,13 @@ void TradeHandler::processTradeRequestContinue(const std::string &partner)
}
else
{
- respond(true);
+ tradeHandler->respond(true);
}
}
}
else
{
- respond(false);
+ tradeHandler->respond(false);
return;
}
}
diff --git a/src/net/ea/tradehandler.h b/src/net/ea/tradehandler.h
index c7c1c0e72..186a9f981 100644
--- a/src/net/ea/tradehandler.h
+++ b/src/net/ea/tradehandler.h
@@ -44,7 +44,7 @@ class TradeHandler notfinal : public Net::TradeHandler
const int amount) const override final;
protected:
- void processTradeResponse(Net::MessageIn &msg) const;
+ static void processTradeResponse(Net::MessageIn &msg);
static void processTradeOk(Net::MessageIn &msg);
@@ -52,9 +52,9 @@ class TradeHandler notfinal : public Net::TradeHandler
static void processTradeComplete(Net::MessageIn &msg);
- void processTradeRequestContinue(const std::string &partner) const;
+ static void processTradeRequestContinue(const std::string &partner);
- void processTradeResponseContinue(const uint8_t type) const;
+ static void processTradeResponseContinue(const uint8_t type);
};
} // namespace Ea