diff options
author | Guillaume Melquiond <guillaume.melquiond@gmail.com> | 2006-08-26 13:28:35 +0000 |
---|---|---|
committer | Guillaume Melquiond <guillaume.melquiond@gmail.com> | 2006-08-26 13:28:35 +0000 |
commit | 5cc5c903df7b535c6bf27987b89a405812d89735 (patch) | |
tree | f6055dd2a3beb0ba4c057ed591d18b0441141b04 /src/net/chathandler.cpp | |
parent | 15b008dd95252fea93d84d5bfbfa3862c267c50e (diff) | |
download | mana-5cc5c903df7b535c6bf27987b89a405812d89735.tar.gz mana-5cc5c903df7b535c6bf27987b89a405812d89735.tar.bz2 mana-5cc5c903df7b535c6bf27987b89a405812d89735.tar.xz mana-5cc5c903df7b535c6bf27987b89a405812d89735.zip |
Implemented "say around" chat.
Diffstat (limited to 'src/net/chathandler.cpp')
-rw-r--r-- | src/net/chathandler.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/net/chathandler.cpp b/src/net/chathandler.cpp index 795b2a27..02f99c41 100644 --- a/src/net/chathandler.cpp +++ b/src/net/chathandler.cpp @@ -42,11 +42,14 @@ extern Being *player_node; ChatHandler::ChatHandler() { static const Uint16 _messages[] = { + GPMSG_SAY, + /* SMSG_BEING_CHAT, SMSG_PLAYER_CHAT, SMSG_GM_CHAT, SMSG_WHO_ANSWER, 0x10c, // MVP + */ 0 }; handledMessages = _messages; @@ -60,6 +63,20 @@ void ChatHandler::handleMessage(MessageIn &msg) switch (msg.getId()) { + case GPMSG_SAY: + being = beingManager->findBeing(msg.readLong()); + chatMsg = msg.readString(); + if (being) + { + chatWindow->chatLog(being->getName() + " : " + chatMsg, being == player_node ? BY_PLAYER : BY_OTHER); + being->setSpeech(chatMsg, SPEECH_TIME); + } + else + { + chatWindow->chatLog("John Doe : " + chatMsg, BY_OTHER); + } + break; + // Received speech from being case SMSG_BEING_CHAT: chatMsgLength = msg.readShort() - 8; |