diff --git a/patches/server/0118-Do-not-place-player-in-world-if-kicked-before-being-.patch b/patches/server/0118-Do-not-place-player-in-world-if-kicked-before-being-.patch new file mode 100644 index 0000000..54b25b4 --- /dev/null +++ b/patches/server/0118-Do-not-place-player-in-world-if-kicked-before-being-.patch @@ -0,0 +1,33 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martijn Muijsers +Date: Sun, 25 Dec 2022 23:14:40 +0100 +Subject: [PATCH] Do not place player in world if kicked before being spawned + in + +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: +"Check if player is still connected after PlayerSpawnLocationEvent" +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/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java +index b34d64de19f387b4a95cc24b57aa98f81c4f2a9c..d18bef8b90e786929e58afe6d7fd7ad1468cf6e0 100644 +--- a/src/main/java/net/minecraft/server/players/PlayerList.java ++++ b/src/main/java/net/minecraft/server/players/PlayerList.java +@@ -253,6 +253,13 @@ public abstract class PlayerList { + org.spigotmc.event.player.PlayerSpawnLocationEvent ev = new com.destroystokyo.paper.event.player.PlayerInitialSpawnEvent(spawnPlayer, spawnPlayer.getLocation()); // Paper use our duplicate event + this.cserver.getPluginManager().callEvent(ev); + ++ // Gale start - MultiPaper - do not place player in world if kicked before being spawned in ++ if (!connection.isConnected() || player.quitReason != null) { ++ pendingPlayers.remove(player.getUUID(), player); ++ return; ++ } ++ // Gale end - MultiPaper - do not place player in world if kicked before being spawned in ++ + Location loc = ev.getSpawnLocation(); + worldserver1 = ((CraftWorld) loc.getWorld()).getHandle(); + diff --git a/patches/server/0118-CraftBukkit-UUID-to-world-map.patch b/patches/server/0119-CraftBukkit-UUID-to-world-map.patch similarity index 100% rename from patches/server/0118-CraftBukkit-UUID-to-world-map.patch rename to patches/server/0119-CraftBukkit-UUID-to-world-map.patch diff --git a/patches/server/0119-Don-t-double-save-stored-user-lists.patch b/patches/server/0120-Don-t-double-save-stored-user-lists.patch similarity index 100% rename from patches/server/0119-Don-t-double-save-stored-user-lists.patch rename to patches/server/0120-Don-t-double-save-stored-user-lists.patch diff --git a/patches/server/0120-Specific-interval-TPS-API.patch b/patches/server/0121-Specific-interval-TPS-API.patch similarity index 100% rename from patches/server/0120-Specific-interval-TPS-API.patch rename to patches/server/0121-Specific-interval-TPS-API.patch diff --git a/patches/server/0121-5-second-TPS-average.patch b/patches/server/0122-5-second-TPS-average.patch similarity index 100% rename from patches/server/0121-5-second-TPS-average.patch rename to patches/server/0122-5-second-TPS-average.patch diff --git a/patches/server/0122-Measure-last-tick-time.patch b/patches/server/0123-Measure-last-tick-time.patch similarity index 100% rename from patches/server/0122-Measure-last-tick-time.patch rename to patches/server/0123-Measure-last-tick-time.patch diff --git a/patches/server/0123-Last-tick-time-API.patch b/patches/server/0124-Last-tick-time-API.patch similarity index 100% rename from patches/server/0123-Last-tick-time-API.patch rename to patches/server/0124-Last-tick-time-API.patch diff --git a/patches/server/0124-Show-last-tick-time-in-tps-command.patch b/patches/server/0125-Show-last-tick-time-in-tps-command.patch similarity index 100% rename from patches/server/0124-Show-last-tick-time-in-tps-command.patch rename to patches/server/0125-Show-last-tick-time-in-tps-command.patch diff --git a/patches/server/0125-Increase-time-statistics-in-intervals.patch b/patches/server/0126-Increase-time-statistics-in-intervals.patch similarity index 100% rename from patches/server/0125-Increase-time-statistics-in-intervals.patch rename to patches/server/0126-Increase-time-statistics-in-intervals.patch diff --git a/patches/server/0126-For-collision-check-has-physics-before-same-vehicle.patch b/patches/server/0127-For-collision-check-has-physics-before-same-vehicle.patch similarity index 100% rename from patches/server/0126-For-collision-check-has-physics-before-same-vehicle.patch rename to patches/server/0127-For-collision-check-has-physics-before-same-vehicle.patch diff --git a/patches/server/0127-Skip-negligible-planar-movement-multiplication.patch b/patches/server/0128-Skip-negligible-planar-movement-multiplication.patch similarity index 100% rename from patches/server/0127-Skip-negligible-planar-movement-multiplication.patch rename to patches/server/0128-Skip-negligible-planar-movement-multiplication.patch diff --git a/patches/server/0128-Optimize-identical-item-checks.patch b/patches/server/0129-Optimize-identical-item-checks.patch similarity index 100% rename from patches/server/0128-Optimize-identical-item-checks.patch rename to patches/server/0129-Optimize-identical-item-checks.patch diff --git a/patches/server/0129-Reduce-RandomSource-instances.patch b/patches/server/0130-Reduce-RandomSource-instances.patch similarity index 100% rename from patches/server/0129-Reduce-RandomSource-instances.patch rename to patches/server/0130-Reduce-RandomSource-instances.patch diff --git a/patches/server/0130-Server-thread-priority-environment-variable.patch b/patches/server/0131-Server-thread-priority-environment-variable.patch similarity index 100% rename from patches/server/0130-Server-thread-priority-environment-variable.patch rename to patches/server/0131-Server-thread-priority-environment-variable.patch diff --git a/patches/server/0131-Thread-safety-annotations.patch b/patches/server/0132-Thread-safety-annotations.patch similarity index 100% rename from patches/server/0131-Thread-safety-annotations.patch rename to patches/server/0132-Thread-safety-annotations.patch diff --git a/patches/server/0132-CPU-cores-estimation.patch b/patches/server/0133-CPU-cores-estimation.patch similarity index 100% rename from patches/server/0132-CPU-cores-estimation.patch rename to patches/server/0133-CPU-cores-estimation.patch diff --git a/patches/server/0133-Mutex-utility.patch b/patches/server/0134-Mutex-utility.patch similarity index 100% rename from patches/server/0133-Mutex-utility.patch rename to patches/server/0134-Mutex-utility.patch diff --git a/patches/server/0134-Paired-lock-and-condition-utility.patch b/patches/server/0135-Paired-lock-and-condition-utility.patch similarity index 100% rename from patches/server/0134-Paired-lock-and-condition-utility.patch rename to patches/server/0135-Paired-lock-and-condition-utility.patch diff --git a/patches/server/0135-Unterminable-executor-utility.patch b/patches/server/0136-Unterminable-executor-utility.patch similarity index 100% rename from patches/server/0135-Unterminable-executor-utility.patch rename to patches/server/0136-Unterminable-executor-utility.patch diff --git a/patches/server/0136-FIFO-concurrent-queue-utility.patch b/patches/server/0137-FIFO-concurrent-queue-utility.patch similarity index 100% rename from patches/server/0136-FIFO-concurrent-queue-utility.patch rename to patches/server/0137-FIFO-concurrent-queue-utility.patch diff --git a/patches/server/0137-Base-thread-pools.patch b/patches/server/0138-Base-thread-pools.patch similarity index 99% rename from patches/server/0137-Base-thread-pools.patch rename to patches/server/0138-Base-thread-pools.patch index 87c4e39..e55f79c 100644 --- a/patches/server/0137-Base-thread-pools.patch +++ b/patches/server/0138-Base-thread-pools.patch @@ -1562,7 +1562,7 @@ index 4b3d2280326c7eeda4952c36edff141cbff90e16..fa3a58f09178604e301b107f1a029e59 private static URL getEndpoint(URI root, @Nullable JsonObject endpoints, String key, String fallback) throws MalformedURLException { diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index b34d64de19f387b4a95cc24b57aa98f81c4f2a9c..636a5afca868b05f7dbb4da8a7e04b968ada5048 100644 +index d18bef8b90e786929e58afe6d7fd7ad1468cf6e0..7249935d895189d2dbf629507590fd084564c7a6 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -15,7 +15,6 @@ import java.net.SocketAddress; @@ -1585,7 +1585,16 @@ index b34d64de19f387b4a95cc24b57aa98f81c4f2a9c..636a5afca868b05f7dbb4da8a7e04b96 import net.minecraft.server.dedicated.DedicatedServer; import net.minecraft.server.level.ServerLevel; import net.minecraft.server.level.ServerPlayer; -@@ -289,6 +288,58 @@ public abstract class PlayerList { +@@ -255,7 +254,7 @@ public abstract class PlayerList { + + // Gale start - MultiPaper - do not place player in world if kicked before being spawned in + if (!connection.isConnected() || player.quitReason != null) { +- pendingPlayers.remove(player.getUUID(), player); ++ /*pendingPlayers.remove(player.getUUID(), player);*/ // Gale - base thread pools - this patch was removed from Paper but might be useful later + return; + } + // Gale end - MultiPaper - do not place player in world if kicked before being spawned in +@@ -296,6 +295,58 @@ public abstract class PlayerList { player.getRecipeBook().sendInitialRecipeBook(player); this.updateEntireScoreboard(worldserver1.getScoreboard(), player); this.server.invalidateStatus(); @@ -1644,7 +1653,7 @@ index b34d64de19f387b4a95cc24b57aa98f81c4f2a9c..636a5afca868b05f7dbb4da8a7e04b96 MutableComponent ichatmutablecomponent; if (player.getGameProfile().getName().equalsIgnoreCase(s)) { -@@ -1494,10 +1545,8 @@ public abstract class PlayerList { +@@ -1501,10 +1552,8 @@ public abstract class PlayerList { public void setViewDistance(int viewDistance) { this.viewDistance = viewDistance; //this.broadcastAll(new ClientboundSetChunkCacheRadiusPacket(viewDistance)); // Paper - move into setViewDistance @@ -1656,7 +1665,7 @@ index b34d64de19f387b4a95cc24b57aa98f81c4f2a9c..636a5afca868b05f7dbb4da8a7e04b96 if (worldserver != null) { worldserver.getChunkSource().setViewDistance(viewDistance); -@@ -1509,10 +1558,8 @@ public abstract class PlayerList { +@@ -1516,10 +1565,8 @@ public abstract class PlayerList { public void setSimulationDistance(int simulationDistance) { this.simulationDistance = simulationDistance; //this.broadcastAll(new ClientboundSetSimulationDistancePacket(simulationDistance)); // Paper - handled by playerchunkloader diff --git a/patches/server/0138-Non-blocking-PooledObjects.patch b/patches/server/0139-Non-blocking-PooledObjects.patch similarity index 100% rename from patches/server/0138-Non-blocking-PooledObjects.patch rename to patches/server/0139-Non-blocking-PooledObjects.patch