diff options
author | Roderic Morris <roderic@ccs.neu.edu> | 2008-06-25 21:12:44 +0000 |
---|---|---|
committer | Roderic Morris <roderic@ccs.neu.edu> | 2008-06-25 21:12:44 +0000 |
commit | a34a4692200eaf5b3ec8a7de75699a46aefd8b98 (patch) | |
tree | d73f15d55e7f784e99d92672f9ccbe69d64d7e69 /src/commandhandler.cpp | |
parent | a0b6e09737b7b416a38c08d8e1d6744a4cc12f7d (diff) | |
download | mana-client-a34a4692200eaf5b3ec8a7de75699a46aefd8b98.tar.gz mana-client-a34a4692200eaf5b3ec8a7de75699a46aefd8b98.tar.bz2 mana-client-a34a4692200eaf5b3ec8a7de75699a46aefd8b98.tar.xz mana-client-a34a4692200eaf5b3ec8a7de75699a46aefd8b98.zip |
handle topic changes and guild events
Diffstat (limited to 'src/commandhandler.cpp')
-rw-r--r-- | src/commandhandler.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/commandhandler.cpp b/src/commandhandler.cpp index 07184f66..465f572d 100644 --- a/src/commandhandler.cpp +++ b/src/commandhandler.cpp @@ -76,6 +76,10 @@ void CommandHandler::handleCommand(const std::string &command) { handleQuit(); } + else if (type == "topic") + { + handleTopic(args); + } else if (type == "admin") { Net::GameServer::Player::say("/" + args); @@ -107,6 +111,7 @@ void CommandHandler::handleHelp() chatWindow->chatLog("/listusers > Lists the users in the current channel"); chatWindow->chatLog("/channel > Register a new channel"); chatWindow->chatLog("/join > Join an already registered channel"); + chatWindow->chatLog("/topic > Set the topic of the current channel"); chatWindow->chatLog("/quit > Leave a channel"); chatWindow->chatLog("/admin > Send a command to the server (GM only)"); chatWindow->chatLog("/clear > Clears this window"); @@ -171,6 +176,18 @@ void CommandHandler::handleListUsers() Net::ChatServer::getUserList(chatWindow->getFocused()); } +void CommandHandler::handleTopic(const std::string &args) +{ + if (Channel *channel = channelManager->findByName(chatWindow->getFocused())) + { + Net::ChatServer::setChannelTopic(channel->getId(), args); + } + else + { + chatWindow->chatLog("Unable to set this channel's topic", BY_CHANNEL); + } +} + void CommandHandler::handleQuit() { if (Channel *channel = channelManager->findByName(chatWindow->getFocused())) |