From 996294c557298904c8a157ad688f6e7a1e3ce914 Mon Sep 17 00:00:00 2001 From: Martijn Muijsers Date: Sat, 24 Dec 2022 23:52:39 +0100 Subject: [PATCH] Don't double save stored user lists --- ...-Don-t-double-save-stored-user-lists.patch | 81 +++++++++++++++++++ ...h => 0114-Specific-interval-TPS-API.patch} | 0 ....patch => 0115-5-second-TPS-average.patch} | 0 ...atch => 0116-Measure-last-tick-time.patch} | 0 ...PI.patch => 0117-Last-tick-time-API.patch} | 0 ...-Show-last-tick-time-in-tps-command.patch} | 0 ...crease-time-statistics-in-intervals.patch} | 0 ...eck-has-physics-before-same-vehicle.patch} | 0 ...ible-planar-movement-multiplication.patch} | 0 ... 0122-Reduce-RandomSource-instances.patch} | 0 ...hread-priority-environment-variable.patch} | 0 ...h => 0124-Thread-safety-annotations.patch} | 0 ....patch => 0125-CPU-cores-estimation.patch} | 0 ...utility.patch => 0126-Mutex-utility.patch} | 0 ...7-Paired-lock-and-condition-utility.patch} | 0 ... 0128-Unterminable-executor-utility.patch} | 0 ... 0129-FIFO-concurrent-queue-utility.patch} | 0 ...ols.patch => 0130-Base-thread-pools.patch} | 0 ... => 0131-Non-blocking-PooledObjects.patch} | 0 19 files changed, 81 insertions(+) create mode 100644 patches/server/0113-Don-t-double-save-stored-user-lists.patch rename patches/server/{0113-Specific-interval-TPS-API.patch => 0114-Specific-interval-TPS-API.patch} (100%) rename patches/server/{0114-5-second-TPS-average.patch => 0115-5-second-TPS-average.patch} (100%) rename patches/server/{0115-Measure-last-tick-time.patch => 0116-Measure-last-tick-time.patch} (100%) rename patches/server/{0116-Last-tick-time-API.patch => 0117-Last-tick-time-API.patch} (100%) rename patches/server/{0117-Show-last-tick-time-in-tps-command.patch => 0118-Show-last-tick-time-in-tps-command.patch} (100%) rename patches/server/{0118-Increase-time-statistics-in-intervals.patch => 0119-Increase-time-statistics-in-intervals.patch} (100%) rename patches/server/{0119-For-collision-check-has-physics-before-same-vehicle.patch => 0120-For-collision-check-has-physics-before-same-vehicle.patch} (100%) rename patches/server/{0120-Skip-negligible-planar-movement-multiplication.patch => 0121-Skip-negligible-planar-movement-multiplication.patch} (100%) rename patches/server/{0121-Reduce-RandomSource-instances.patch => 0122-Reduce-RandomSource-instances.patch} (100%) rename patches/server/{0122-Server-thread-priority-environment-variable.patch => 0123-Server-thread-priority-environment-variable.patch} (100%) rename patches/server/{0123-Thread-safety-annotations.patch => 0124-Thread-safety-annotations.patch} (100%) rename patches/server/{0124-CPU-cores-estimation.patch => 0125-CPU-cores-estimation.patch} (100%) rename patches/server/{0125-Mutex-utility.patch => 0126-Mutex-utility.patch} (100%) rename patches/server/{0126-Paired-lock-and-condition-utility.patch => 0127-Paired-lock-and-condition-utility.patch} (100%) rename patches/server/{0127-Unterminable-executor-utility.patch => 0128-Unterminable-executor-utility.patch} (100%) rename patches/server/{0128-FIFO-concurrent-queue-utility.patch => 0129-FIFO-concurrent-queue-utility.patch} (100%) rename patches/server/{0129-Base-thread-pools.patch => 0130-Base-thread-pools.patch} (100%) rename patches/server/{0130-Non-blocking-PooledObjects.patch => 0131-Non-blocking-PooledObjects.patch} (100%) diff --git a/patches/server/0113-Don-t-double-save-stored-user-lists.patch b/patches/server/0113-Don-t-double-save-stored-user-lists.patch new file mode 100644 index 0000000..dc12283 --- /dev/null +++ b/patches/server/0113-Don-t-double-save-stored-user-lists.patch @@ -0,0 +1,81 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martijn Muijsers +Date: Sat, 24 Dec 2022 23:49:36 +0100 +Subject: [PATCH] Don't double save stored user lists + +License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html) +Gale - https://galemc.org + +This patch is based on the following patch: +"Don't double save the json lists" +By: PureGero +As part of: MultiPaper (https://github.com/MultiPaper/MultiPaper) +Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html) + +diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedPlayerList.java b/src/main/java/net/minecraft/server/dedicated/DedicatedPlayerList.java +index 935dac757280731bfeb0a8f033cbe315ecac46da..a9786790620d4100b52fafc15933d312bb9323f1 100644 +--- a/src/main/java/net/minecraft/server/dedicated/DedicatedPlayerList.java ++++ b/src/main/java/net/minecraft/server/dedicated/DedicatedPlayerList.java +@@ -45,13 +45,11 @@ public class DedicatedPlayerList extends PlayerList { + @Override + public void op(GameProfile profile) { + super.op(profile); +- this.saveOps(); + } + + @Override + public void deop(GameProfile profile) { + super.deop(profile); +- this.saveOps(); + } + + @Override +diff --git a/src/main/java/org/bukkit/craftbukkit/CraftIpBanList.java b/src/main/java/org/bukkit/craftbukkit/CraftIpBanList.java +index 61cb647b2aa590303402e6652bd37b5bca0e0b1d..620784dbbf5e57dc855b4d38a3b05c3411e64040 100644 +--- a/src/main/java/org/bukkit/craftbukkit/CraftIpBanList.java ++++ b/src/main/java/org/bukkit/craftbukkit/CraftIpBanList.java +@@ -41,12 +41,6 @@ public class CraftIpBanList implements org.bukkit.BanList { + + this.list.add(entry); + +- try { +- this.list.save(); +- } catch (IOException ex) { +- Bukkit.getLogger().log(Level.SEVERE, "Failed to save banned-ips.json, {0}", ex.getMessage()); +- } +- + return new CraftIpBanEntry(target, entry, this.list); + } + +diff --git a/src/main/java/org/bukkit/craftbukkit/CraftProfileBanEntry.java b/src/main/java/org/bukkit/craftbukkit/CraftProfileBanEntry.java +index 126968d557263b3efddc9d53d0f8f436a401cf78..3854c93794d27ecd0331105106b104b1a6017a77 100644 +--- a/src/main/java/org/bukkit/craftbukkit/CraftProfileBanEntry.java ++++ b/src/main/java/org/bukkit/craftbukkit/CraftProfileBanEntry.java +@@ -78,10 +78,5 @@ public final class CraftProfileBanEntry implements org.bukkit.BanEntry { + public void save() { + UserBanListEntry entry = new UserBanListEntry(this.profile, this.created, this.source, this.expiration, this.reason); + this.list.add(entry); +- try { +- this.list.save(); +- } catch (IOException ex) { +- Bukkit.getLogger().log(Level.SEVERE, "Failed to save banned-players.json, {0}", ex.getMessage()); +- } + } + } +diff --git a/src/main/java/org/bukkit/craftbukkit/CraftProfileBanList.java b/src/main/java/org/bukkit/craftbukkit/CraftProfileBanList.java +index 6e2047f1b45799c7a1ddfdcd24d76e6e12f91e4b..a31d126590505c00d1a4c0fbb9eb327ec87f7895 100644 +--- a/src/main/java/org/bukkit/craftbukkit/CraftProfileBanList.java ++++ b/src/main/java/org/bukkit/craftbukkit/CraftProfileBanList.java +@@ -54,12 +54,6 @@ public class CraftProfileBanList implements org.bukkit.BanList { + + this.list.add(entry); + +- try { +- this.list.save(); +- } catch (IOException ex) { +- Bukkit.getLogger().log(Level.SEVERE, "Failed to save banned-players.json, {0}", ex.getMessage()); +- } +- + return new CraftProfileBanEntry(profile, entry, this.list); + } + diff --git a/patches/server/0113-Specific-interval-TPS-API.patch b/patches/server/0114-Specific-interval-TPS-API.patch similarity index 100% rename from patches/server/0113-Specific-interval-TPS-API.patch rename to patches/server/0114-Specific-interval-TPS-API.patch diff --git a/patches/server/0114-5-second-TPS-average.patch b/patches/server/0115-5-second-TPS-average.patch similarity index 100% rename from patches/server/0114-5-second-TPS-average.patch rename to patches/server/0115-5-second-TPS-average.patch diff --git a/patches/server/0115-Measure-last-tick-time.patch b/patches/server/0116-Measure-last-tick-time.patch similarity index 100% rename from patches/server/0115-Measure-last-tick-time.patch rename to patches/server/0116-Measure-last-tick-time.patch diff --git a/patches/server/0116-Last-tick-time-API.patch b/patches/server/0117-Last-tick-time-API.patch similarity index 100% rename from patches/server/0116-Last-tick-time-API.patch rename to patches/server/0117-Last-tick-time-API.patch diff --git a/patches/server/0117-Show-last-tick-time-in-tps-command.patch b/patches/server/0118-Show-last-tick-time-in-tps-command.patch similarity index 100% rename from patches/server/0117-Show-last-tick-time-in-tps-command.patch rename to patches/server/0118-Show-last-tick-time-in-tps-command.patch diff --git a/patches/server/0118-Increase-time-statistics-in-intervals.patch b/patches/server/0119-Increase-time-statistics-in-intervals.patch similarity index 100% rename from patches/server/0118-Increase-time-statistics-in-intervals.patch rename to patches/server/0119-Increase-time-statistics-in-intervals.patch diff --git a/patches/server/0119-For-collision-check-has-physics-before-same-vehicle.patch b/patches/server/0120-For-collision-check-has-physics-before-same-vehicle.patch similarity index 100% rename from patches/server/0119-For-collision-check-has-physics-before-same-vehicle.patch rename to patches/server/0120-For-collision-check-has-physics-before-same-vehicle.patch diff --git a/patches/server/0120-Skip-negligible-planar-movement-multiplication.patch b/patches/server/0121-Skip-negligible-planar-movement-multiplication.patch similarity index 100% rename from patches/server/0120-Skip-negligible-planar-movement-multiplication.patch rename to patches/server/0121-Skip-negligible-planar-movement-multiplication.patch diff --git a/patches/server/0121-Reduce-RandomSource-instances.patch b/patches/server/0122-Reduce-RandomSource-instances.patch similarity index 100% rename from patches/server/0121-Reduce-RandomSource-instances.patch rename to patches/server/0122-Reduce-RandomSource-instances.patch diff --git a/patches/server/0122-Server-thread-priority-environment-variable.patch b/patches/server/0123-Server-thread-priority-environment-variable.patch similarity index 100% rename from patches/server/0122-Server-thread-priority-environment-variable.patch rename to patches/server/0123-Server-thread-priority-environment-variable.patch diff --git a/patches/server/0123-Thread-safety-annotations.patch b/patches/server/0124-Thread-safety-annotations.patch similarity index 100% rename from patches/server/0123-Thread-safety-annotations.patch rename to patches/server/0124-Thread-safety-annotations.patch diff --git a/patches/server/0124-CPU-cores-estimation.patch b/patches/server/0125-CPU-cores-estimation.patch similarity index 100% rename from patches/server/0124-CPU-cores-estimation.patch rename to patches/server/0125-CPU-cores-estimation.patch diff --git a/patches/server/0125-Mutex-utility.patch b/patches/server/0126-Mutex-utility.patch similarity index 100% rename from patches/server/0125-Mutex-utility.patch rename to patches/server/0126-Mutex-utility.patch diff --git a/patches/server/0126-Paired-lock-and-condition-utility.patch b/patches/server/0127-Paired-lock-and-condition-utility.patch similarity index 100% rename from patches/server/0126-Paired-lock-and-condition-utility.patch rename to patches/server/0127-Paired-lock-and-condition-utility.patch diff --git a/patches/server/0127-Unterminable-executor-utility.patch b/patches/server/0128-Unterminable-executor-utility.patch similarity index 100% rename from patches/server/0127-Unterminable-executor-utility.patch rename to patches/server/0128-Unterminable-executor-utility.patch diff --git a/patches/server/0128-FIFO-concurrent-queue-utility.patch b/patches/server/0129-FIFO-concurrent-queue-utility.patch similarity index 100% rename from patches/server/0128-FIFO-concurrent-queue-utility.patch rename to patches/server/0129-FIFO-concurrent-queue-utility.patch diff --git a/patches/server/0129-Base-thread-pools.patch b/patches/server/0130-Base-thread-pools.patch similarity index 100% rename from patches/server/0129-Base-thread-pools.patch rename to patches/server/0130-Base-thread-pools.patch diff --git a/patches/server/0130-Non-blocking-PooledObjects.patch b/patches/server/0131-Non-blocking-PooledObjects.patch similarity index 100% rename from patches/server/0130-Non-blocking-PooledObjects.patch rename to patches/server/0131-Non-blocking-PooledObjects.patch