From f30c245be2560618c1f15a9ed6a950b982d6d954 Mon Sep 17 00:00:00 2001 From: Zach Brown <1254957+zachbr@users.noreply.github.com> Date: Thu, 12 May 2016 23:04:49 -0500 Subject: [PATCH] Make watchdoge disabler its own patch file Change implementation, smaller diff, less NPE --- ...ient-crashes-server-lists-and-Mojang.patch | 8 -------- ...tem-property-for-disabling-watchdoge.patch | 20 +++++++++++++++++++ 2 files changed, 20 insertions(+), 8 deletions(-) create mode 100644 Spigot-Server-Patches/System-property-for-disabling-watchdoge.patch diff --git a/Spigot-Server-Patches/Show-Paper-in-client-crashes-server-lists-and-Mojang.patch b/Spigot-Server-Patches/Show-Paper-in-client-crashes-server-lists-and-Mojang.patch index 4939b95e7c..1a8232151e 100644 --- a/Spigot-Server-Patches/Show-Paper-in-client-crashes-server-lists-and-Mojang.patch +++ b/Spigot-Server-Patches/Show-Paper-in-client-crashes-server-lists-and-Mojang.patch @@ -58,14 +58,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 this.timeoutTime = timeoutTime; this.restart = restart; } - - public static void doStart(int timeoutTime, boolean restart) - { -- if ( instance == null ) -+ if ( !Boolean.getBoolean("disable.watchdog") && instance == null ) // Paper - Add property to disable - { - instance = new WatchdogThread( timeoutTime * 1000L, restart ); - instance.start(); @@ -0,0 +0,0 @@ public class WatchdogThread extends Thread { Logger log = Bukkit.getServer().getLogger(); diff --git a/Spigot-Server-Patches/System-property-for-disabling-watchdoge.patch b/Spigot-Server-Patches/System-property-for-disabling-watchdoge.patch new file mode 100644 index 0000000000..7ec4d8aa14 --- /dev/null +++ b/Spigot-Server-Patches/System-property-for-disabling-watchdoge.patch @@ -0,0 +1,20 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Zach Brown <1254957+zachbr@users.noreply.github.com> +Date: Thu, 12 May 2016 23:02:58 -0500 +Subject: [PATCH] System property for disabling watchdoge + + +diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/spigotmc/WatchdogThread.java ++++ b/src/main/java/org/spigotmc/WatchdogThread.java +@@ -0,0 +0,0 @@ public class WatchdogThread extends Thread + while ( !stopping ) + { + // +- if ( lastTick != 0 && System.currentTimeMillis() > lastTick + timeoutTime ) ++ if ( lastTick != 0 && System.currentTimeMillis() > lastTick + timeoutTime && !Boolean.getBoolean("disable.watchdog")) // Paper - Add property to disable + { + Logger log = Bukkit.getServer().getLogger(); + log.log( Level.SEVERE, "The server has stopped responding!" ); +-- \ No newline at end of file