diff --git a/Plan/src/main/java/com/djrapitops/plan/systems/info/BungeeInformationManager.java b/Plan/src/main/java/com/djrapitops/plan/systems/info/BungeeInformationManager.java index 670941335..c2d47018f 100644 --- a/Plan/src/main/java/com/djrapitops/plan/systems/info/BungeeInformationManager.java +++ b/Plan/src/main/java/com/djrapitops/plan/systems/info/BungeeInformationManager.java @@ -174,6 +174,8 @@ public class BungeeInformationManager extends InformationManager { try { getWebAPI().getAPI(IsOnlineWebAPI.class).sendRequest(server.getWebAddress(), uuid); return server; + } catch (WebAPIConnectionFailException e) { + serverInfoManager.serverHasGoneOffline(server.getUuid()); } catch (WebAPINotFoundException ignored) { /*continue*/ } catch (WebAPIException e) { @@ -182,7 +184,7 @@ public class BungeeInformationManager extends InformationManager { } } - Optional bukkitServer = onlineServers.stream().findAny(); + Optional bukkitServer = serverInfoManager.getOnlineBukkitServers().stream().findAny(); if (bukkitServer.isPresent()) { return bukkitServer.get(); } diff --git a/Plan/src/main/java/com/djrapitops/plan/systems/info/server/BungeeServerInfoManager.java b/Plan/src/main/java/com/djrapitops/plan/systems/info/server/BungeeServerInfoManager.java index c9ec78d3b..07ce78d55 100644 --- a/Plan/src/main/java/com/djrapitops/plan/systems/info/server/BungeeServerInfoManager.java +++ b/Plan/src/main/java/com/djrapitops/plan/systems/info/server/BungeeServerInfoManager.java @@ -148,6 +148,7 @@ public class BungeeServerInfoManager { @Override public void run() { sendConfigSettings(serverUUID); + connectedToServer(bukkitServers.get(serverUUID)); this.cancel(); } }).runTaskLaterAsynchronously(TimeAmount.SECOND.ticks() * 3L); diff --git a/Plan/src/main/java/com/djrapitops/plan/systems/webserver/ResponseHandler.java b/Plan/src/main/java/com/djrapitops/plan/systems/webserver/ResponseHandler.java index 7b48a36f7..dd00117df 100644 --- a/Plan/src/main/java/com/djrapitops/plan/systems/webserver/ResponseHandler.java +++ b/Plan/src/main/java/com/djrapitops/plan/systems/webserver/ResponseHandler.java @@ -207,7 +207,12 @@ public class ResponseHandler extends APIResponseHandler { } plugin.getInfoManager().cachePlayer(uuid); - return PageCache.loadPage("inspectPage: " + uuid, () -> new InspectPageResponse(plugin.getInfoManager(), uuid)); + Response response = PageCache.loadPage("inspectPage: " + uuid); + if (response == null || response instanceof NotFoundResponse) { + PageCache.cachePage("inspectPage: " + uuid, () -> new InspectPageResponse(plugin.getInfoManager(), uuid)); + response = PageCache.loadPage("inspectPage: " + uuid); + } + return response; } private Response notFoundResponse() {