9
0
mirror of https://github.com/Dreeam-qwq/Gale.git synced 2025-12-22 00:09:25 +00:00
Files
Gale/patches/server/0053-Do-not-log-Not-Secure-marker.patch
Dreeam ea59414040 Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@bf5852a Fix NPE for PlayerPostRespawnEvent#getRespawnedLocation (#11268)
PaperMC/Paper@fb53074 Apply optimise collision checking in move packet handling patch
PaperMC/Paper@81bfda8 [ci skip] Specify rebase location in CONTRIBUTING (#11255)
PaperMC/Paper@9571983 Fix scanForLegacyEnderDragon world config (#11262)
PaperMC/Paper@ec55c11 Fix indestructable light blocks (#11275)
PaperMC/Paper@1b8ab11 Add Configuration for vertical Despawn Ranges (#10440)
PaperMC/Paper@534ab86 [ci-skip] Revert "Add Configuration for vertical Despawn Ranges (#10440)" (#11278)
PaperMC/Paper@e619744 Allow skipping of world symlink validation (#11250)
PaperMC/Paper@78216fe Re-implement portalCreateRadius world config (#11267)
PaperMC/Paper@4829fbf Handle custom registry elements properly (#11230)
PaperMC/Paper@d5ffc57 Implement more methods for horse inventories (#11147)
PaperMC/Paper@52ae4ad Migrate ArmorStand meta to using entity tag (#11107)
2024-08-17 00:12:29 +00:00

64 lines
4.3 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Martijn Muijsers <martijnmuijsers@live.nl>
Date: Fri, 25 Nov 2022 15:13:38 +0100
Subject: [PATCH] Do not log Not Secure marker
License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
Gale - https://galemc.org
diff --git a/src/main/java/io/papermc/paper/adventure/ChatProcessor.java b/src/main/java/io/papermc/paper/adventure/ChatProcessor.java
index 14e412ebf75b0e06ab53a1c8f9dd1be6ad1e2680..f962e82e2c70f328a23dc99193d072f8dd7ad949 100644
--- a/src/main/java/io/papermc/paper/adventure/ChatProcessor.java
+++ b/src/main/java/io/papermc/paper/adventure/ChatProcessor.java
@@ -44,6 +44,8 @@ import org.bukkit.event.player.PlayerChatEvent;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.checkerframework.framework.qual.DefaultQualifier;
+
+import org.galemc.gale.configuration.GaleGlobalConfiguration;
import org.intellij.lang.annotations.Subst;
import static net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection;
@@ -317,7 +319,7 @@ public final class ChatProcessor {
private void sendToServer(final ChatType.Bound chatType, final @Nullable Function<Audience, net.minecraft.network.chat.Component> msgFunction) {
final PlayerChatMessage toConsoleMessage = msgFunction == null ? ChatProcessor.this.message : ChatProcessor.this.message.withUnsignedContent(msgFunction.apply(ChatProcessor.this.server.console));
- ChatProcessor.this.server.logChatMessage(toConsoleMessage.decoratedContent(), chatType, ChatProcessor.this.server.getPlayerList().verifyChatTrusted(toConsoleMessage) ? null : "Not Secure");
+ ChatProcessor.this.server.logChatMessage(toConsoleMessage.decoratedContent(), chatType, !GaleGlobalConfiguration.get().logToConsole.chat.notSecureMarker || ChatProcessor.this.server.getPlayerList().verifyChatTrusted(toConsoleMessage) ? null : "Not Secure"); // Gale - do not log Not Secure marker
}
}
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 2e636ca778e9775e6002b766ef5793550b0e9e5e..56417b6e2ddb363b8c0adce92e63f600ca837d78 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -102,6 +102,7 @@ import net.minecraft.world.phys.Vec3;
import net.minecraft.world.scores.DisplaySlot;
import net.minecraft.world.scores.Objective;
import net.minecraft.world.scores.PlayerTeam;
+import org.galemc.gale.configuration.GaleGlobalConfiguration;
import org.slf4j.Logger;
// CraftBukkit start
@@ -1390,7 +1391,7 @@ public abstract class PlayerList {
// Paper end
boolean flag = this.verifyChatTrusted(message);
- this.server.logChatMessage((unsignedFunction == null ? message.decoratedContent() : unsignedFunction.apply(this.server.console)), params, flag ? null : "Not Secure"); // Paper
+ this.server.logChatMessage((unsignedFunction == null ? message.decoratedContent() : unsignedFunction.apply(this.server.console)), params, flag || !GaleGlobalConfiguration.get().logToConsole.chat.notSecureMarker ? null : "Not Secure"); // Paper // Gale - do not log Not Secure marker
OutgoingChatMessage outgoingchatmessage = OutgoingChatMessage.create(message);
boolean flag1 = false;
diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
index 3fd497761dfb5e10ae7a3fd83bee8013c3869117..413c41e8c2fead4de859535007641094a64e97dd 100644
--- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
+++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
@@ -63,6 +63,7 @@ public class GaleGlobalConfiguration extends ConfigurationPart {
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
+ public boolean notSecureMarker = true; // Gale - do not log Not Secure marker
}
// Gale start - Purpur - do not log plugin library loads