No longer give everyone access to /tps

Everyone had access to /tps for the private tests, but we cannot
trust everyone to use it responsibly for the public test
(i.e revealing coordinates of all logged in players).
This commit is contained in:
Spottedleaf 2023-03-10 00:19:40 -08:00
parent d258d32393
commit e1ad1b1d91
2 changed files with 5 additions and 11 deletions

View File

@ -8604,10 +8604,10 @@ index 0000000000000000000000000000000000000000..390bda127be9be5349c1c442ca01df6b
+} +}
diff --git a/src/main/java/io/papermc/paper/threadedregions/commands/CommandServerHealth.java b/src/main/java/io/papermc/paper/threadedregions/commands/CommandServerHealth.java diff --git a/src/main/java/io/papermc/paper/threadedregions/commands/CommandServerHealth.java b/src/main/java/io/papermc/paper/threadedregions/commands/CommandServerHealth.java
new file mode 100644 new file mode 100644
index 0000000000000000000000000000000000000000..98aacd93794e7bde711b5a1e56aa6e82c8e9da1b index 0000000000000000000000000000000000000000..b9e0568fb08e15444e4cfac09749fce7a93db825
--- /dev/null --- /dev/null
+++ b/src/main/java/io/papermc/paper/threadedregions/commands/CommandServerHealth.java +++ b/src/main/java/io/papermc/paper/threadedregions/commands/CommandServerHealth.java
@@ -0,0 +1,332 @@ @@ -0,0 +1,326 @@
+package io.papermc.paper.threadedregions.commands; +package io.papermc.paper.threadedregions.commands;
+ +
+import io.papermc.paper.threadedregions.RegionisedServer; +import io.papermc.paper.threadedregions.RegionisedServer;
@ -8657,12 +8657,6 @@ index 0000000000000000000000000000000000000000..98aacd93794e7bde711b5a1e56aa6e82
+ this.setPermission("bukkit.command.tps"); + this.setPermission("bukkit.command.tps");
+ } + }
+ +
+ @Override
+ public boolean testPermissionSilent(final CommandSender target) {
+ // TODO for now
+ return true;
+ }
+
+ private static Component formatRegionInfo(final String prefix, final double util, final double mspt, final double tps, + private static Component formatRegionInfo(final String prefix, final double util, final double mspt, final double tps,
+ final boolean newline) { + final boolean newline) {
+ return Component.text() + return Component.text()

View File

@ -58,10 +58,10 @@ index 300700477ee34bc22b31315825c0e40f61070cd5..0b78d1eb90500e0123b7281d722805dc
chunk = wrappedFull.getWrapped(); chunk = wrappedFull.getWrapped();
} else { } else {
diff --git a/src/main/java/io/papermc/paper/threadedregions/commands/CommandServerHealth.java b/src/main/java/io/papermc/paper/threadedregions/commands/CommandServerHealth.java diff --git a/src/main/java/io/papermc/paper/threadedregions/commands/CommandServerHealth.java b/src/main/java/io/papermc/paper/threadedregions/commands/CommandServerHealth.java
index 98aacd93794e7bde711b5a1e56aa6e82c8e9da1b..c22c9022ab5c09053bcc91700f9653b966178a8b 100644 index b9e0568fb08e15444e4cfac09749fce7a93db825..84a2525115b4fc8d2e3c41e96b6351d446b05e33 100644
--- a/src/main/java/io/papermc/paper/threadedregions/commands/CommandServerHealth.java --- a/src/main/java/io/papermc/paper/threadedregions/commands/CommandServerHealth.java
+++ b/src/main/java/io/papermc/paper/threadedregions/commands/CommandServerHealth.java +++ b/src/main/java/io/papermc/paper/threadedregions/commands/CommandServerHealth.java
@@ -154,6 +154,9 @@ public final class CommandServerHealth extends Command { @@ -148,6 +148,9 @@ public final class CommandServerHealth extends Command {
totalUtil += (report == null ? 0.0 : report.utilisation()); totalUtil += (report == null ? 0.0 : report.utilisation());
} }
@ -71,7 +71,7 @@ index 98aacd93794e7bde711b5a1e56aa6e82c8e9da1b..c22c9022ab5c09053bcc91700f9653b9
totalUtil += globalTickReport.utilisation(); totalUtil += globalTickReport.utilisation();
tpsByRegion.sort(null); tpsByRegion.sort(null);
@@ -261,6 +264,12 @@ public final class CommandServerHealth extends Command { @@ -255,6 +258,12 @@ public final class CommandServerHealth extends Command {
.append(Component.text(ONE_DECIMAL_PLACES.format(maxThreadCount * 100.0), INFORMATION)) .append(Component.text(ONE_DECIMAL_PLACES.format(maxThreadCount * 100.0), INFORMATION))
.append(Component.text("%\n", PRIMARY)) .append(Component.text("%\n", PRIMARY))