use of de.dytanic.cloudnetwrapper.server.CloudGameServer in project CloudNet by Dytanic.
the class StopTimeHandler method run.
@Override
public void run(CloudNetWrapper wrapper) {
for (GameServer gameServer : CloudNetWrapper.getInstance().getServers().values()) try {
if (!gameServer.isAlive()) {
if (System.currentTimeMillis() > (gameServer.getStartupTimeStamp() + 1600))
gameServer.shutdown();
else
gameServer.restart();
}
} catch (Exception ex) {
}
for (CloudGameServer gameServer : CloudNetWrapper.getInstance().getCloudservers().values()) try {
if (!gameServer.isAlive())
gameServer.shutdown();
} catch (Exception ex) {
}
for (BungeeCord bungeeCord : CloudNetWrapper.getInstance().getProxys().values()) try {
if (!bungeeCord.isAlive())
bungeeCord.shutdown();
} catch (Exception ex) {
}
}
use of de.dytanic.cloudnetwrapper.server.CloudGameServer in project CloudNet by Dytanic.
the class ServerProcessQueue method patchAsync.
public void patchAsync(CloudServerMeta cloudServerMeta) {
CloudGameServer cloudGameServer = new CloudGameServer(cloudServerMeta);
TaskScheduler.runtimeScheduler().schedule(new Runnable() {
@Override
public void run() {
try {
cloudGameServer.bootstrap();
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
use of de.dytanic.cloudnetwrapper.server.CloudGameServer in project CloudNet by Dytanic.
the class CloudNetWrapper method shutdown.
@Override
public boolean shutdown() {
if (!RUNNING)
return false;
System.out.println("Wrapper shutdown...");
TaskScheduler.runtimeScheduler().shutdown();
if (scheduler != null)
scheduler.cancelAllTasks();
if (serverProcessQueue != null)
serverProcessQueue.setRunning(false);
for (GameServer gameServer : servers.values()) gameServer.shutdown();
for (BungeeCord gameServer : proxys.values()) gameServer.shutdown();
for (CloudGameServer gameServer : cloudservers.values()) gameServer.shutdown();
this.cloudNetLogging.shutdownAll();
if (networkConnection.getChannel() != null)
networkConnection.tryDisconnect();
try {
FileUtils.deleteDirectory(new File("temp"));
} catch (IOException e) {
}
System.out.println("\n _ _ _______ _ _ \n" + " _| || |_ |__ __| | | | | \n" + " |_ __ _| | | | |__ __ _ _ __ | | __ ___ \n" + " _| || |_ | | | '_ \\ / _` | | '_ \\ | |/ / / __|\n" + " |_ __ _| | | | | | | | (_| | | | | | | < \\__ \\\n" + " |_||_| |_| |_| |_| \\__,_| |_| |_| |_|\\_\\ |___/\n" + " \n" + " ");
RUNNING = false;
if (x_bnosxo)
System.exit(0);
return true;
}
Aggregations