Disable Watchdog when restarting

This commit is contained in:
Thinkofdeath 2014-04-29 09:24:36 +01:00
parent 7af31d2942
commit e161d2f0cb

View File

@ -1,9 +1,277 @@
From ae16eaf1009911e4f515a72b37cbb2bf55a32a0c Mon Sep 17 00:00:00 2001 From 91e137f00b53a82e6acc86c8eb6f773e79aa8875 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au> From: md_5 <md_5@live.com.au>
Date: Sat, 23 Feb 2013 12:33:20 +1100 Date: Sat, 23 Feb 2013 12:33:20 +1100
Subject: [PATCH] Watchdog Thread. Subject: [PATCH] Watchdog Thread.
diff --git a/dependency-reduced-pom.xml b/dependency-reduced-pom.xml
new file mode 100644
index 0000000..d7b8891
--- /dev/null
+++ b/dependency-reduced-pom.xml
@@ -0,0 +1,262 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <artifactId>spigot-parent</artifactId>
+ <groupId>org.spigotmc</groupId>
+ <version>dev-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.spigotmc</groupId>
+ <artifactId>spigot</artifactId>
+ <name>Spigot</name>
+ <version>1.7.9-R0.1-SNAPSHOT</version>
+ <url>http://www.spigotmc.org</url>
+ <build>
+ <defaultGoal>install</defaultGoal>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.m2e</groupId>
+ <artifactId>lifecycle-mapping</artifactId>
+ <version>1.0.0</version>
+ <configuration>
+ <lifecycleMappingMetadata>
+ <pluginExecutions>
+ <pluginExecution>
+ <pluginExecutionFilter>
+ <groupId>com.lukegb.mojo</groupId>
+ <artifactId>gitdescribe-maven-plugin</artifactId>
+ <versionRange>[1.3,)</versionRange>
+ <goals>
+ <goal>gitdescribe</goal>
+ </goals>
+ </pluginExecutionFilter>
+ <action>
+ <ignore />
+ </action>
+ </pluginExecution>
+ </pluginExecutions>
+ </lifecycleMappingMetadata>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>com.lukegb.mojo</groupId>
+ <artifactId>gitdescribe-maven-plugin</artifactId>
+ <version>1.3</version>
+ <executions>
+ <execution>
+ <phase>compile</phase>
+ <goals>
+ <goal>gitdescribe</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <outputPrefix>git-Spigot-</outputPrefix>
+ <outputPostfix />
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>2.1</version>
+ <configuration>
+ <archive>
+ <manifestEntries>
+ <Main-Class>org.bukkit.craftbukkit.Main</Main-Class>
+ <Implementation-Title>CraftBukkit</Implementation-Title>
+ <Implementation-Version>${describe}</Implementation-Version>
+ <Implementation-Vendor>Bukkit Team</Implementation-Vendor>
+ <Specification-Title>Bukkit</Specification-Title>
+ <Specification-Version>${api.version}</Specification-Version>
+ <Specification-Vendor>Bukkit Team</Specification-Vendor>
+ <Sealed>true</Sealed>
+ </manifestEntries>
+ <manifestSections>
+ <manifestSection>
+ <name>net/bukkit/</name>
+ <manifestEntries>
+ <Sealed>true</Sealed>
+ </manifestEntries>
+ </manifestSection>
+ <manifestSection>
+ <name>com/bukkit/</name>
+ <manifestEntries>
+ <Sealed>true</Sealed>
+ </manifestEntries>
+ </manifestSection>
+ <manifestSection>
+ <name>org/bukkit/</name>
+ <manifestEntries>
+ <Sealed>true</Sealed>
+ </manifestEntries>
+ </manifestSection>
+ </manifestSections>
+ </archive>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-shade-plugin</artifactId>
+ <version>2.1</version>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>shade</goal>
+ </goals>
+ <configuration>
+ <relocations>
+ <relocation>
+ <pattern>org.bouncycastle</pattern>
+ <shadedPattern>net.minecraft.v${minecraft_version}.org.bouncycastle</shadedPattern>
+ </relocation>
+ <relocation>
+ <pattern>joptsimple</pattern>
+ <shadedPattern>org.bukkit.craftbukkit.libs.joptsimple</shadedPattern>
+ </relocation>
+ <relocation>
+ <pattern>jline</pattern>
+ <shadedPattern>org.bukkit.craftbukkit.libs.jline</shadedPattern>
+ </relocation>
+ <relocation>
+ <pattern>org.ibex</pattern>
+ <shadedPattern>org.bukkit.craftbukkit.libs.org.ibex</shadedPattern>
+ </relocation>
+ <relocation>
+ <pattern>org.gjt</pattern>
+ <shadedPattern>org.bukkit.craftbukkit.libs.org.gjt</shadedPattern>
+ </relocation>
+ <relocation>
+ <pattern>com.google.gson</pattern>
+ <shadedPattern>org.bukkit.craftbukkit.libs.com.google.gson</shadedPattern>
+ </relocation>
+ <relocation>
+ <pattern>org.bukkit.craftbukkit</pattern>
+ <shadedPattern>org.bukkit.craftbukkit.v${minecraft_version}</shadedPattern>
+ <excludes>
+ <exclude>org.bukkit.craftbukkit.Main*</exclude>
+ </excludes>
+ </relocation>
+ <relocation>
+ <pattern>net.minecraft.server</pattern>
+ <shadedPattern>net.minecraft.server.v${minecraft_version}</shadedPattern>
+ </relocation>
+ </relocations>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.3.2</version>
+ <configuration>
+ <source>1.6</source>
+ <target>1.6</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.11</version>
+ <configuration>
+ <workingDirectory>${basedir}/target/test-server</workingDirectory>
+ <excludes>
+ <exclude>org/bukkit/craftbukkit/updater/BukkitDLUpdaterServiceTest.java</exclude>
+ <exclude>org/bukkit/craftbukkit/inventory/ItemStack*Test.java</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-resources-plugin</artifactId>
+ <version>2.4.3</version>
+ <executions>
+ <execution>
+ <id>maps-file</id>
+ <phase>package</phase>
+ <goals>
+ <goal>copy-resources</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>${basedir}/target</outputDirectory>
+ <resources>
+ <resource>
+ <directory>${basedir}</directory>
+ <filtering>true</filtering>
+ <includes>
+ <include>maps.yml</include>
+ </includes>
+ </resource>
+ </resources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>com.wolvereness</groupId>
+ <artifactId>overmapped</artifactId>
+ <version>0.0.2</version>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>map</goal>
+ </goals>
+ <configuration>
+ <maps>${basedir}/target/maps.yml</maps>
+ <input>${basedir}/target/${project.artifactId}-${project.version}.jar</input>
+ <original>${basedir}/target/unmapped-${project.artifactId}-${project.version}.jar</original>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ <repositories>
+ <repository>
+ <id>repobo-snap</id>
+ <url>http://repo.bukkit.org/content/groups/public</url>
+ </repository>
+ </repositories>
+ <pluginRepositories>
+ <pluginRepository>
+ <id>bukkit-plugins</id>
+ <url>http://repo.bukkit.org/content/groups/public</url>
+ </pluginRepository>
+ </pluginRepositories>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.11</version>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <artifactId>hamcrest-core</artifactId>
+ <groupId>org.hamcrest</groupId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.hamcrest</groupId>
+ <artifactId>hamcrest-library</artifactId>
+ <version>1.3</version>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <artifactId>hamcrest-core</artifactId>
+ <groupId>org.hamcrest</groupId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ </dependencies>
+ <properties>
+ <minecraft_version>1_7_R3</minecraft_version>
+ <buildtag.prefix>git-Bukkit-</buildtag.prefix>
+ <api.version>unknown</api.version>
+ <minecraft.version>1.7.9</minecraft.version>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <junit.version>4.11</junit.version>
+ </properties>
+</project>
+
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 007fb86..51f1761 100644 index 007fb86..51f1761 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
@ -26,10 +294,10 @@ index 007fb86..51f1761 100644
} }
diff --git a/src/main/java/org/spigotmc/RestartCommand.java b/src/main/java/org/spigotmc/RestartCommand.java diff --git a/src/main/java/org/spigotmc/RestartCommand.java b/src/main/java/org/spigotmc/RestartCommand.java
new file mode 100644 new file mode 100644
index 0000000..7c086fd index 0000000..3e4203f
--- /dev/null --- /dev/null
+++ b/src/main/java/org/spigotmc/RestartCommand.java +++ b/src/main/java/org/spigotmc/RestartCommand.java
@@ -0,0 +1,110 @@ @@ -0,0 +1,113 @@
+package org.spigotmc; +package org.spigotmc;
+ +
+import java.io.File; +import java.io.File;
@ -70,6 +338,9 @@ index 0000000..7c086fd
+ { + {
+ System.out.println( "Attempting to restart with " + SpigotConfig.restartScript ); + System.out.println( "Attempting to restart with " + SpigotConfig.restartScript );
+ +
+ // Disable Watchdog
+ WatchdogThread.doStop();
+
+ // Kick all players + // Kick all players
+ for ( EntityPlayer p : (List< EntityPlayer>) MinecraftServer.getServer().getPlayerList().players ) + for ( EntityPlayer p : (List< EntityPlayer>) MinecraftServer.getServer().getPlayerList().players )
+ { + {