summaryrefslogtreecommitdiff
path: root/src/net/manaserv/tradehandler.cpp
diff options
context:
space:
mode:
authorChuck Miller <shadowmil@gmail.com>2010-07-18 23:02:25 -0400
committerChuck Miller <shadowmil@gmail.com>2010-07-18 23:10:02 -0400
commit41a23cb4511e9ba3985990e2703fb3d680a23d14 (patch)
tree2bf03217e3c3b0f28aed5649e2e43cf2b965bd1d /src/net/manaserv/tradehandler.cpp
parent782158dfd719fb6d196f79075f275fb8599d393c (diff)
downloadmana-41a23cb4511e9ba3985990e2703fb3d680a23d14.tar.gz
mana-41a23cb4511e9ba3985990e2703fb3d680a23d14.tar.bz2
mana-41a23cb4511e9ba3985990e2703fb3d680a23d14.tar.xz
mana-41a23cb4511e9ba3985990e2703fb3d680a23d14.zip
Move the majority of the netcode's server messages to the event system
There is still a good way to go, but this should get us started Reviewed-by: Jared Adams
Diffstat (limited to 'src/net/manaserv/tradehandler.cpp')
-rw-r--r--src/net/manaserv/tradehandler.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/net/manaserv/tradehandler.cpp b/src/net/manaserv/tradehandler.cpp
index d5505075..5f9fa83e 100644
--- a/src/net/manaserv/tradehandler.cpp
+++ b/src/net/manaserv/tradehandler.cpp
@@ -22,6 +22,8 @@
#include "net/manaserv/tradehandler.h"
#include "actorspritemanager.h"
+#include "event.h"
+#include "eventmanager.h"
#include "item.h"
#include "localplayer.h"
#include "playerinfo.h"
@@ -29,8 +31,6 @@
#include "gui/confirmdialog.h"
#include "gui/trade.h"
-#include "gui/widgets/chattab.h"
-
#include "net/net.h"
#include "net/manaserv/connection.h"
@@ -87,16 +87,15 @@ TradeHandler::TradeHandler():
};
handledMessages = _messages;
tradeHandler = this;
-
}
void TradeHandler::setAcceptTradeRequests(bool acceptTradeRequests)
{
mAcceptTradeRequests = acceptTradeRequests;
if (mAcceptTradeRequests)
- localChatTab->chatLog(_("Accepting incoming trade requests."), BY_SERVER);
+ SERVER_NOTICE(_("Accepting incoming trade requests."))
else
- localChatTab->chatLog(_("Ignoring incoming trade requests."), BY_SERVER);
+ SERVER_NOTICE(_("Ignoring incoming trade requests."))
}
void TradeHandler::handleMessage(Net::MessageIn &msg)
@@ -145,16 +144,16 @@ void TradeHandler::handleMessage(Net::MessageIn &msg)
case GPMSG_TRADE_AGREED:
tradeWindow->receivedOk(false);
break;
-
+
case GPMSG_TRADE_CANCEL:
- localChatTab->chatLog(_("Trade canceled."), BY_SERVER);
+ SERVER_NOTICE(_("Trade canceled."))
tradeWindow->setVisible(false);
tradeWindow->reset();
PlayerInfo::setTrading(false);
break;
case GPMSG_TRADE_COMPLETE:
- localChatTab->chatLog(_("Trade completed."), BY_SERVER);
+ SERVER_NOTICE(_("Trade completed."))
tradeWindow->setVisible(false);
tradeWindow->reset();
PlayerInfo::setTrading(false);