mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-18 00:47:42 +01:00
Upstream has released updates that appears to apply and compile correctly Paper Changes: b75eeca0 Boost light task priority to ensure it doesnt hold up chunk loads 3d2bc848 Ensure VillagerTrades doesn't load async - fixes #3495 e470f1ef Add more information to Timing Reports f4a47db6 Improve Thread Pool usage to allow single threads for single cpu servers a4fe910f Fix sounds when using worldedit regen command 70ad51a8 Updated Upstream (Bukkit/CraftBukkit) d7cfa4fa Improve legacy format serialization more
63 lines
2.7 KiB
Diff
63 lines
2.7 KiB
Diff
From b13286b4d4b42daa6cbe690825f9e1a7ee2b5299 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
|
|
|
|
---
|
|
.../java/co/aikar/timings/TimingsExport.java | 25 ++++++++++++++++---
|
|
1 file changed, 21 insertions(+), 4 deletions(-)
|
|
|
|
diff --git a/src/main/java/co/aikar/timings/TimingsExport.java b/src/main/java/co/aikar/timings/TimingsExport.java
|
|
index a3b41ce5fc..4a9e7fd92c 100644
|
|
--- a/src/main/java/co/aikar/timings/TimingsExport.java
|
|
+++ b/src/main/java/co/aikar/timings/TimingsExport.java
|
|
@@ -227,9 +227,13 @@ public class TimingsExport extends Thread {
|
|
// Information on the users Config
|
|
|
|
parent.put("config", createObject(
|
|
- pair("spigot", mapAsJSON(Bukkit.spigot().getSpigotConfig(), null)),
|
|
- pair("bukkit", mapAsJSON(Bukkit.spigot().getBukkitConfig(), null)),
|
|
- pair("paper", mapAsJSON(Bukkit.spigot().getPaperConfig(), 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)),
|
|
+ pair("purpur", mapAsJSON(Bukkit.spigot().getPurpurConfig(), null))
|
|
+ // Purpur end
|
|
));
|
|
|
|
new TimingsExport(listeners, parent, history).start();
|
|
@@ -270,6 +274,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 (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();
|
|
@@ -306,7 +323,7 @@ public class TimingsExport extends Thread {
|
|
String response = null;
|
|
String timingsURL = null;
|
|
try {
|
|
- HttpURLConnection con = (HttpURLConnection) new URL("http://timings.aikar.co/post").openConnection();
|
|
+ HttpURLConnection con = (HttpURLConnection) new URL(Bukkit.spigot().getPurpurConfig().getString("settings.timings.url", "https://timings.pl3x.net") + "/post").openConnection(); // Purpur
|
|
con.setDoOutput(true);
|
|
String hostName = "BrokenHost";
|
|
try {
|
|
--
|
|
2.24.0
|
|
|