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
|
2023-09-22 19:31:02 +02:00
|
|
|
index 97d50c49178d0bbd736c652a4676a37f0dcb8a3b..70925fb9fd4ee22b8c519861fa5cd1ba93bfc2b3 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
|
2023-09-22 17:35:51 +02:00
|
|
|
@@ -2134,7 +2134,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
2022-08-06 00:58:34 +02:00
|
|
|
|
2022-12-07 22:57:15 +01:00
|
|
|
private Optional<LastSeenMessages> tryHandleChat(String message, Instant timestamp, LastSeenMessages.Update acknowledgment) {
|
2022-07-27 23:50:05 +02:00
|
|
|
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
|
2022-07-06 06:53:16 +02:00
|
|
|
this.server.scheduleOnMain(() -> { // Paper - push to main
|
2023-09-17 00:54:33 +02:00
|
|
|
this.disconnect(Component.translatable("multiplayer.disconnect.out_of_order_chat"), org.bukkit.event.player.PlayerKickEvent.Cause.OUT_OF_ORDER_CHAT); // Paper - kick event causes
|
2022-07-06 06:53:16 +02:00
|
|
|
}); // Paper - push to main
|