mirror of
https://github.com/PaperMC/Paper.git
synced 2025-07-31 20:22:05 -07:00
Restructure PaperSpigot as a new set of modules
Allows us much greater control over the Spigot portion of the code and makes us more "proper" Credit to @Dmck2b for originally passing the idea along a while back
This commit is contained in:
30
CraftBukkit-Patches/0029-Prevent-Shutdown-Hang.patch
Normal file
30
CraftBukkit-Patches/0029-Prevent-Shutdown-Hang.patch
Normal file
@@ -0,0 +1,30 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
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
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerList.java
|
||||
@@ -0,0 +0,0 @@ public abstract class PlayerList {
|
||||
}
|
||||
|
||||
public void u() {
|
||||
- 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()) {
|
||||
+ // 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
|
||||
}
|
||||
}
|
||||
|
||||
--
|
Reference in New Issue
Block a user