From e91747e5025d5e37b2b856e30d6fb5da6968364c Mon Sep 17 00:00:00 2001 From: Roderic Morris Date: Mon, 7 Jul 2008 16:59:55 +0000 Subject: get rid of channel registering related code --- src/commandhandler.cpp | 38 ++++++++------------------------------ 1 file changed, 8 insertions(+), 30 deletions(-) (limited to 'src/commandhandler.cpp') diff --git a/src/commandhandler.cpp b/src/commandhandler.cpp index 1dadc236..8f0aa907 100644 --- a/src/commandhandler.cpp +++ b/src/commandhandler.cpp @@ -57,12 +57,6 @@ void CommandHandler::handleCommand(const std::string &command) { handleMsg(args); } - /* - else if (type == "channel") - { - handleChannel(args); - } - */ else if (type == "join") { handleJoin(args); @@ -119,8 +113,7 @@ void CommandHandler::handleHelp(const std::string &args) chatWindow->chatLog("/msg > Send a private message to a user"); chatWindow->chatLog("/list > Display all public channels"); chatWindow->chatLog("/users > Lists the users in the current channel"); -// chatWindow->chatLog("/channel > Register a new channel"); - chatWindow->chatLog("/join > Join an already registered channel"); + chatWindow->chatLog("/join > Join or create a 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)"); @@ -157,6 +150,7 @@ void CommandHandler::handleHelp(const std::string &args) { chatWindow->chatLog("Command: /join "); chatWindow->chatLog("This command makes you enter ."); + chatWindow->chatLog("If doesn't exist, it's created."); } else if (args == "list") { @@ -177,6 +171,12 @@ void CommandHandler::handleHelp(const std::string &args) chatWindow->chatLog("If the has spaces in it, enclose it in " "double quotes (\")."); } + else if (args == "quit") + { + chatWindow->chatLog("Command: /quit"); + chatWindow->chatLog("This command leaves the current channel."); + chatWindow->chatLog("If you're the last person in the channel, it will be deleted."); + } else if (args == "topic") { chatWindow->chatLog("Command: /topic "); @@ -223,28 +223,6 @@ void CommandHandler::handleMsg(const std::string &args) Net::ChatServer::privMsg(recipient, text); } -void CommandHandler::handleChannel(const std::string &args) -{ - std::string::size_type pos = args.find(" "); - std::string name(args, 0, pos); - std::string password; - std::string announcement; - if(pos == std::string::npos) - { - password = std::string(); - announcement = std::string(); - } - else - { - password = std::string(args, pos + 1, args.find(" ", pos + 1) - pos - 1); - pos = args.find("\""); - announcement = std::string(args, pos == std::string::npos ? args.size() : - pos + 1, args.size() - pos - 2); - } - chatWindow->chatLog("Requesting to register channel " + name); - Net::ChatServer::registerChannel(name, announcement, password); -} - void CommandHandler::handleJoin(const std::string &args) { std::string::size_type pos = args.find(' '); -- cgit v1.2.3-70-g09d2