2014-03-26 20:34:47 +00:00
|
|
|
From 4f70801d7449858686bdfd5628f871ab08c0e2bf Mon Sep 17 00:00:00 2001
|
2013-06-11 01:54:45 +00:00
|
|
|
From: md_5 <md_5@live.com.au>
|
|
|
|
Date: Tue, 11 Jun 2013 11:54:32 +1000
|
|
|
|
Subject: [PATCH] Prevent Shutdown Hang
|
|
|
|
|
|
|
|
Prevents server hanging if players disconnect during the shutdown sequence.
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
|
2014-03-26 20:34:47 +00:00
|
|
|
index 5b0590e..1fb24f7 100644
|
2013-06-11 01:54:45 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/PlayerList.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/PlayerList.java
|
2014-03-26 20:34:47 +00:00
|
|
|
@@ -1110,8 +1110,15 @@ public abstract class PlayerList {
|
2013-12-01 03:40:53 +00:00
|
|
|
}
|
2013-06-11 01:54:45 +00:00
|
|
|
|
|
|
|
public void r() {
|
2013-12-01 03:40:53 +00:00
|
|
|
- for (int i = 0; i < this.players.size(); ++i) {
|
|
|
|
- ((EntityPlayer) this.players.get(i)).playerConnection.disconnect(this.server.server.getShutdownMessage()); // CraftBukkit - add custom shutdown message
|
|
|
|
+ while (!this.players.isEmpty()) {
|
2013-06-11 01:54:45 +00:00
|
|
|
+ // Spigot start
|
|
|
|
+ EntityPlayer p = (EntityPlayer) this.players.get( 0 );
|
|
|
|
+ p.playerConnection.disconnect( this.server.server.getShutdownMessage() );
|
|
|
|
+ if ( ( !this.players.isEmpty() ) && ( this.players.get( 0 ) == p ) )
|
|
|
|
+ {
|
|
|
|
+ this.players.remove( 0 ); // Prevent shutdown hang if already disconnected
|
|
|
|
+ }
|
|
|
|
+ // Spigot end
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
--
|
2014-03-26 20:34:47 +00:00
|
|
|
1.8.5.2.msysgit.0
|
2013-06-11 01:54:45 +00:00
|
|
|
|