diff options
author | md_5 <git@md-5.net> | 2016-08-23 14:02:48 +1000 |
---|---|---|
committer | md_5 <git@md-5.net> | 2016-08-23 14:02:48 +1000 |
commit | 4db0855e3e1cbac09c819f140cf2f5590f5d0997 (patch) | |
tree | d64adb1c0dc0ce358446497ce9e6ab920f63ea9f /nms-patches/PlayerList.patch | |
parent | 4507d99aeac5af1d6076e0739505f8525633f8f6 (diff) | |
download | craftbukkit-4db0855e3e1cbac09c819f140cf2f5590f5d0997.tar craftbukkit-4db0855e3e1cbac09c819f140cf2f5590f5d0997.tar.gz craftbukkit-4db0855e3e1cbac09c819f140cf2f5590f5d0997.tar.lz craftbukkit-4db0855e3e1cbac09c819f140cf2f5590f5d0997.tar.xz craftbukkit-4db0855e3e1cbac09c819f140cf2f5590f5d0997.zip |
SPIGOT-2622: Ensure all players are safely disconnected on shutdown
Diffstat (limited to 'nms-patches/PlayerList.patch')
-rw-r--r-- | nms-patches/PlayerList.patch | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/nms-patches/PlayerList.patch b/nms-patches/PlayerList.patch index 428ef235..a1c98d9f 100644 --- a/nms-patches/PlayerList.patch +++ b/nms-patches/PlayerList.patch @@ -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; |