mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: 8c74d3126 Updated Upstream (Bukkit) (#5359) fd3c66a91 bug #5362 - correctly pass "render type" when registering a new scoreboard objective 39c487b37 Add per-command perms for paper command cdbf2578c Add Item Rarity API (#5352) d80e43647 [CI-SKIP] Removal from the MIT list (#5345) Tuinity Changes: aea6b8347 Merge dev/playerchunkloading 722c7ca8a Use hash table for maintaing changed block set 98ae59d85 Custom table implementation for blockstate state lookups 8b8704fb6 Oprimise map impl for tracked players ea71d6ba4 Optimise snow & ice in chunk ticking 9871d4ce5 Remove chunk lookup & lambda allocation from counting mobs 5a4a35f3e Add patreon 7d93d9618 Refactor data management for region manager c3035219f Change license from MIT to LGPLv3 Airplane Changes: 580f380b6 Updated Upstream (Tuinity) 82253fd36 Early return optimization for target finding 9572643bb Cache entityhuman display name 5df98254f Remove iterators from inventory contains 18d2be193 Merge pull request #14 from violetwtf/patch-1 f716d4c33 Merge pull request #13 from violetwtf/master 128cbe519 Reduce entity chunk ticking checks from 3 to 1 03ac0933b Skip copying unloading tile entities 97dd027b5 Smaller pool size for tracking 9e9f57be4 Only set up Flare if token is available
74 lines
3.8 KiB
Diff
74 lines
3.8 KiB
Diff
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 35810f42d7a0cd50a4cbe90e8d698fe57914c889..5e672a0660d0aceffcdb26d185590ca18aa4f023 100644
|
|
--- a/src/main/java/co/aikar/timings/TimingsExport.java
|
|
+++ b/src/main/java/co/aikar/timings/TimingsExport.java
|
|
@@ -227,10 +227,14 @@ 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)), // Tuinity - add config to timings report
|
|
- pair("tuinity", mapAsJSON(Bukkit.spigot().getTuinityConfig(), null)) // Tuinity - add config to timings report
|
|
+ // 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("tuinity", mapAsJSON(Bukkit.spigot().getTuinityConfig(), null)), // Tuinity - add config to timings report
|
|
+ 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();
|
|
@@ -307,7 +324,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(net.pl3x.purpur.PurpurConfig.timingsUrl + "/post").openConnection(); // Purpur
|
|
con.setDoOutput(true);
|
|
String hostName = "BrokenHost";
|
|
try {
|
|
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
|
index cd3272520eb78a9c663bac3bfdb2b63d611d48a1..00eb196f8caa2e4f2478972c14f4596071adbd2a 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
|
@@ -127,4 +127,10 @@ public class PurpurConfig {
|
|
config.addDefault(path, def);
|
|
return config.getString(path, config.getString(path));
|
|
}
|
|
+
|
|
+ public static String timingsUrl = "https://timings.pl3x.net";
|
|
+ private static void timingsSettings() {
|
|
+ timingsUrl = getString("settings.timings.url", timingsUrl);
|
|
+ if (!TimingsManager.hiddenConfigs.contains("server-ip")) TimingsManager.hiddenConfigs.add("server-ip");
|
|
+ }
|
|
}
|