use of de.dytanic.cloudnetwrapper.server.GameServer 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;
}
use of de.dytanic.cloudnetwrapper.server.GameServer in project CloudNet by Dytanic.
the class CloudNetWrapper method onShutdownCentral.
@Override
public void onShutdownCentral() throws Exception {
canDeployed = false;
if (serverProcessQueue != null) {
serverProcessQueue.getProxys().clear();
serverProcessQueue.getServers().clear();
serverProcessQueue.setRunning(false);
}
for (GameServer gameServer : servers.values()) gameServer.shutdown();
for (BungeeCord gameServer : proxys.values()) gameServer.shutdown();
proxyGroups.clear();
serverGroups.clear();
System.out.println("Wrapper try to connect to the CloudNet-Core");
try {
FileUtils.deleteDirectory(new File("temp"));
} catch (Exception ex) {
}
new File("temp").mkdir();
while (networkConnection.getChannel() == null) {
networkConnection.tryConnect(optionSet.has("ssl"), new NetDispatcher(networkConnection, false), auth);
if (networkConnection.getChannel() != null) {
networkConnection.sendPacketSynchronized(new PacketOutUpdateWrapperInfo());
break;
}
Thread.sleep(2000);
}
canDeployed = true;
if (serverProcessQueue != null)
serverProcessQueue.setRunning(true);
}
Aggregations