diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2008-05-14 18:57:32 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2008-05-14 18:57:32 +0000 |
commit | 2d648c5dc29a1ceae154194c23c799c7076894b4 (patch) | |
tree | f6c31a30260b80713257be211b139263b3291098 /src/net/tradehandler.cpp | |
parent | 41906acb990895831e3b2c39102f41c9b580ae10 (diff) | |
download | mana-2d648c5dc29a1ceae154194c23c799c7076894b4.tar.gz mana-2d648c5dc29a1ceae154194c23c799c7076894b4.tar.bz2 mana-2d648c5dc29a1ceae154194c23c799c7076894b4.tar.xz mana-2d648c5dc29a1ceae154194c23c799c7076894b4.zip |
Added ability to define friends, players you want to ignore or disregard and
configure whether trading is allowed. Based on new popup code, configuration
improvements to store hierarchical data and a table model.
Diffstat (limited to 'src/net/tradehandler.cpp')
-rw-r--r-- | src/net/tradehandler.cpp | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/src/net/tradehandler.cpp b/src/net/tradehandler.cpp index 57060684..9b3c590e 100644 --- a/src/net/tradehandler.cpp +++ b/src/net/tradehandler.cpp @@ -28,6 +28,7 @@ #include "../item.h" #include "../localplayer.h" +#include "../player_relations.h" #include "../gui/chat.h" #include "../gui/confirm_dialog.h" @@ -48,8 +49,7 @@ namespace { } listener; } -TradeHandler::TradeHandler(): - mAcceptTradeRequests(true) +TradeHandler::TradeHandler() { static const Uint16 _messages[] = { SMSG_TRADE_REQUEST, @@ -64,15 +64,6 @@ TradeHandler::TradeHandler(): handledMessages = _messages; } -void TradeHandler::setAcceptTradeRequests(bool acceptTradeRequests) -{ - mAcceptTradeRequests = acceptTradeRequests; - if (mAcceptTradeRequests) { - chatWindow->chatLog("Accepting incoming trade requests", BY_SERVER); - } else { - chatWindow->chatLog("Ignoring incoming trade requests", BY_SERVER); - } -} void TradeHandler::handleMessage(MessageIn *msg) { @@ -87,7 +78,7 @@ void TradeHandler::handleMessage(MessageIn *msg) // special message about the player being occupied. tradePartnerName = msg->readString(24); - if (mAcceptTradeRequests) + if (player_relations.hasPermission(tradePartnerName, PlayerRelation::TRADE)) { if (!player_node->tradeRequestOk()) { |