9
0
mirror of https://github.com/Dreeam-qwq/Gale.git synced 2025-12-21 15:59:28 +00:00
Files
Gale/patches/server/0057-Do-not-log-expired-message-warnings.patch
2022-12-26 06:10:56 +01:00

42 lines
2.6 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Martijn Muijsers <martijnmuijsers@live.nl>
Date: Fri, 25 Nov 2022 15:07:55 +0100
Subject: [PATCH] Do not log expired message warnings
License: AGPL-3.0 (https://www.gnu.org/licenses/agpl-3.0.html)
Gale - https://galemc.org
diff --git a/src/main/java/net/minecraft/network/chat/SignedMessageChain.java b/src/main/java/net/minecraft/network/chat/SignedMessageChain.java
index c0a80824a0307ea673805015119cc834b268f0dc..d7c6e90ccf3a8ce58e5533c5158ce62668cbcb78 100644
--- a/src/main/java/net/minecraft/network/chat/SignedMessageChain.java
+++ b/src/main/java/net/minecraft/network/chat/SignedMessageChain.java
@@ -8,6 +8,7 @@ import net.minecraft.util.SignatureUpdater;
import net.minecraft.util.SignatureValidator;
import net.minecraft.util.Signer;
import net.minecraft.world.entity.player.ProfilePublicKey;
+import org.galemc.gale.configuration.GaleGlobalConfiguration;
import org.slf4j.Logger;
public class SignedMessageChain {
@@ -42,7 +43,7 @@ public class SignedMessageChain {
throw new SignedMessageChain.DecodeException(Component.translatable("multiplayer.disconnect.unsigned_chat"), true, org.bukkit.event.player.PlayerKickEvent.Cause.UNSIGNED_CHAT); // Paper - kick event causes
} else {
if (playerChatMessage.hasExpiredServer(Instant.now())) {
- LOGGER.warn("Received expired chat: '{}'. Is the client/server system time unsynchronized?", (Object)body.content());
+ if (GaleGlobalConfiguration.get().logToConsole.chat.expiredMessageWarning) LOGGER.warn("Received expired chat: '{}'. Is the client/server system time unsynchronized?", (Object)body.content()); // Gale - do not log expired message warnings
}
return playerChatMessage;
diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
index 133c10907358ae6064d2c1a18c967a00ad358127..3541e53b60793bc53c49402f3a3eacf12cb92b23 100644
--- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
+++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
@@ -119,6 +119,7 @@ public class GaleGlobalConfiguration extends ConfigurationPart {
public Chat chat;
public class Chat extends ConfigurationPart {
public boolean emptyMessageWarning = false; // Gale - do not log empty message warnings
+ public boolean expiredMessageWarning = false; // Gale - do not log expired message warnings
}
}