From aec53a59da9f4f52b8866d2575d7dc60e433c89c Mon Sep 17 00:00:00 2001 From: md_5 Date: Sun, 26 Jan 2014 12:30:38 +1100 Subject: [PATCH] Initialise ping array on startup. The code to decide when to regenerate the array is a bit iffy (Mojang!), as it relies on System.nanoTime() which is not an absolute time source. --- CraftBukkit-Patches/0102-Fix-Ping-Player-Sample.patch | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CraftBukkit-Patches/0102-Fix-Ping-Player-Sample.patch b/CraftBukkit-Patches/0102-Fix-Ping-Player-Sample.patch index 2d2ea9d4cb..b1ec18abe6 100644 --- a/CraftBukkit-Patches/0102-Fix-Ping-Player-Sample.patch +++ b/CraftBukkit-Patches/0102-Fix-Ping-Player-Sample.patch @@ -1,22 +1,22 @@ -From d8be3082b4cc82d525e1152efc58bced681890b1 Mon Sep 17 00:00:00 2001 +From 331f61fc74453d744df31d52edf5c9b804fb9597 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sun, 26 Jan 2014 12:13:31 +1100 Subject: [PATCH] Fix Ping Player Sample diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index a549a95..e967d17 100644 +index 022e032..9c602b4 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -105,6 +105,7 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo private static final int TPS = 20; private static final int TICK_TIME = 1000000000 / TPS; public final double[] recentTps = new double[ 3 ]; -+ public EntityPlayer[] pingPlayers; ++ public EntityPlayer[] pingPlayers = new EntityPlayer[ 0 ]; // Spigot end public MinecraftServer(OptionSet options, Proxy proxy) { // CraftBukkit - signature file -> OptionSet -@@ -560,15 +561,23 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo +@@ -561,15 +562,23 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo if (i - this.T >= 5000000000L) { this.T = i; this.p.setPlayerSample(new ServerPingPlayerSample(this.C(), this.B()));