mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-12-23 09:01:08 +03:00
[FEATURE] checkInstallCommand и MultiCommand
This commit is contained in:
parent
7f9ca582d6
commit
64cf9788d9
4 changed files with 63 additions and 1 deletions
|
@ -220,7 +220,11 @@ public static void main(String... args) throws Throwable {
|
||||||
// Start LaunchServer
|
// Start LaunchServer
|
||||||
Instant start = Instant.now();
|
Instant start = Instant.now();
|
||||||
try {
|
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) {
|
} catch (Throwable exc) {
|
||||||
LogHelper.error(exc);
|
LogHelper.error(exc);
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -8,6 +8,8 @@
|
||||||
import ru.gravit.launchserver.command.dump.DumpEntryCacheCommand;
|
import ru.gravit.launchserver.command.dump.DumpEntryCacheCommand;
|
||||||
import ru.gravit.launchserver.command.dump.DumpSessionsCommand;
|
import ru.gravit.launchserver.command.dump.DumpSessionsCommand;
|
||||||
import ru.gravit.launchserver.command.hash.*;
|
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.LoadModuleCommand;
|
||||||
import ru.gravit.launchserver.command.modules.ModulesCommand;
|
import ru.gravit.launchserver.command.modules.ModulesCommand;
|
||||||
import ru.gravit.launchserver.command.service.*;
|
import ru.gravit.launchserver.command.service.*;
|
||||||
|
@ -120,6 +122,8 @@ protected CommandHandler(LaunchServer server) {
|
||||||
registerCommand("configList", new ConfigListCommand(server));
|
registerCommand("configList", new ConfigListCommand(server));
|
||||||
registerCommand("swapAuthProvider", new SwapAuthProviderCommand(server));
|
registerCommand("swapAuthProvider", new SwapAuthProviderCommand(server));
|
||||||
registerCommand("serverStatus", new ServerStatusCommand(server));
|
registerCommand("serverStatus", new ServerStatusCommand(server));
|
||||||
|
registerCommand("checkInstall", new CheckInstallCommand(server));
|
||||||
|
registerCommand("multi", new MultiCommand(server));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -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");
|
||||||
|
}
|
||||||
|
}
|
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue