summaryrefslogtreecommitdiff
path: root/src/net/tmwa/playerhandler.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/tmwa/playerhandler.cpp
parent782158dfd719fb6d196f79075f275fb8599d393c (diff)
downloadmana-client-41a23cb4511e9ba3985990e2703fb3d680a23d14.tar.gz
mana-client-41a23cb4511e9ba3985990e2703fb3d680a23d14.tar.bz2
mana-client-41a23cb4511e9ba3985990e2703fb3d680a23d14.tar.xz
mana-client-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/tmwa/playerhandler.cpp')
-rw-r--r--src/net/tmwa/playerhandler.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/net/tmwa/playerhandler.cpp b/src/net/tmwa/playerhandler.cpp
index 0ada96d7..0388573f 100644
--- a/src/net/tmwa/playerhandler.cpp
+++ b/src/net/tmwa/playerhandler.cpp
@@ -21,6 +21,8 @@
#include "net/tmwa/playerhandler.h"
+#include "event.h"
+#include "eventmanager.h"
#include "game.h"
#include "localplayer.h"
#include "log.h"
@@ -36,8 +38,6 @@
#include "gui/statuswindow.h"
#include "gui/viewport.h"
-#include "gui/widgets/chattab.h"
-
#include "net/messagein.h"
#include "net/messageout.h"
@@ -308,10 +308,9 @@ void PlayerHandler::handleMessage(Net::MessageIn &msg)
int oldMoney = PlayerInfo::getAttribute(MONEY);
int newMoney = msg.readInt32();
if (newMoney > oldMoney)
- localChatTab->chatLog(strprintf(_("You picked up "
- "%s."),
- Units::formatCurrency(newMoney - oldMoney).c_str()),
- BY_SERVER);
+ SERVER_NOTICE(strprintf(_("You picked up %s."),
+ Units::formatCurrency(newMoney -
+ oldMoney).c_str()))
}
break;
case 0x0016:
@@ -344,8 +343,7 @@ void PlayerHandler::handleMessage(Net::MessageIn &msg)
if (ok != 1)
{
- localChatTab->chatLog(_("Cannot raise skill!"),
- BY_SERVER);
+ SERVER_NOTICE(_("Cannot raise skill!"))
}
PlayerInfo::setStatBase(type, value);
@@ -484,8 +482,9 @@ void PlayerHandler::handleMessage(Net::MessageIn &msg)
switch (type)
{
case 0:
- localChatTab->chatLog(_("Equip arrows first."),
- BY_SERVER);
+ {
+ SERVER_NOTICE(_("Equip arrows first."))
+ }
break;
default:
logger->log("0x013b: Unhandled message %i", type);