From 06ee6ab5d43bd20b409a15d3933dc63f9029f31c Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Fri, 16 Jun 2023 19:27:45 -0700 Subject: [PATCH] Remove stacktrace on exception from reading server.properties (#9296) --- .../server/Improve-logging-and-errors.patch | 30 +++++++++++++++++++ ...e-invalid-signature-login-stacktrace.patch | 19 ------------ 2 files changed, 30 insertions(+), 19 deletions(-) delete mode 100644 patches/server/Remove-invalid-signature-login-stacktrace.patch diff --git a/patches/server/Improve-logging-and-errors.patch b/patches/server/Improve-logging-and-errors.patch index 3f76583375..614136e8db 100644 --- a/patches/server/Improve-logging-and-errors.patch +++ b/patches/server/Improve-logging-and-errors.patch @@ -4,6 +4,36 @@ Date: Wed, 14 Dec 2022 15:52:11 -0800 Subject: [PATCH] Improve logging and errors +diff --git a/src/main/java/net/minecraft/server/dedicated/Settings.java b/src/main/java/net/minecraft/server/dedicated/Settings.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/server/dedicated/Settings.java ++++ b/src/main/java/net/minecraft/server/dedicated/Settings.java +@@ -0,0 +0,0 @@ public abstract class Settings> { + } + + public static Properties loadFromFile(Path path) { ++ // Paper start ++ if (Files.notExists(path)) { ++ LOGGER.info("Could not find existing {}. Creating with default values...", path.getFileName()); ++ return new Properties(); ++ } ++ // Paper end + try { + Properties properties; + Properties properties1; +diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java ++++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic + + this.resetPlayerChatState(remotechatsession_a.validate(this.player.getGameProfile(), signaturevalidator, Duration.ZERO)); + } catch (ProfilePublicKey.ValidationException profilepublickey_b) { +- ServerGamePacketListenerImpl.LOGGER.error("Failed to validate profile key: {}", profilepublickey_b.getMessage()); ++ // ServerGamePacketListenerImpl.LOGGER.error("Failed to validate profile key: {}", profilepublickey_b.getMessage()); // Paper - unnecessary log + this.disconnect(profilepublickey_b.getComponent(), profilepublickey_b.kickCause); // Paper - kick event causes + } + diff --git a/src/main/java/net/minecraft/server/packs/PathPackResources.java b/src/main/java/net/minecraft/server/packs/PathPackResources.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/packs/PathPackResources.java diff --git a/patches/server/Remove-invalid-signature-login-stacktrace.patch b/patches/server/Remove-invalid-signature-login-stacktrace.patch deleted file mode 100644 index 9d5aaaf105..0000000000 --- a/patches/server/Remove-invalid-signature-login-stacktrace.patch +++ /dev/null @@ -1,19 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Nassim Jahnke -Date: Fri, 10 Jun 2022 16:02:35 +0200 -Subject: [PATCH] Remove invalid signature login stacktrace - - -diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic - - this.resetPlayerChatState(remotechatsession_a.validate(this.player.getGameProfile(), signaturevalidator, Duration.ZERO)); - } catch (ProfilePublicKey.ValidationException profilepublickey_b) { -- ServerGamePacketListenerImpl.LOGGER.error("Failed to validate profile key: {}", profilepublickey_b.getMessage()); -+ // ServerGamePacketListenerImpl.LOGGER.error("Failed to validate profile key: {}", profilepublickey_b.getMessage()); // Paper - unnecessary log - this.disconnect(profilepublickey_b.getComponent(), profilepublickey_b.kickCause); // Paper - kick event causes - } -