2022-07-06 06:53:16 +02:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
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
2022-07-27 20:52:03 +02:00
index 924d0601dab2e1b4e38dd138c9ecd7287ca4d733..8914b20e5823c0b0cfccf986db9e9265b7f757f5 100644
2022-07-06 06:53:16 +02:00
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2159,14 +2159,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
private boolean tryHandleChat(String s, Instant instant) {
if (!this.updateChatOrder(instant)) {
- ServerGamePacketListenerImpl.LOGGER.warn("{} sent out-of-order chat: '{}'", this.player.getName().getString(), s);
+ ServerGamePacketListenerImpl.LOGGER.warn("{} sent out-of-order chat: '{}'; {} > {}", this.player.getName().getString(), s, this.lastChatTimeStamp.get().getEpochSecond(), instant.getEpochSecond()); // Paper
this.server.scheduleOnMain(() -> { // Paper - push to main
this.disconnect(Component.translatable("multiplayer.disconnect.out_of_order_chat"));
}); // Paper - push to main
return false;
} else {
if (this.isChatExpired(instant)) {
- ServerGamePacketListenerImpl.LOGGER.warn("{} sent expired chat: '{}'. Is the client/server system time unsynchronized?", this.player.getName().getString(), s);
+ ServerGamePacketListenerImpl.LOGGER.warn("{} sent expired chat: '{}'. Is the client/server system time unsynchronized? c: {} s: {}", this.player.getName().getString(), s, instant.getEpochSecond(), Instant.now().getEpochSecond()); // Paper
}
return this.resetLastActionTime();