Don't allow sendPacket once disconnect has been processed.

This commit is contained in:
Aikar 2015-07-23 16:23:21 +10:00 committed by Byteflux
parent 8ae7fb531a
commit d7307859fa

View File

@ -1,4 +1,4 @@
From edea113458ab413ab9c43ec7be3fa1382e45fece Mon Sep 17 00:00:00 2001
From afb701ae339e92d7c574baec7d09a3b0affa123d Mon Sep 17 00:00:00 2001
From: md_5 <git@md-5.net>
Date: Wed, 22 Jul 2015 19:04:37 +1000
Subject: [PATCH] Clear Packet Queue on Disconnect
@ -16,6 +16,19 @@ index 247973d..9d23c6c 100644
} else {
NetworkManager.g.warn("handleDisconnection() called twice");
}
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index dce0ac4..e380774 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -868,7 +868,7 @@ public class PlayerConnection implements PacketListenerPlayIn, IUpdatePlayerList
}
// CraftBukkit start
- if (packet == null) {
+ if (packet == null || this.processedDisconnect) { // Spigot
return;
} else if (packet instanceof PacketPlayOutSpawnPosition) {
PacketPlayOutSpawnPosition packet6 = (PacketPlayOutSpawnPosition) packet;
--
2.1.4