summaryrefslogtreecommitdiff
path: root/src/commandhandler.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-08-27 16:49:12 +0300
committerAndrei Karas <akaras@inbox.ru>2014-08-27 16:49:12 +0300
commit8f173afdd496eda7fddd2b166e11626651600501 (patch)
tree422b3dde21b2f040f953cf26f8433e74aec2e2e0 /src/commandhandler.cpp
parent56178bf525b07582389493158ac90e2ab7721571 (diff)
downloadmanaverse-8f173afdd496eda7fddd2b166e11626651600501.tar.gz
manaverse-8f173afdd496eda7fddd2b166e11626651600501.tar.bz2
manaverse-8f173afdd496eda7fddd2b166e11626651600501.tar.xz
manaverse-8f173afdd496eda7fddd2b166e11626651600501.zip
Move chat command /debugspawn into actions.
Diffstat (limited to 'src/commandhandler.cpp')
-rw-r--r--src/commandhandler.cpp32
1 files changed, 0 insertions, 32 deletions
diff --git a/src/commandhandler.cpp b/src/commandhandler.cpp
index b4537e431..fb46dd63c 100644
--- a/src/commandhandler.cpp
+++ b/src/commandhandler.cpp
@@ -38,30 +38,10 @@ CommandHandler *commandHandler = nullptr;
CommandHandler::CommandHandler() :
mCommands()
{
- const int sz = sizeof(commands) / sizeof(CommandInfo);
- for (int f = 0; f < sz; f ++)
- {
- const std::string name = commands[f].name;
- if (!name.empty())
- mCommands[name] = &commands[f];
- }
}
void CommandHandler::addChatCommands(std::list<std::string> &arr)
{
- const int sz = sizeof(commands) / sizeof(CommandInfo);
- for (int f = 0; f < sz; f ++)
- {
- const CommandInfo &info = commands[f];
- const std::string name = info.name;
- if (!name.empty())
- {
- std::string cmd = std::string("/").append(name);
- if (info.useArgs)
- cmd.append(" ");
- arr.push_back(cmd);
- }
- }
}
void CommandHandler::handleCommands(const std::string &command,
@@ -124,32 +104,20 @@ void CommandHandler::callFunc(const CommandInfo &info,
void CommandHandler::invokeCommand(const int type)
{
- if (type < 0 || type >= END_COMMANDS)
- return;
- callFunc(commands[type], "", nullptr);
}
void CommandHandler::invokeCommand(const int type,
ChatTab *const tab)
{
- if (type < 0 || type >= END_COMMANDS)
- return;
- callFunc(commands[type], "", tab);
}
void CommandHandler::invokeCommand(const int type,
const std::string &args)
{
- if (type < 0 || type >= END_COMMANDS)
- return;
- callFunc(commands[type], args, nullptr);
}
void CommandHandler::invokeCommand(const int type,
const std::string &args,
ChatTab *const tab)
{
- if (type < 0 || type >= END_COMMANDS)
- return;
- callFunc(commands[type], args, tab);
}