Added a check do scheduler if server is null where player is standing on.

This commit is contained in:
Joel 2021-03-17 23:44:37 +01:00
parent 3640b6ca98
commit 28e4a91aff

@ -145,6 +145,14 @@ public class HubBalancer implements Runnable, Listener {
}
return false;
});
proxy.getProxy().getPlayers().forEach(proxiedPlayer -> {
if (proxiedPlayer.getServer() == null) {
if (hubs.size() >= 1) // Do nothing we want to send player later on when lobbies are back online
sendToHub(proxiedPlayer);
else kickPlayer(proxiedPlayer, NO_AVAILABLE_HUB);
}
});
}
private ServerInfo sendToHub(ProxiedPlayer player) {