mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-09 03:43:40 +01:00
SPIGOT-2622: Ensure all players are safely disconnected on shutdown
By: md_5 <git@md-5.net>
This commit is contained in:
parent
cf6a18e39f
commit
7b4d8c3f3f
1 changed files with 12 additions and 8 deletions
|
@ -841,24 +841,28 @@
|
|||
}
|
||||
|
||||
public boolean getHasWhitelist() {
|
||||
@@ -836,16 +1270,26 @@
|
||||
@@ -835,17 +1269,29 @@
|
||||
}
|
||||
|
||||
public void u() {
|
||||
for (int i = 0; i < this.players.size(); ++i) {
|
||||
- for (int i = 0; i < this.players.size(); ++i) {
|
||||
- ((EntityPlayer) this.players.get(i)).playerConnection.disconnect("Server closed");
|
||||
+ ((EntityPlayer) this.players.get(i)).playerConnection.disconnect(this.server.server.getShutdownMessage()); // CraftBukkit - add custom shutdown message
|
||||
+ // CraftBukkit start - disconnect safely
|
||||
+ for (EntityPlayer player : this.players) {
|
||||
+ player.playerConnection.disconnect(this.server.server.getShutdownMessage()); // CraftBukkit - add custom shutdown message
|
||||
}
|
||||
|
||||
}
|
||||
+ // CraftBukkit end
|
||||
+
|
||||
+ }
|
||||
|
||||
+ // CraftBukkit start
|
||||
+ public void sendMessage(IChatBaseComponent[] iChatBaseComponents) {
|
||||
+ for (IChatBaseComponent component : iChatBaseComponents) {
|
||||
+ sendMessage(component, true);
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
+ // CraftBukkit end
|
||||
+
|
||||
|
||||
public void sendMessage(IChatBaseComponent ichatbasecomponent, boolean flag) {
|
||||
this.server.sendMessage(ichatbasecomponent);
|
||||
int i = flag ? 1 : 0;
|
||||
|
@ -870,7 +874,7 @@
|
|||
}
|
||||
|
||||
public void sendMessage(IChatBaseComponent ichatbasecomponent) {
|
||||
@@ -882,8 +1326,10 @@
|
||||
@@ -882,8 +1328,10 @@
|
||||
WorldServer[] aworldserver = this.server.worldServer;
|
||||
int j = aworldserver.length;
|
||||
|
||||
|
|
Loading…
Reference in a new issue