summaryrefslogtreecommitdiffhomepage
path: root/patches/server/0917-Add-some-minimal-debug-information-to-chat-packet-er.patch
blob: 26a62579aca7f734fd4530b1af3850763791956c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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
index ad083a1e57e15568d05f54f5606f7c9b355c1927..66fa86f67a835b7a4c2de6c5111367d1ab6034fb 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2294,7 +2294,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
 
     private boolean 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"));
             }); // Paper - push to main
@@ -2550,7 +2550,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
             return false;
         } else {
             if (message.hasExpiredServer(Instant.now())) {
-                ServerGamePacketListenerImpl.LOGGER.warn("{} sent expired chat: '{}'. Is the client/server system time unsynchronized?", this.player.getName().getString(), message.signedContent().plain());
+                ServerGamePacketListenerImpl.LOGGER.warn("{} sent expired chat: '{}'. Is the client/server system time unsynchronized? c: {} s: {}", this.player.getName().getString(), message.signedContent().plain(), message.timeStamp().getEpochSecond(), Instant.now().getEpochSecond()); // Paper
             }
 
             return true;