Unified shutdown functions for Telnet.

This commit is contained in:
MobiusDev
2018-05-01 16:46:21 +00:00
parent af70b6bc0c
commit b3c5f24b25
39 changed files with 53 additions and 629 deletions

View File

@@ -41,7 +41,7 @@ public class ServerAbort implements ITelnetCommand
@Override
public String handle(ChannelHandlerContext ctx, String[] args)
{
Shutdown.getInstance().telnetAbort(ctx.channel().remoteAddress().toString());
Shutdown.getInstance().abort(null);
return "Server shutdown/restart aborted!";
}
}

View File

@@ -47,7 +47,7 @@ public class ServerRestart implements ITelnetCommand
return null;
}
final int time = Integer.parseInt(args[0]);
Shutdown.getInstance().startTelnetShutdown(ctx.channel().remoteAddress().toString(), time, true);
Shutdown.getInstance().startShutdown(null, time, true);
return "Server will restart in " + time + " seconds!";
}
}

View File

@@ -47,7 +47,7 @@ public class ServerShutdown implements ITelnetCommand
return null;
}
final int time = Integer.parseInt(args[0]);
Shutdown.getInstance().startTelnetShutdown(ctx.channel().remoteAddress().toString(), time, false);
Shutdown.getInstance().startShutdown(null, time, false);
return "Server will shutdown in " + time + " seconds!";
}
}