mirror of
https://github.com/GravitLauncher/Launcher
synced 2025-01-25 00:29:23 +03:00
24 lines
770 B
Java
24 lines
770 B
Java
package ru.gravit.launchserver.console;
|
|
|
|
import ru.gravit.launcher.request.admin.ExecCommandRequest;
|
|
import ru.gravit.utils.command.Command;
|
|
import ru.gravit.utils.command.CommandHandler;
|
|
import ru.gravit.utils.command.StdCommandHandler;
|
|
import ru.gravit.utils.helper.LogHelper;
|
|
|
|
public class RemoteStdCommandHandler extends StdCommandHandler {
|
|
public RemoteStdCommandHandler(boolean readCommands) {
|
|
super(readCommands);
|
|
}
|
|
@Override
|
|
public void eval(String line, boolean bell)
|
|
{
|
|
if(line.equals("exit")) System.exit(0);
|
|
ExecCommandRequest request = new ExecCommandRequest(System.out::println, line);
|
|
try {
|
|
request.request();
|
|
} catch (Exception e) {
|
|
LogHelper.error(e);
|
|
}
|
|
}
|
|
}
|