-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a bit of extra debugging to chat order/time errors
I do wanna add some leeway to the kick, if message was sent within 30-60 seconds of the last message, assume clock drift and just ignore the kick (send a message? just silently ignore?), but, I'm not 100% on this one
- Loading branch information
1 parent
c879064
commit a05e69b
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
patches/server/0923-Add-some-minimal-debug-information-to-chat-packet-er.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
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 6f2006c53a27531ab04a95e446e30d85eb422970..1290f1c33062b2ea821abca33433a53662b6d340 100644 | ||
--- 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(); |