auto restart system

master
Alex 2021-12-27 23:36:48 +01:00
parent 6090cadb23
commit 589c84117e
1 changed files with 6 additions and 1 deletions

View File

@ -73,6 +73,10 @@ public class SocketClientMessageListener implements KraSocketClientEventInterfac
ServiceTask serviceTask = CloudNetDriver.getInstance().getServiceTaskProvider()
.getServiceTask("Lobby");
if (!playersAutoRestartServerSystem.containsKey("lobby")) {
playersAutoRestartServerSystem.put("lobby", null);
}
if (serviceTask != null) {
ServiceInfoSnapshot serviceInfoSnapshot = ServiceConfiguration.builder(serviceTask)
.build().createNewService();
@ -110,7 +114,8 @@ public class SocketClientMessageListener implements KraSocketClientEventInterfac
case 59739: { // send players back to server - auto restart system
String serverName = kraProtocolMessage.getArgs().toLowerCase();
if (serverName.startsWith("lobby")) { // close old lobbies
if (serverName.startsWith("lobby") && playersAutoRestartServerSystem.containsKey(
"lobby")) { // close old lobbies
Collection<ServiceInfoSnapshot> serviceInfoSnapshots = CloudNetDriver.getInstance()
.getCloudServiceProvider()
.getCloudServices("Lobby");