|
@@ -13,9 +13,6 @@ static void commandStop(ServerState& sc, const CommandArguments&) {
|
|
|
sc.running = false;
|
|
|
}
|
|
|
|
|
|
-static void commandEmpty(ServerState&, const CommandArguments&) {
|
|
|
-}
|
|
|
-
|
|
|
CommandManager::CommandManager() {
|
|
|
commands.add("test", commandTest);
|
|
|
commands.add("stop", commandStop);
|
|
@@ -29,10 +26,10 @@ void CommandManager::execute(ServerState& sc, const RawCommand& rawCommand) {
|
|
|
}
|
|
|
|
|
|
CommandName command(args[0]);
|
|
|
- Command c = commands.search(command, commandEmpty);
|
|
|
- if(c == commandEmpty) {
|
|
|
+ Command* c = commands.search(command);
|
|
|
+ if(c == nullptr) {
|
|
|
std::cout << "Unknown command: '" << command << "'" << std::endl;
|
|
|
return;
|
|
|
}
|
|
|
- c(sc, args);
|
|
|
+ (*c)(sc, args);
|
|
|
}
|