diff --git a/Plan/src/main/java/com/djrapitops/plan/systems/info/BukkitInformationManager.java b/Plan/src/main/java/com/djrapitops/plan/systems/info/BukkitInformationManager.java index aa17d18eb..a08fd2114 100644 --- a/Plan/src/main/java/com/djrapitops/plan/systems/info/BukkitInformationManager.java +++ b/Plan/src/main/java/com/djrapitops/plan/systems/info/BukkitInformationManager.java @@ -7,10 +7,7 @@ package main.java.com.djrapitops.plan.systems.info; import com.djrapitops.plugin.api.utility.log.Log; import main.java.com.djrapitops.plan.Plan; import main.java.com.djrapitops.plan.Settings; -import main.java.com.djrapitops.plan.api.exceptions.ParseException; -import main.java.com.djrapitops.plan.api.exceptions.WebAPIConnectionFailException; -import main.java.com.djrapitops.plan.api.exceptions.WebAPIException; -import main.java.com.djrapitops.plan.api.exceptions.WebAPIFailException; +import main.java.com.djrapitops.plan.api.exceptions.*; import main.java.com.djrapitops.plan.command.commands.AnalyzeCommand; import main.java.com.djrapitops.plan.data.AnalysisData; import main.java.com.djrapitops.plan.data.additional.HookHandler; @@ -302,6 +299,8 @@ public class BukkitInformationManager extends InformationManager { return true; } catch (WebAPIConnectionFailException e) { plugin.getServerInfoManager().markConnectionFail(); + } catch (WebAPINotFoundException e) { + Log.info("Bungee reported that UUID of this server is not in the MySQL-database. Try using '/plan m setup " + webServerAddress + "' again"); } catch (WebAPIException e) { Log.toLog(this.getClass().getName(), e); } 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 a69f0fcd3..0c5e2795f 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 @@ -117,15 +117,17 @@ public class BungeeServerInfoManager { } public void sendConfigSettings(UUID serverUUID) { + String webAddress = null; try { ServerInfo server = bukkitServers.get(serverUUID); if (server == null) { return; } - String webAddress = server.getWebAddress(); + webAddress = server.getWebAddress(); Log.debug("Sending config settings to " + webAddress + ""); plugin.getWebServer().getWebAPI().getAPI(ConfigurationWebAPI.class).sendRequest(webAddress, serverUUID); } catch (WebAPIException e) { + Log.info("Connection to Bukkit (" + webAddress + ") did not succeed."); serverHasGoneOffline(serverUUID); } } @@ -178,7 +180,6 @@ public class BungeeServerInfoManager { } public void serverHasGoneOffline(UUID serverUUID) { - Log.debug("Bukkit Server Marked Offline"); onlineServers.remove(serverUUID); } } \ No newline at end of file diff --git a/Plan/src/main/java/com/djrapitops/plan/systems/webserver/APIRequestHandler.java b/Plan/src/main/java/com/djrapitops/plan/systems/webserver/APIRequestHandler.java index 02280f62c..5b211f66c 100644 --- a/Plan/src/main/java/com/djrapitops/plan/systems/webserver/APIRequestHandler.java +++ b/Plan/src/main/java/com/djrapitops/plan/systems/webserver/APIRequestHandler.java @@ -39,7 +39,9 @@ public class APIRequestHandler implements HttpHandler { response.setResponseHeaders(responseHeaders); response.send(exchange); } catch (Exception e) { - Log.toLog(this.getClass().getName(), e); + if (Settings.DEV_MODE.isTrue()) { + Log.toLog(this.getClass().getName(), e); + } } finally { exchange.close(); } diff --git a/Plan/src/main/java/com/djrapitops/plan/systems/webserver/webapi/WebAPIManager.java b/Plan/src/main/java/com/djrapitops/plan/systems/webserver/webapi/WebAPIManager.java index 3707fe071..cfcc385ad 100644 --- a/Plan/src/main/java/com/djrapitops/plan/systems/webserver/webapi/WebAPIManager.java +++ b/Plan/src/main/java/com/djrapitops/plan/systems/webserver/webapi/WebAPIManager.java @@ -14,14 +14,13 @@ import java.util.*; public class WebAPIManager { private final Map registry; - private final Set accessKeys; + private static final Set accessKeys = new HashSet<>(); /** * Constructor used to hide the public constructor */ public WebAPIManager() { registry = new HashMap<>(); - accessKeys = new HashSet<>(); } public void registerNewAPI(WebAPI... api) {