Merge pull request #174 from Achsion/feature/detailed-connection-exception

Only show detailed connect exception to admins
This commit is contained in:
Juan Cruz Linsalata 2022-12-19 23:49:44 +01:00 committed by GitHub
commit 872275f9d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,23 +1,26 @@
From 5e0a6aa349884b190a106b2c7609d6482ee5360f Mon Sep 17 00:00:00 2001
From 48878ec51074a1a90d1c4aa761a40fbec74bd8ac Mon Sep 17 00:00:00 2001
From: LinsaFTW <25271111+linsaftw@users.noreply.github.com>
Date: Tue, 15 Nov 2022 18:07:27 +0100
Subject: [PATCH] Show connection fail reason
Subject: [PATCH] Only show connection fail reason when detailed logger is
enabled
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 f3d60253..999f02e5 100644
index f3d60253..021fe839 100644
--- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java
+++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java
@@ -406,7 +406,8 @@ public final class UserConnection implements ProxiedPlayer
@@ -405,8 +405,10 @@ public final class UserConnection implements ProxiedPlayer
// 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
+ // FlameCord - Show connection fail reason
+ return groups.contains( "admin" ) ? cause.getMessage() : cause.getClass().getName();
}
- return ""; // Waterfall
+ // FlameCord - Show connection fail reason
+ return cause.getMessage();
+ return cause.getClass().getName(); // FlameCord
}
@Override
--
2.37.3.windows.1
2.29.2.windows.2