summaryrefslogtreecommitdiff
path: root/src/commandhandler.cpp
diff options
context:
space:
mode:
authorDavid Athay <ko2fan@gmail.com>2008-07-07 14:34:40 +0000
committerDavid Athay <ko2fan@gmail.com>2008-07-07 14:34:40 +0000
commit9bf9b2c706290b61af0f66f11ff1b3cd37d72904 (patch)
tree613af16c659de454217ce69ed819789d5f35a427 /src/commandhandler.cpp
parent183bc340bd3e062a4c6df4d66cc2843582bcec94 (diff)
downloadmana-9bf9b2c706290b61af0f66f11ff1b3cd37d72904.tar.gz
mana-9bf9b2c706290b61af0f66f11ff1b3cd37d72904.tar.bz2
mana-9bf9b2c706290b61af0f66f11ff1b3cd37d72904.tar.xz
mana-9bf9b2c706290b61af0f66f11ff1b3cd37d72904.zip
Added /party command.
Diffstat (limited to 'src/commandhandler.cpp')
-rw-r--r--src/commandhandler.cpp21
1 files changed, 21 insertions, 0 deletions
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 <command>");
}
else if (args == "admin")
@@ -164,6 +170,13 @@ void CommandHandler::handleHelp(const std::string &args)
chatWindow->chatLog("If the <nick> has spaces in it, enclose it in "
"double quotes (\").");
}
+ else if (args == "party")
+ {
+ chatWindow->chatLog("Command: /party <nick>");
+ chatWindow->chatLog("This command invites <nick> to party with you.");
+ chatWindow->chatLog("If the <nick> has spaces in it, enclose it in "
+ "double quotes (\").");
+ }
else if (args == "topic")
{
chatWindow->chatLog("Command: /topic <message>");
@@ -279,3 +292,11 @@ void CommandHandler::handleClear()
{
chatWindow->clearTab(chatWindow->getFocused());
}
+
+void CommandHandler::handleParty(const std::string &args)
+{
+ if (args != "")
+ {
+ player_node->inviteToParty(args);
+ }
+}