2018-01-22 01:19:57 +11:00
|
|
|
From 877f644cca1552996d32402d0e405b32e2b59f02 Mon Sep 17 00:00:00 2001
|
2014-04-12 14:18:37 +10:00
|
|
|
From: md_5 <git@md-5.net>
|
|
|
|
Date: Mon, 27 Jan 2014 08:39:26 +1100
|
|
|
|
Subject: [PATCH] Add Optional Tick Shuffling
|
|
|
|
|
|
|
|
This prevents players from 'gaming' the server, and strategically relogging to increase their position in the tick order.
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/ServerConnection.java b/src/main/java/net/minecraft/server/ServerConnection.java
|
2017-09-18 20:00:00 +10:00
|
|
|
index 7e703685e..9dc3d53cd 100644
|
2014-04-12 14:18:37 +10:00
|
|
|
--- a/src/main/java/net/minecraft/server/ServerConnection.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/ServerConnection.java
|
2016-05-10 21:48:25 +10:00
|
|
|
@@ -122,6 +122,13 @@ public class ServerConnection {
|
2015-02-28 11:36:22 +00:00
|
|
|
List list = this.h;
|
2014-04-12 14:18:37 +10:00
|
|
|
|
2015-02-28 11:36:22 +00:00
|
|
|
synchronized (this.h) {
|
2014-04-12 14:18:37 +10:00
|
|
|
+ // 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 )
|
|
|
|
+ {
|
2015-02-28 11:36:22 +00:00
|
|
|
+ Collections.shuffle( this.h );
|
2014-04-12 14:18:37 +10:00
|
|
|
+ }
|
|
|
|
+ // Spigot End
|
2015-02-28 11:36:22 +00:00
|
|
|
Iterator iterator = this.h.iterator();
|
2014-04-12 14:18:37 +10:00
|
|
|
|
|
|
|
while (iterator.hasNext()) {
|
|
|
|
diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java
|
2017-09-18 20:00:00 +10:00
|
|
|
index d1a5802af..88cbee5b1 100644
|
2014-04-12 14:18:37 +10:00
|
|
|
--- a/src/main/java/org/spigotmc/SpigotConfig.java
|
|
|
|
+++ b/src/main/java/org/spigotmc/SpigotConfig.java
|
2017-06-09 15:58:16 +10:00
|
|
|
@@ -274,4 +274,10 @@ public class SpigotConfig
|
2014-04-12 14:18:37 +10:00
|
|
|
playerSample = getInt( "settings.sample-count", 12 );
|
|
|
|
System.out.println( "Server Ping Player Sample Count: " + playerSample );
|
|
|
|
}
|
|
|
|
+
|
|
|
|
+ public static int playerShuffle;
|
|
|
|
+ private static void playerShuffle()
|
|
|
|
+ {
|
|
|
|
+ playerShuffle = getInt( "settings.player-shuffle", 0 );
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
--
|
2017-11-17 10:24:35 +11:00
|
|
|
2.14.1
|
2014-04-12 14:18:37 +10:00
|
|
|
|