summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2010-08-04 20:38:04 -0600
committerJared Adams <jaxad0127@gmail.com>2010-08-04 21:00:29 -0600
commit154ea41225505eee0c77652a04738d845a2e93cd (patch)
tree295b39f2881d85c26b51d7187cd4c8aab51de53e
parent7773f04b4beb1a24214fe1a367b645a689d2c852 (diff)
downloadmana-154ea41225505eee0c77652a04738d845a2e93cd.tar.gz
mana-154ea41225505eee0c77652a04738d845a2e93cd.tar.bz2
mana-154ea41225505eee0c77652a04738d845a2e93cd.tar.xz
mana-154ea41225505eee0c77652a04738d845a2e93cd.zip
Remove some unused headers and fix some chat events
Reviewed-by: Chuck Miller
-rw-r--r--src/actorspritemanager.cpp2
-rw-r--r--src/commandhandler.cpp2
-rw-r--r--src/net/manaserv/buysellhandler.cpp1
-rw-r--r--src/net/manaserv/chathandler.cpp5
-rw-r--r--src/net/manaserv/guildhandler.cpp4
-rw-r--r--src/net/manaserv/inventoryhandler.cpp5
-rw-r--r--src/net/manaserv/playerhandler.cpp1
-rw-r--r--src/net/tmwa/chathandler.cpp13
8 files changed, 14 insertions, 19 deletions
diff --git a/src/actorspritemanager.cpp b/src/actorspritemanager.cpp
index 288c772f..dd979c63 100644
--- a/src/actorspritemanager.cpp
+++ b/src/actorspritemanager.cpp
@@ -23,8 +23,6 @@
#include "localplayer.h"
-#include "gui/viewport.h"
-
#include "utils/stringutils.h"
#include "utils/dtor.h"
diff --git a/src/commandhandler.cpp b/src/commandhandler.cpp
index 2567b3b4..a39e13bd 100644
--- a/src/commandhandler.cpp
+++ b/src/commandhandler.cpp
@@ -27,8 +27,6 @@
#include "localplayer.h"
#include "playerrelations.h"
-#include "gui/chat.h"
-
#include "gui/widgets/channeltab.h"
#include "gui/widgets/chattab.h"
diff --git a/src/net/manaserv/buysellhandler.cpp b/src/net/manaserv/buysellhandler.cpp
index c1efca0d..d4187db7 100644
--- a/src/net/manaserv/buysellhandler.cpp
+++ b/src/net/manaserv/buysellhandler.cpp
@@ -26,7 +26,6 @@
#include "playerinfo.h"
#include "gui/buy.h"
-#include "gui/chat.h"
#include "gui/sell.h"
#include "net/messagein.h"
diff --git a/src/net/manaserv/chathandler.cpp b/src/net/manaserv/chathandler.cpp
index aabe8bb4..9a8f6e34 100644
--- a/src/net/manaserv/chathandler.cpp
+++ b/src/net/manaserv/chathandler.cpp
@@ -28,8 +28,6 @@
#include "channelmanager.h"
#include "eventmanager.h"
-#include "gui/chat.h"
-
#include "gui/widgets/channeltab.h"
#include "net/manaserv/connection.h"
@@ -167,6 +165,9 @@ void ChatHandler::handleGameChatMessage(Net::MessageIn &msg)
Mana::Event event(being == player_node ? "Player" : "Being");
event.setString("message", mes);
+ event.setString("text", chatMsg);
+ event.setString("nick", being->getName());
+ event.setInt("beingId", id);
Mana::EventManager::trigger("Chat", event);
}
diff --git a/src/net/manaserv/guildhandler.cpp b/src/net/manaserv/guildhandler.cpp
index 1c9625bf..750fadda 100644
--- a/src/net/manaserv/guildhandler.cpp
+++ b/src/net/manaserv/guildhandler.cpp
@@ -28,10 +28,10 @@
#include "channel.h"
#include "channelmanager.h"
-#include "gui/widgets/channeltab.h"
-#include "gui/chat.h"
#include "gui/socialwindow.h"
+#include "gui/widgets/channeltab.h"
+
#include "net/messagein.h"
#include "net/net.h"
diff --git a/src/net/manaserv/inventoryhandler.cpp b/src/net/manaserv/inventoryhandler.cpp
index 3f8aa8b5..8622627e 100644
--- a/src/net/manaserv/inventoryhandler.cpp
+++ b/src/net/manaserv/inventoryhandler.cpp
@@ -28,8 +28,6 @@
#include "localplayer.h"
#include "playerinfo.h"
-#include "gui/chat.h"
-
#include "net/manaserv/connection.h"
#include "net/manaserv/messagein.h"
#include "net/manaserv/messageout.h"
@@ -37,8 +35,6 @@
#include "resources/iteminfo.h"
-#include "log.h" // <<< REMOVE ME!
-
extern Net::InventoryHandler *inventoryHandler;
namespace ManaServ {
@@ -105,7 +101,6 @@ void InventoryHandler::unequipItem(const Item *item)
// Tidy equipment directly to avoid weapon still shown bug, for instance
int equipSlot = item->getInvIndex();
- logger->log("Unequipping %d", equipSlot);
mEquips.setEquipment(equipSlot, 0);
}
diff --git a/src/net/manaserv/playerhandler.cpp b/src/net/manaserv/playerhandler.cpp
index ee67c359..696ec037 100644
--- a/src/net/manaserv/playerhandler.cpp
+++ b/src/net/manaserv/playerhandler.cpp
@@ -31,7 +31,6 @@
#include "playerinfo.h"
#include "configuration.h"
-#include "gui/chat.h"
#include "gui/gui.h"
#include "gui/okdialog.h"
#include "gui/viewport.h"
diff --git a/src/net/tmwa/chathandler.cpp b/src/net/tmwa/chathandler.cpp
index 55259624..b3400528 100644
--- a/src/net/tmwa/chathandler.cpp
+++ b/src/net/tmwa/chathandler.cpp
@@ -189,19 +189,24 @@ void ChatHandler::handleMessage(Net::MessageIn &msg)
break;
chatMsg = msg.readString(chatMsgLength);
- std::string::size_type pos = chatMsg.find(" : ", 0);
if (msg.getId() == SMSG_PLAYER_CHAT)
{
- Mana::Event event("Player");
- event.setString("message", chatMsg);
- Mana::EventManager::trigger("Chat", event);
+ std::string::size_type pos = chatMsg.find(" : ", 0);
+ std::string mes = chatMsg;
if (pos != std::string::npos)
chatMsg.erase(0, pos + 3);
trim(chatMsg);
+ Mana::Event event("Player");
+ event.setString("message", mes);
+ event.setString("text", chatMsg);
+ event.setString("nick", player_node->getName());
+ event.setInt("beingId", player_node->getId());
+ Mana::EventManager::trigger("Chat", event);
+
player_node->setSpeech(chatMsg, SPEECH_TIME);
}
else