3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-18 04:20:08 +01:00

Don't handle sync packets for kicked players

Dieser Commit ist enthalten in:
md_5 2019-02-03 14:23:04 +11:00
Ursprung d5e96882ad
Commit 2ced02339a
2 geänderte Dateien mit 11 neuen und 1 gelöschten Zeilen

Datei anzeigen

@ -73,7 +73,7 @@
+ } + }
+ +
+ private final org.bukkit.craftbukkit.CraftServer server; + private final org.bukkit.craftbukkit.CraftServer server;
+ private boolean processedDisconnect; + public boolean processedDisconnect;
+ private int lastTick = MinecraftServer.currentTick; + private int lastTick = MinecraftServer.currentTick;
+ private int allowedPlayerTicks = 1; + private int allowedPlayerTicks = 1;
+ private int lastDropTick = MinecraftServer.currentTick; + private int lastDropTick = MinecraftServer.currentTick;

Datei anzeigen

@ -0,0 +1,10 @@
--- a/net/minecraft/server/PlayerConnectionUtils.java
+++ b/net/minecraft/server/PlayerConnectionUtils.java
@@ -5,6 +5,7 @@
public static <T extends PacketListener> void ensureMainThread(Packet<T> packet, T t0, IAsyncTaskHandler iasynctaskhandler) throws CancelledPacketHandleException {
if (!iasynctaskhandler.isMainThread()) {
iasynctaskhandler.postToMainThread(() -> {
+ if (t0 instanceof PlayerConnection && ((PlayerConnection) t0).processedDisconnect) return; // CraftBukkit
packet.a(t0);
});
throw CancelledPacketHandleException.INSTANCE;