2014-11-30 23:16:48 +01:00
|
|
|
From 8c82568bb061577addd20a69f8e3197c593e9c5e Mon Sep 17 00:00:00 2001
|
2014-07-21 22:46:54 +02: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
|
2014-11-28 02:17:45 +01:00
|
|
|
index 6508fdf..6c6ffa7 100644
|
2014-07-21 22:46:54 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/ServerConnection.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/ServerConnection.java
|
2014-11-28 02:17:45 +01:00
|
|
|
@@ -57,6 +57,13 @@ public class ServerConnection {
|
|
|
|
List list = this.g;
|
2014-07-21 22:46:54 +02:00
|
|
|
|
2014-11-28 02:17:45 +01:00
|
|
|
synchronized (this.g) {
|
2014-07-21 22:46:54 +02: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 )
|
|
|
|
+ {
|
2014-11-28 02:17:45 +01:00
|
|
|
+ Collections.shuffle( this.g );
|
2014-07-21 22:46:54 +02:00
|
|
|
+ }
|
|
|
|
+ // Spigot End
|
2014-11-28 02:17:45 +01:00
|
|
|
Iterator iterator = this.g.iterator();
|
2014-07-21 22:46:54 +02:00
|
|
|
|
|
|
|
while (iterator.hasNext()) {
|
|
|
|
diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java
|
2014-11-28 02:17:45 +01:00
|
|
|
index a0d88ec..f19d415 100644
|
2014-07-21 22:46:54 +02:00
|
|
|
--- a/src/main/java/org/spigotmc/SpigotConfig.java
|
|
|
|
+++ b/src/main/java/org/spigotmc/SpigotConfig.java
|
2014-07-30 10:35:19 +02:00
|
|
|
@@ -273,4 +273,10 @@ public class SpigotConfig
|
2014-07-21 22:46:54 +02: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 );
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
--
|
2014-11-28 02:17:45 +01:00
|
|
|
2.1.0
|
2014-07-21 22:46:54 +02:00
|
|
|
|