summaryrefslogtreecommitdiff
path: root/src/chathandler.cpp
diff options
context:
space:
mode:
authorYohann Ferreira <bertram@cegetel.net>2005-12-29 21:33:44 +0000
committerYohann Ferreira <bertram@cegetel.net>2005-12-29 21:33:44 +0000
commitf408b59ad69cd9877fd1a657109255545f677e37 (patch)
tree2dc5e2174d30e6a001149fc84b94ea089756cb52 /src/chathandler.cpp
parent49e964aeacd761aa3da03ff542a38ae3966aed43 (diff)
downloadmanaserv-f408b59ad69cd9877fd1a657109255545f677e37.tar.gz
manaserv-f408b59ad69cd9877fd1a657109255545f677e37.tar.bz2
manaserv-f408b59ad69cd9877fd1a657109255545f677e37.tar.xz
manaserv-f408b59ad69cd9877fd1a657109255545f677e37.zip
Adding changes thought by Elven and an option for setting the port to listen on at startup.
Diffstat (limited to 'src/chathandler.cpp')
-rw-r--r--src/chathandler.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/chathandler.cpp b/src/chathandler.cpp
index 73906275..3e5f6010 100644
--- a/src/chathandler.cpp
+++ b/src/chathandler.cpp
@@ -140,8 +140,7 @@ void ChatHandler::handleCommand(NetComputer &computer, std::string command)
LOG_INFO("Chat: Recieved unhandled command: " << command, 2)
MessageOut result;
result.writeShort(SMSG_CHAT);
- result.writeShort(0); // The Channel
- result.writeString("SERVER: Unknown or unhandled command.");
+ result.writeByte(CHATCMD_UNHANDLED_COMMAND);
computer.send(result.getPacket());
}
@@ -150,8 +149,7 @@ void ChatHandler::warnPlayerAboutBadWords(NetComputer &computer)
// We could later count if the player is really often unpolite.
MessageOut result;
result.writeShort(SMSG_CHAT);
- result.writeShort(0); // The Channel
- result.writeString("SERVER: Take care not to use bad words when you speak...");
+ result.writeByte(CHAT_USING_BAD_WORDS); // The Channel
computer.send(result.getPacket());
LOG_INFO(computer.getCharacter()->getName() << " says bad words.", 2)
@@ -171,8 +169,8 @@ void ChatHandler::announce(NetComputer &computer, std::string text)
}
else
{
- result.writeShort(SMSG_SYSTEM);
- result.writeString("Cannot make announcements. You have not enough rights.");
+ result.writeShort(SMSG_CHAT);
+ result.writeByte(CHATCMD_UNSUFFICIENT_RIGHTS);
computer.send(result.getPacket());
LOG_INFO(computer.getCharacter()->getName() <<
" couldn't make an announcement due to insufficient rights.", 2)