Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-18 04:20:08 +01:00
SPIGOT-2622: Ensure all players are safely disconnected on shutdown
Dieser Commit ist enthalten in:
Ursprung
4507d99aea
Commit
4db0855e3e
@ -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;
|
||||
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren