From 9bf9b2c706290b61af0f66f11ff1b3cd37d72904 Mon Sep 17 00:00:00 2001 From: David Athay Date: Mon, 7 Jul 2008 14:34:40 +0000 Subject: Added /party command. --- src/commandhandler.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/commandhandler.cpp') diff --git a/src/commandhandler.cpp b/src/commandhandler.cpp index 7e20deff..1dadc236 100644 --- a/src/commandhandler.cpp +++ b/src/commandhandler.cpp @@ -26,6 +26,7 @@ #include "channelmanager.h" #include "channel.h" #include "game.h" +#include "localplayer.h" #include "gui/chat.h" #include "net/chatserver/chatserver.h" #include "net/gameserver/player.h" @@ -90,6 +91,10 @@ void CommandHandler::handleCommand(const std::string &command) { handleClear(); } + else if (type == "party") + { + handleParty(args); + } else { chatWindow->chatLog("Unknown command"); @@ -120,6 +125,7 @@ void CommandHandler::handleHelp(const std::string &args) chatWindow->chatLog("/quit > Leave a channel"); chatWindow->chatLog("/admin > Send a command to the server (GM only)"); chatWindow->chatLog("/clear > Clears this window"); + chatWindow->chatLog("/party > Invite a user to party"); chatWindow->chatLog("For more information, type /help "); } else if (args == "admin") @@ -164,6 +170,13 @@ void CommandHandler::handleHelp(const std::string &args) chatWindow->chatLog("If the has spaces in it, enclose it in " "double quotes (\")."); } + else if (args == "party") + { + chatWindow->chatLog("Command: /party "); + chatWindow->chatLog("This command invites to party with you."); + chatWindow->chatLog("If the has spaces in it, enclose it in " + "double quotes (\")."); + } else if (args == "topic") { chatWindow->chatLog("Command: /topic "); @@ -279,3 +292,11 @@ void CommandHandler::handleClear() { chatWindow->clearTab(chatWindow->getFocused()); } + +void CommandHandler::handleParty(const std::string &args) +{ + if (args != "") + { + player_node->inviteToParty(args); + } +} -- cgit v1.2.3-60-g2f50