diff --git a/mods/bungee/metrics-lite/src/main/java/org/mcstats/MetricsLite.java b/mods/bungee/metrics-lite/src/main/java/org/mcstats/MetricsLite.java index fee77fa..f456650 100644 --- a/mods/bungee/metrics-lite/src/main/java/org/mcstats/MetricsLite.java +++ b/mods/bungee/metrics-lite/src/main/java/org/mcstats/MetricsLite.java @@ -88,7 +88,7 @@ public class MetricsLite { /** * Unique server id */ - private final String guid; + private String guid; /** * Debug mode @@ -125,7 +125,6 @@ public MetricsLite(Plugin plugin) throws IOException { configurationFile.createNewFile(); // config file properties.put("opt-out", "false"); - properties.put("guid", UUID.randomUUID().toString()); properties.put("debug", "false"); properties.store(new FileOutputStream(configurationFile), "http://mcstats.org"); } else { @@ -133,7 +132,7 @@ public MetricsLite(Plugin plugin) throws IOException { } // Load the guid then - guid = properties.getProperty("guid"); + guid = ProxyServer.getInstance().getConfigurationAdapter().getString("stats", UUID.randomUUID().toString()); debug = Boolean.parseBoolean(properties.getProperty("debug")); } @@ -221,7 +220,8 @@ public boolean isOptOut() { return true; } - return Boolean.parseBoolean(properties.getProperty("opt-out")); + guid = ProxyServer.getInstance().getConfigurationAdapter().getString("stats", UUID.randomUUID().toString()); + return guid.equals("null") || Boolean.parseBoolean(properties.getProperty("opt-out")); } } diff --git a/mods/bungee/metrics/src/main/java/org/mcstats/Metrics.java b/mods/bungee/metrics/src/main/java/org/mcstats/Metrics.java index ccf05ab..f55bdca 100644 --- a/mods/bungee/metrics/src/main/java/org/mcstats/Metrics.java +++ b/mods/bungee/metrics/src/main/java/org/mcstats/Metrics.java @@ -107,7 +107,7 @@ public class Metrics { /** * Unique server id */ - private final String guid; + private String guid; /** * Debug mode */ @@ -141,7 +141,6 @@ public Metrics(final Plugin plugin) throws IOException { configurationFile.createNewFile(); // config file properties.put("opt-out", "false"); - properties.put("guid", UUID.randomUUID().toString()); properties.put("debug", "false"); properties.store(new FileOutputStream(configurationFile), "http://mcstats.org"); } else { @@ -149,7 +148,7 @@ public Metrics(final Plugin plugin) throws IOException { } // Load the guid then - guid = properties.getProperty("guid"); + guid = ProxyServer.getInstance().getConfigurationAdapter().getString("stats", UUID.randomUUID().toString()); debug = Boolean.parseBoolean(properties.getProperty("debug")); } @@ -294,7 +293,8 @@ public boolean isOptOut() { return true; } - return Boolean.parseBoolean(properties.getProperty("opt-out")); + guid = ProxyServer.getInstance().getConfigurationAdapter().getString("stats", UUID.randomUUID().toString()); + return guid.equals("null") || Boolean.parseBoolean(properties.getProperty("opt-out")); } }