mirror of
https://github.com/PaperMC/Waterfall.git
synced 2025-01-03 22:47:38 +01:00
337ca7f887
Upstream has released updates that appears to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing BungeeCord Changes: 70038c91 Revert "#2714: Remove unnecessary throws in ServerConnector" 39ef20b2 #2716: Don't attempt to send kick packet during handshake phase 74a6aa32 #2714: Remove unnecessary throws in ServerConnector c7984070 Misc dependency update
79 lines
3.4 KiB
Diff
79 lines
3.4 KiB
Diff
From 1155588afc687d686d734ad71cdb779daa1fe669 Mon Sep 17 00:00:00 2001
|
|
From: Gabriele C <sgdc3.mail@gmail.com>
|
|
Date: Thu, 8 Feb 2018 19:10:52 +0100
|
|
Subject: [PATCH] Optionally log InitialHandler connections
|
|
|
|
|
|
diff --git a/api/src/main/java/net/md_5/bungee/api/ProxyConfig.java b/api/src/main/java/net/md_5/bungee/api/ProxyConfig.java
|
|
index af93ae8c..058cca67 100644
|
|
--- a/api/src/main/java/net/md_5/bungee/api/ProxyConfig.java
|
|
+++ b/api/src/main/java/net/md_5/bungee/api/ProxyConfig.java
|
|
@@ -169,6 +169,13 @@ public interface ProxyConfig
|
|
// Waterfall Options
|
|
//
|
|
|
|
+ /**
|
|
+ * Whether we log InitialHandler connections
|
|
+ *
|
|
+ * @return whether we log InitialHandler connections
|
|
+ */
|
|
+ boolean isLogInitialHandlerConnections();
|
|
+
|
|
/**
|
|
* The supported versions
|
|
*
|
|
diff --git a/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java b/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java
|
|
index ef44d334..4ff8da6d 100644
|
|
--- a/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java
|
|
+++ b/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java
|
|
@@ -9,6 +9,13 @@ import java.io.File;
|
|
|
|
public class WaterfallConfiguration extends Configuration {
|
|
|
|
+ /**
|
|
+ * Whether we log InitialHandler connections
|
|
+ * <p>
|
|
+ * Default is true
|
|
+ */
|
|
+ private boolean logInitialHandlerConnections = true;
|
|
+
|
|
/**
|
|
* The supported versions displayed to the client
|
|
* <p>Default is a comma separated list of supported versions. For example 1.8.x, 1.9.x, 1.10.x</p>
|
|
@@ -40,6 +47,7 @@ public class WaterfallConfiguration extends Configuration {
|
|
super.load();
|
|
YamlConfig config = new YamlConfig(new File("waterfall.yml"));
|
|
config.load(false); // Load, but no permissions
|
|
+ logInitialHandlerConnections = config.getBoolean( "log_initial_handler_connections", logInitialHandlerConnections );
|
|
gameVersion = config.getString("game_version", "").isEmpty() ? Joiner.on(", ").join(ProtocolConstants.SUPPORTED_VERSIONS) : config.getString("game_version", "");
|
|
useNettyDnsResolver = config.getBoolean("use_netty_dns_resolver", useNettyDnsResolver);
|
|
// Throttling options
|
|
@@ -47,6 +55,11 @@ public class WaterfallConfiguration extends Configuration {
|
|
disableModernTabLimiter = config.getBoolean("disable_modern_tab_limiter", disableModernTabLimiter);
|
|
}
|
|
|
|
+ @Override
|
|
+ public boolean isLogInitialHandlerConnections() {
|
|
+ return logInitialHandlerConnections;
|
|
+ }
|
|
+
|
|
@Override
|
|
public String getGameVersion() {
|
|
return gameVersion;
|
|
diff --git a/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java b/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java
|
|
index e3f8bcf6..34f7f997 100644
|
|
--- a/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java
|
|
+++ b/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java
|
|
@@ -314,7 +314,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection
|
|
break;
|
|
case 2:
|
|
// Login
|
|
- if ( !bungee.getConfig().isLogPings() )
|
|
+ if (BungeeCord.getInstance().getConfig().isLogInitialHandlerConnections() ) // Waterfall
|
|
{
|
|
bungee.getLogger().log( Level.INFO, "{0} has connected", this );
|
|
}
|
|
--
|
|
2.24.0
|
|
|