diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/LaunchServer.java b/LaunchServer/src/main/java/ru/gravit/launchserver/LaunchServer.java index 677bf31a..b16afa2b 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/LaunchServer.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/LaunchServer.java @@ -220,7 +220,11 @@ public static void main(String... args) throws Throwable { // Start LaunchServer Instant start = Instant.now(); try { - new LaunchServer(IOHelper.WORKING_DIR, args).run(); + LaunchServer launchserver = new LaunchServer(IOHelper.WORKING_DIR, args); + if(args.length == 0) launchserver.run(); + else { //Обработка команды + launchserver.commandHandler.eval(args,false); + } } catch (Throwable exc) { LogHelper.error(exc); return; diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/command/handler/CommandHandler.java b/LaunchServer/src/main/java/ru/gravit/launchserver/command/handler/CommandHandler.java index 1e610f6a..c3d18b6c 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/command/handler/CommandHandler.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/command/handler/CommandHandler.java @@ -8,6 +8,8 @@ import ru.gravit.launchserver.command.dump.DumpEntryCacheCommand; import ru.gravit.launchserver.command.dump.DumpSessionsCommand; import ru.gravit.launchserver.command.hash.*; +import ru.gravit.launchserver.command.install.CheckInstallCommand; +import ru.gravit.launchserver.command.install.MultiCommand; import ru.gravit.launchserver.command.modules.LoadModuleCommand; import ru.gravit.launchserver.command.modules.ModulesCommand; import ru.gravit.launchserver.command.service.*; @@ -120,6 +122,8 @@ protected CommandHandler(LaunchServer server) { registerCommand("configList", new ConfigListCommand(server)); registerCommand("swapAuthProvider", new SwapAuthProviderCommand(server)); registerCommand("serverStatus", new ServerStatusCommand(server)); + registerCommand("checkInstall", new CheckInstallCommand(server)); + registerCommand("multi", new MultiCommand(server)); } diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/command/install/CheckInstallCommand.java b/LaunchServer/src/main/java/ru/gravit/launchserver/command/install/CheckInstallCommand.java new file mode 100644 index 00000000..0c9c2ae2 --- /dev/null +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/command/install/CheckInstallCommand.java @@ -0,0 +1,26 @@ +package ru.gravit.launchserver.command.install; + +import ru.gravit.launchserver.LaunchServer; +import ru.gravit.launchserver.command.Command; +import ru.gravit.utils.helper.LogHelper; + +public class CheckInstallCommand extends Command { + public CheckInstallCommand(LaunchServer server) { + super(server); + } + + @Override + public String getArgsDescription() { + return null; + } + + @Override + public String getUsageDescription() { + return null; + } + + @Override + public void invoke(String... args) throws Exception { + LogHelper.info("Check install success"); + } +} diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/command/install/MultiCommand.java b/LaunchServer/src/main/java/ru/gravit/launchserver/command/install/MultiCommand.java new file mode 100644 index 00000000..6033e9ae --- /dev/null +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/command/install/MultiCommand.java @@ -0,0 +1,28 @@ +package ru.gravit.launchserver.command.install; + +import ru.gravit.launchserver.LaunchServer; +import ru.gravit.launchserver.command.Command; + +public class MultiCommand extends Command { + public MultiCommand(LaunchServer server) { + super(server); + } + + @Override + public String getArgsDescription() { + return null; + } + + @Override + public String getUsageDescription() { + return null; + } + + @Override + public void invoke(String... args) throws Exception { + for(String arg : args) + { + server.commandHandler.eval(arg, false); + } + } +}