2013-09-23 02:48:38 +02:00
|
|
|
From 0dc0c332b02bfa4d76bc029e89a6c59f28b13198 Mon Sep 17 00:00:00 2001
|
2013-06-11 03:54:45 +02: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
|
2013-09-12 02:17:46 +02:00
|
|
|
index 20b9c5d..a85157b 100644
|
2013-06-11 03:54:45 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/PlayerList.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/PlayerList.java
|
2013-09-12 02:17:46 +02:00
|
|
|
@@ -1064,7 +1064,14 @@ public abstract class PlayerList {
|
2013-06-11 03:54:45 +02:00
|
|
|
|
|
|
|
public void r() {
|
|
|
|
while (!this.players.isEmpty()) {
|
|
|
|
- ((EntityPlayer) this.players.get(0)).playerConnection.disconnect(this.server.server.getShutdownMessage()); // CraftBukkit - add custom shutdown message
|
|
|
|
+ // 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
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
--
|
|
|
|
1.8.1.2
|
|
|
|
|