From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
Date: Fri, 5 Jun 2020 21:30:19 -0500
Subject: [PATCH] Timings stuff


diff --git a/src/main/java/co/aikar/timings/TimingsExport.java b/src/main/java/co/aikar/timings/TimingsExport.java
index 4cd8116fd623fbc9e175986526d3ae51a72b76e0..0e86ceb4d70c45835c9d1c6ca0908fdddf14d55a 100644
--- a/src/main/java/co/aikar/timings/TimingsExport.java
+++ b/src/main/java/co/aikar/timings/TimingsExport.java
@@ -226,11 +226,15 @@ public class TimingsExport extends Thread {
         // Information on the users Config
 
         parent.put("config", createObject(
-            pair("spigot", mapAsJSON(Bukkit.spigot().getSpigotConfig(), null)),
+            // Purpur start
+            pair("server.properties", mapAsJSON(Bukkit.spigot().getServerProperties())),
             pair("bukkit", mapAsJSON(Bukkit.spigot().getBukkitConfig(), null)),
+            pair("spigot", mapAsJSON(Bukkit.spigot().getSpigotConfig(), null)),
             pair("paper", mapAsJSON(Bukkit.spigot().getPaperConfig(), null)), // Tuinity - add config to timings report
             pair("tuinity", mapAsJSON(Bukkit.spigot().getTuinityConfig(), null)), // Tuinity - add config to timings report
-            pair("airplane", mapAsJSON(gg.airplane.AirplaneConfig.getConfigCopy(), null))
+            pair("airplane", mapAsJSON(gg.airplane.AirplaneConfig.getConfigCopy(), null)),
+            pair("purpur", mapAsJSON(Bukkit.spigot().getPurpurConfig(), null))
+            // Purpur end
         ));
 
         new TimingsExport(listeners, parent, history).start();
@@ -271,6 +275,19 @@ public class TimingsExport extends Thread {
         return timingsCost;
     }
 
+    // Purpur start
+    private static JSONObject mapAsJSON(java.util.Properties properties) {
+        JSONObject object = new JSONObject();
+        for (String key : properties.stringPropertyNames()) {
+            if (key.startsWith("rcon") || key.startsWith("query") ||  key.equals("level-seed") || TimingsManager.hiddenConfigs.contains(key)) {
+                continue;
+            }
+            object.put(key, valAsJSON(properties.get(key), key));
+        }
+        return object;
+    }
+    // Purpur end
+
     private static JSONObject mapAsJSON(ConfigurationSection config, String parentKey) {
 
         JSONObject object = new JSONObject();
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
index b294fa10dc0fa804b94757eaa3becb104f20565a..aed391418d867e79d7236a3a3d8de54cb35807b1 100644
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
@@ -217,7 +217,7 @@ public class PaperConfig {
         timings = reallyEnableTimings;
         // Airplane end */ // Purpur end
         boolean verboseTimings = getBoolean("timings.verbose", true);
-        TimingsManager.url = getString("timings.url", "https://timings.aikar.co/");
+        TimingsManager.url = getString("timings.url", "https://timings.pl3x.net/");
         if (!TimingsManager.url.endsWith("/")) {
             TimingsManager.url += "/";
         }
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
index ad7dbfa8dd5f38af87ec8980fd972ea4449da7ed..7e1938263ecb02c7d2a1fc3dff7aa35b958c6113 100644
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
@@ -161,4 +161,17 @@ public class PurpurConfig {
     private static void messages() {
         cannotRideMob = getString("settings.messages.cannot-ride-mob", cannotRideMob);
     }
+
+    private static void timingsSettings() {
+        if (version < 18) {
+            String oldVal = getString("settings.timings.url", "https://timings.pl3x.net");
+            com.destroystokyo.paper.PaperConfig.config.set("timings.url", oldVal);
+            TimingsManager.url = getString("timings.url", oldVal);
+            if (!TimingsManager.url.endsWith("/")) {
+                TimingsManager.url += "/";
+            }
+            set("settings.timings.url", null);
+        }
+        if (!co.aikar.timings.TimingsManager.hiddenConfigs.contains("server-ip")) co.aikar.timings.TimingsManager.hiddenConfigs.add("server-ip");
+    }
 }
