0
0
mirror of https://hub.spigotmc.org/stash/scm/spigot/spigot.git synced 2024-11-24 15:16:26 +00:00
spigot/CraftBukkit-Patches/0068-Clear-Packet-Queue-on-Disconnect.patch
2024-10-23 02:15:00 +11:00

35 lines
1.6 KiB
Diff

From 2a848fdbff8b8680aa3ea929614f1fa639fc1207 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
diff --git a/src/main/java/net/minecraft/network/NetworkManager.java b/src/main/java/net/minecraft/network/NetworkManager.java
index 1cae281e6d..d4b05e46d1 100644
--- a/src/main/java/net/minecraft/network/NetworkManager.java
+++ b/src/main/java/net/minecraft/network/NetworkManager.java
@@ -674,6 +674,7 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> {
packetlistener1.onDisconnect(disconnectiondetails);
}
+ this.pendingActions.clear(); // Free up packet queue.
}
}
diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
index 96f2807736..b4551ca7aa 100644
--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
@@ -261,7 +261,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
public void send(Packet<?> packet, @Nullable PacketSendListener packetsendlistener) {
// CraftBukkit start
- if (packet == null) {
+ if (packet == null || this.processedDisconnect) { // Spigot
return;
} else if (packet instanceof PacketPlayOutSpawnPosition) {
PacketPlayOutSpawnPosition packet6 = (PacketPlayOutSpawnPosition) packet;
--
2.47.0