Remove unused cluster commands

fixes #11748
This commit is contained in:
Gunnar Beutner 2016-05-10 07:05:10 +02:00
parent e3ddccc867
commit 1fb378ef4a
1 changed files with 0 additions and 19 deletions

View File

@ -67,22 +67,6 @@ static std::map<String, ExternalCommandInfo>& GetCommands(void)
boost::signals2::signal<void (double, const String&, const std::vector<String>&)> ExternalCommandProcessor::OnNewExternalCommand; boost::signals2::signal<void (double, const String&, const std::vector<String>&)> ExternalCommandProcessor::OnNewExternalCommand;
static Value ExternalCommandAPIWrapper(const String& command, const Dictionary::Ptr& params)
{
std::vector<String> arguments;
if (params) {
int i = 0;
while (params->Contains("arg" + Convert::ToString(i))) {
arguments.push_back(params->Get("arg" + Convert::ToString(i)));
i++;
}
}
ExternalCommandProcessor::Execute(Utility::GetTime(), command, arguments);
return true;
}
static void RegisterCommand(const String& command, const ExternalCommandCallback& callback, size_t minArgs = 0, size_t maxArgs = UINT_MAX) static void RegisterCommand(const String& command, const ExternalCommandCallback& callback, size_t minArgs = 0, size_t maxArgs = UINT_MAX)
{ {
boost::mutex::scoped_lock lock(GetMutex()); boost::mutex::scoped_lock lock(GetMutex());
@ -91,9 +75,6 @@ static void RegisterCommand(const String& command, const ExternalCommandCallback
eci.MinArgs = minArgs; eci.MinArgs = minArgs;
eci.MaxArgs = (maxArgs == UINT_MAX) ? minArgs : maxArgs; eci.MaxArgs = (maxArgs == UINT_MAX) ? minArgs : maxArgs;
GetCommands()[command] = eci; GetCommands()[command] = eci;
ApiFunction::Ptr afunc = new ApiFunction(boost::bind(&ExternalCommandAPIWrapper, command, _2));
ApiFunction::Register("extcmd::" + command, afunc);
} }
void ExternalCommandProcessor::Execute(const String& line) void ExternalCommandProcessor::Execute(const String& line)