summaryrefslogtreecommitdiff
path: root/src/net/ea
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-10-23 02:35:55 +0300
committerAndrei Karas <akaras@inbox.ru>2011-10-23 02:35:55 +0300
commitc905067448700c63f7645b08d80bffbde57a45fa (patch)
tree6f8a85bdf6a0757f26d54af41c8e99853d372019 /src/net/ea
parentf1beb8d910253a31b9dd239071effa2d518ceee0 (diff)
downloadmv-c905067448700c63f7645b08d80bffbde57a45fa.tar.gz
mv-c905067448700c63f7645b08d80bffbde57a45fa.tar.bz2
mv-c905067448700c63f7645b08d80bffbde57a45fa.tar.xz
mv-c905067448700c63f7645b08d80bffbde57a45fa.zip
Protect trade against abusing.
Diffstat (limited to 'src/net/ea')
-rw-r--r--src/net/ea/tradehandler.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/net/ea/tradehandler.cpp b/src/net/ea/tradehandler.cpp
index bdbba9715..e91541cb7 100644
--- a/src/net/ea/tradehandler.cpp
+++ b/src/net/ea/tradehandler.cpp
@@ -121,6 +121,13 @@ void TradeHandler::processTradeRequest(Net::MessageIn &msg)
void TradeHandler::processTradeResponse(Net::MessageIn &msg)
{
+ if (confirmDlg || tradePartnerName.empty()
+ || !player_relations.hasPermission(tradePartnerName, PlayerRelation::TRADE))
+ {
+ Net::getTradeHandler()->respond(false);
+ return;
+ }
+
switch (msg.readInt8())
{
case 0: // Too far away