2015-07-23 22:43:27 +02:00
|
|
|
From 9b4c6412b90ef97bf2d1795b3cc8cca78ce88670 Mon Sep 17 00:00:00 2001
|
2015-07-22 11:04:46 +02: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
|
|
|
|
index 247973d..9d23c6c 100644
|
|
|
|
--- a/src/main/java/net/minecraft/server/NetworkManager.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/NetworkManager.java
|
|
|
|
@@ -313,6 +313,7 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet> {
|
|
|
|
} else if (this.getPacketListener() != null) {
|
|
|
|
this.getPacketListener().a(new ChatComponentText("Disconnected"));
|
|
|
|
}
|
|
|
|
+ this.i.clear(); // Free up packet queue.
|
|
|
|
} else {
|
|
|
|
NetworkManager.g.warn("handleDisconnection() called twice");
|
|
|
|
}
|
2015-07-23 08:23:21 +02:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
|
2015-07-23 22:43:27 +02:00
|
|
|
index a6d8b96..2124daa 100644
|
2015-07-23 08:23:21 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
2015-07-23 22:43:27 +02:00
|
|
|
@@ -882,7 +882,7 @@ public class PlayerConnection implements PacketListenerPlayIn, IUpdatePlayerList
|
2015-07-23 08:23:21 +02: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 11:04:46 +02:00
|
|
|
--
|
|
|
|
2.1.4
|
|
|
|
|