2016-03-07 08:52:16 +00:00
|
|
|
From fba2f6ee2a40f41132372e125ec3086fa613c5fb Mon Sep 17 00:00:00 2001
|
2015-07-22 09:04:46 +00:00
|
|
|
From: md_5 <git@md-5.net>
|
|
|
|
Date: Wed, 22 Jul 2015 19:04:37 +1000
|
|
|
|
Subject: [PATCH] Clear Packet Queue on Disconnect
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java
|
2016-02-29 21:33:06 +00:00
|
|
|
index 4c6dfb1..a9ea3f5 100644
|
2015-07-22 09:04:46 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/NetworkManager.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/NetworkManager.java
|
2016-02-29 21:33:06 +00:00
|
|
|
@@ -316,6 +316,7 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> {
|
|
|
|
} else if (this.i() != null) {
|
|
|
|
this.i().a(new ChatComponentText("Disconnected"));
|
2015-07-22 09:04:46 +00:00
|
|
|
}
|
|
|
|
+ this.i.clear(); // Free up packet queue.
|
|
|
|
}
|
2016-02-29 21:33:06 +00:00
|
|
|
|
|
|
|
}
|
2015-07-23 06:23:21 +00:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
|
2016-03-07 08:52:16 +00:00
|
|
|
index 5217c1c..99707f0 100644
|
2015-07-23 06:23:21 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
2016-03-07 08:52:16 +00:00
|
|
|
@@ -1076,7 +1076,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
|
2015-07-23 06:23:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// CraftBukkit start
|
|
|
|
- if (packet == null) {
|
|
|
|
+ if (packet == null || this.processedDisconnect) { // Spigot
|
|
|
|
return;
|
|
|
|
} else if (packet instanceof PacketPlayOutSpawnPosition) {
|
|
|
|
PacketPlayOutSpawnPosition packet6 = (PacketPlayOutSpawnPosition) packet;
|
2015-07-22 09:04:46 +00:00
|
|
|
--
|
2016-02-29 21:33:06 +00:00
|
|
|
2.5.0
|
2015-07-22 09:04:46 +00:00
|
|
|
|