summaryrefslogtreecommitdiff
path: root/src/net/tmwa/chathandler.cpp
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 /src/net/tmwa/chathandler.cpp
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
Diffstat (limited to 'src/net/tmwa/chathandler.cpp')
-rw-r--r--src/net/tmwa/chathandler.cpp13
1 files changed, 9 insertions, 4 deletions
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