From 28e4a91afffe691ca8bb4595f9c205ea05e1f694 Mon Sep 17 00:00:00 2001 From: Joel Date: Wed, 17 Mar 2021 23:44:37 +0100 Subject: [PATCH] Added a check do scheduler if server is null where player is standing on. --- .../main/java/zone/themcgamer/proxy/hub/HubBalancer.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/proxy/src/main/java/zone/themcgamer/proxy/hub/HubBalancer.java b/proxy/src/main/java/zone/themcgamer/proxy/hub/HubBalancer.java index 3b4ef60..6702b6c 100644 --- a/proxy/src/main/java/zone/themcgamer/proxy/hub/HubBalancer.java +++ b/proxy/src/main/java/zone/themcgamer/proxy/hub/HubBalancer.java @@ -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) {