3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-15 04:20:04 +01:00
Paper/patches/server/0810-Treat-sequence-violations-like-they-should-be.patch

19 Zeilen
1.2 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
Date: Thu, 30 Mar 2023 03:13:58 +0100
Subject: [PATCH] Treat sequence violations like they should be
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index d83650ea63a6ec76efd0a46dc1eb0b4735b81490..6eee43f2005f4bc937f7411c17d431a3b95093c1 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1975,6 +1975,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
public void ackBlockChangesUpTo(int sequence) {
if (sequence < 0) {
2024-06-14 14:11:52 +02:00
+ this.disconnect(Component.literal("Expected packet sequence nr >= 0"), org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_ACTION); // Paper - Treat sequence violations like they should be
throw new IllegalArgumentException("Expected packet sequence nr >= 0");
} else {
this.ackBlockChangesUpTo = Math.max(sequence, this.ackBlockChangesUpTo);