Make watchdoge disabler its own patch file

Change implementation, smaller diff, less NPE
This commit is contained in:
Zach Brown 2016-05-12 23:04:49 -05:00
parent 6025355569
commit f30c245be2
2 changed files with 20 additions and 8 deletions

View File

@ -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();

View File

@ -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!" );
--