mirror of
https://github.com/barkeser2002/CatServer.git
synced 2026-09-25 08:00:02 +03:00
27 lines
1.2 KiB
Diff
27 lines
1.2 KiB
Diff
--- ../src-base/minecraft/net/minecraft/network/NetworkSystem.java
|
|
+++ ../src-work/minecraft/net/minecraft/network/NetworkSystem.java
|
|
@@ -165,6 +165,13 @@
|
|
{
|
|
synchronized (this.networkManagers)
|
|
{
|
|
+ // Spigot Start
|
|
+ // This prevents players from 'gaming' the server, and strategically relogging to increase their position in the tick order
|
|
+ if (org.spigotmc.SpigotConfig.playerShuffle > 0 && MinecraftServer.currentTick % org.spigotmc.SpigotConfig.playerShuffle == 0)
|
|
+ {
|
|
+ Collections.shuffle(this.networkManagers);
|
|
+ }
|
|
+ // Spigot End
|
|
Iterator<NetworkManager> iterator = this.networkManagers.iterator();
|
|
|
|
while (iterator.hasNext())
|
|
@@ -209,6 +216,9 @@
|
|
}
|
|
else
|
|
{
|
|
+ // Spigot Start - Fix a race condition where a NetworkManager could be unregistered just before connection.
|
|
+ if (networkmanager.preparing) continue;
|
|
+ // Spigot End
|
|
iterator.remove();
|
|
networkmanager.checkDisconnected();
|
|
}
|