summaryrefslogtreecommitdiff
path: root/src/chathandler.cpp
diff options
context:
space:
mode:
authorYohann Ferreira <bertram@cegetel.net>2006-01-20 23:17:19 +0000
committerYohann Ferreira <bertram@cegetel.net>2006-01-20 23:17:19 +0000
commitd318b2428878bd0e35b189b3e6d3bffd825da25c (patch)
treedc61bd08aec87a5293e1ca072079652ad6047423 /src/chathandler.cpp
parent7960ff184f15a3b6029fef8e5100d24a6c556afe (diff)
downloadmanaserv-d318b2428878bd0e35b189b3e6d3bffd825da25c.tar.gz
manaserv-d318b2428878bd0e35b189b3e6d3bffd825da25c.tar.bz2
manaserv-d318b2428878bd0e35b189b3e6d3bffd825da25c.tar.xz
manaserv-d318b2428878bd0e35b189b3e6d3bffd825da25c.zip
Chat channeling commit part 3. Is now linked with the connection handler to chat in a specific channel. Also made some fixes on the chat channeling.
Diffstat (limited to 'src/chathandler.cpp')
-rw-r--r--src/chathandler.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/chathandler.cpp b/src/chathandler.cpp
index e2f17c89..d57fe8d4 100644
--- a/src/chathandler.cpp
+++ b/src/chathandler.cpp
@@ -28,12 +28,6 @@
#include "utils/logger.h"
#include "utils/slangsfilter.h"
-ChatHandler::ChatHandler()
-{
- // TODO: Implement loading public chat channels from db.
- // That require adding a table for that.
-}
-
void ChatHandler::receiveMessage(NetComputer &computer, MessageIn &message)
{
// If not logged in...
@@ -84,7 +78,7 @@ void ChatHandler::receiveMessage(NetComputer &computer, MessageIn &message)
// to the characters around him in the map.
// We, then, look for every characters around him and
// send the message to them.
- // By 'around', let's say 10 tiles square wide for now.
+ // By 'around', let's say AROUND_AREA_IN_TILES tiles square wide.
sayAround(computer, text);
}
}
@@ -215,12 +209,13 @@ void ChatHandler::sayInChannel(NetComputer &computer, short channel, std::string
MessageOut result;
LOG_INFO( computer.getCharacter()->getName() << " says in channel " << channel
<< ": " << text, 2)
- // TODO: Send it to every beings in channel
+ // Send it to every beings in channel
result.writeShort(SMSG_CHAT);
result.writeShort(channel);
std::string say = computer.getCharacter()->getName();
say += ": ";
say += text;
result.writeString(say);
+ connectionHandler->sendInChannel(channel, result);
}