From 8bd7462b9d4245efd29bd67bdc82780bdbf2aaa7 Mon Sep 17 00:00:00 2001 From: xIsm4 Date: Tue, 26 Apr 2022 15:42:59 +0200 Subject: [PATCH] Make connection error toggleable. --- ...033-Make-connection-error-toggleable.patch | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 Waterfall-Proxy-Patches/0033-Make-connection-error-toggleable.patch diff --git a/Waterfall-Proxy-Patches/0033-Make-connection-error-toggleable.patch b/Waterfall-Proxy-Patches/0033-Make-connection-error-toggleable.patch new file mode 100644 index 0000000..156c5e0 --- /dev/null +++ b/Waterfall-Proxy-Patches/0033-Make-connection-error-toggleable.patch @@ -0,0 +1,56 @@ +From 887dde9d8163212432a974a65b8c433eb4f3dca5 Mon Sep 17 00:00:00 2001 +From: xIsm4 +Date: Tue, 26 Apr 2022 15:41:57 +0200 +Subject: [PATCH] Make connection error toggleable + + +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +index d2fa6216..625df19c 100644 +--- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +@@ -201,6 +201,8 @@ public class FlameCordConfiguration extends FlameConfig { + private boolean loggerDump = false; + @Getter + private boolean loggerHaProxy = false; ++ @Getter ++ private boolean loggerDetailedConnection = false; + + public FlameCordConfiguration(final ConfigurationProvider configurationProvider) { + try { +@@ -236,7 +238,8 @@ public class FlameCordConfiguration extends FlameConfig { + this.loggerInitialhandler = setIfUnexistant("logger.initialhandler", this.loggerInitialhandler, configuration); + this.loggerExceptions = setIfUnexistant("logger.exceptions", this.loggerExceptions, configuration); + this.loggerDump = setIfUnexistant("logger.dump", this.loggerDump, configuration); +- this.loggerHaProxy = setIfUnexistant("logger.haproxy", this.loggerHaProxy, configuration); ++ this.loggerHaProxy = setIfUnexistant("logger.haproxy", this.loggerHaProxy, configuration); ++ this.loggerDetailedConnection = setIfUnexistant("logger.detailed-connect-errors", this.loggerDetailedConnection, configuration); + + configurationProvider.save(configuration, configurationFile); + } catch (final IOException e) { +diff --git a/proxy/src/main/java/net/md_5/bungee/UserConnection.java b/proxy/src/main/java/net/md_5/bungee/UserConnection.java +index c3e9d24b..6131d7ea 100644 +--- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java ++++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java +@@ -4,6 +4,7 @@ import com.google.common.base.Preconditions; + import com.google.common.collect.HashMultimap; + import com.google.common.collect.ImmutableMap; + import com.google.common.collect.Multimap; ++import dev._2lstudios.flamecord.FlameCord; + import io.netty.bootstrap.Bootstrap; + import io.netty.channel.Channel; + import io.netty.channel.ChannelFuture; +@@ -399,7 +400,10 @@ public final class UserConnection implements ProxiedPlayer + + private String connectionFailMessage(Throwable cause) + { +- bungee.getLogger().log(Level.WARNING, "Error occurred processing connection for " + this.name + " " + Util.exception( cause, false )); // Waterfall ++ //FlameCord - Allow for toggle the logging of connection failures ++ if(FlameCord.getInstance().getFlameCordConfiguration().isLoggerDetailedConnection()) { ++ bungee.getLogger().log(Level.WARNING, "Error occurred processing connection for " + this.name + " " + Util.exception(cause, false)); // Waterfall ++ } + return ""; // Waterfall + } + +-- +2.34.1.windows.1 +