diff options
Diffstat (limited to 'patches/server/0830-Add-some-minimal-debug-information-to-chat-packet-er.patch')
-rw-r--r-- | patches/server/0830-Add-some-minimal-debug-information-to-chat-packet-er.patch | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/patches/server/0830-Add-some-minimal-debug-information-to-chat-packet-er.patch b/patches/server/0830-Add-some-minimal-debug-information-to-chat-packet-er.patch new file mode 100644 index 0000000000..7d232d5b1a --- /dev/null +++ b/patches/server/0830-Add-some-minimal-debug-information-to-chat-packet-er.patch @@ -0,0 +1,20 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Shane Freeder <[email protected]> +Date: Wed, 6 Jul 2022 05:52:22 +0100 +Subject: [PATCH] Add some minimal debug information to chat packet errors + +TODO: potentially add some kick leeway + +diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +index 616ea3055c854872fbb5754bdf0b67deac1b4b58..e6efb852e2454294073968de546b5c61b6131766 100644 +--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java ++++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +@@ -2148,7 +2148,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl + + private Optional<LastSeenMessages> tryHandleChat(String message, Instant timestamp, LastSeenMessages.Update acknowledgment) { + if (!this.updateChatOrder(timestamp)) { +- ServerGamePacketListenerImpl.LOGGER.warn("{} sent out-of-order chat: '{}'", this.player.getName().getString(), message); ++ ServerGamePacketListenerImpl.LOGGER.warn("{} sent out-of-order chat: '{}': {} > {}", this.player.getName().getString(), message, this.lastChatTimeStamp.get().getEpochSecond(), timestamp.getEpochSecond()); // Paper + this.server.scheduleOnMain(() -> { // Paper - push to main + this.disconnect(Component.translatable("multiplayer.disconnect.out_of_order_chat"), org.bukkit.event.player.PlayerKickEvent.Cause.OUT_OF_ORDER_CHAT); // Paper - kick event causes + }); // Paper - push to main |