mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-11-05 10:20:23 +01:00
Fixed Bungee functionality
This commit is contained in:
parent
f719f81abb
commit
697512acfd
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
@ -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();
|
||||
}
|
||||
|
@ -14,14 +14,13 @@ import java.util.*;
|
||||
public class WebAPIManager {
|
||||
|
||||
private final Map<String, WebAPI> registry;
|
||||
private final Set<String> accessKeys;
|
||||
private static final Set<String> accessKeys = new HashSet<>();
|
||||
|
||||
/**
|
||||
* Constructor used to hide the public constructor
|
||||
*/
|
||||
public WebAPIManager() {
|
||||
registry = new HashMap<>();
|
||||
accessKeys = new HashSet<>();
|
||||
}
|
||||
|
||||
public void registerNewAPI(WebAPI... api) {
|
||||
|
Loading…
Reference in New Issue
Block a user