Disable tab spam limiter for 1.13+ by default

The changes in 1.13 makes this limiter too easy to hit, breaking tab
completion silently for users and causing a lot of confusion around
tab completions not working, for this reason, it's cleaner to disable
this for 1.13+ clients by default and defer this to the server, where
better control is already provided for paper servers (and any other
server will either not have broken tab completions, or can re-enable
this limit if they wish to do so)
This commit is contained in:
Shane Freeder 2018-10-06 19:54:52 +01:00
parent f7f3cfeb27
commit f48db6b757
No known key found for this signature in database
GPG Key ID: A3F61EA5A085289C
5 changed files with 51 additions and 35 deletions

View File

@ -1,14 +1,14 @@
From 87e8a20022494a50d02a3306da2f2f5882984b68 Mon Sep 17 00:00:00 2001
From 5c4455d7f45ae071ab626b3c40dfe4bf1c28a993 Mon Sep 17 00:00:00 2001
From: Johannes Donath <johannesd@torchmind.com>
Date: Sat, 4 Jul 2015 06:31:33 +0200
Subject: [PATCH] Add basic support for configurable tab-complete throttling
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 b30541be..3750dc59 100644
index b30541be..08d2a870 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
@@ -84,4 +84,12 @@ public interface ProxyConfig
@@ -84,4 +84,17 @@ public interface ProxyConfig
// Waterfall Options
//
@ -20,12 +20,17 @@ index b30541be..3750dc59 100644
+ * Values in milliseconds.
+ */
+ int getTabThrottle();
+
+ /**
+ * @return should we disable the tab completion limit for 1.13+ clients
+ */
+ boolean isDisableModernTabLimiter();
}
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 741ebfde..0abb4075 100644
index 741ebfde..91743f01 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
@@ -7,11 +7,31 @@ import java.io.File;
@@ -7,11 +7,37 @@ import java.io.File;
public class WaterfallConfiguration extends Configuration {
@ -41,6 +46,7 @@ index 741ebfde..0abb4075 100644
+ * Default is one packet per second.
+ */
+ private int tabThrottle = 1000;
+ private boolean disableModernTabLimiter = true;
+
@Override
public void load() {
@ -49,16 +55,21 @@ index 741ebfde..0abb4075 100644
config.load(false); // Load, but no permissions
+ // Throttling options
+ tabThrottle = config.getInt("throttling.tab_complete", tabThrottle);
+ }
+
+ disableModernTabLimiter = config.getBoolean("disable_modern_tab_limiter", disableModernTabLimiter);
}
+ @Override
+ public int getTabThrottle() {
+ return tabThrottle;
}
+ }
+
+ @Override
+ public boolean isDisableModernTabLimiter() {
+ return disableModernTabLimiter;
+ }
}
diff --git a/proxy/src/main/java/net/md_5/bungee/connection/UpstreamBridge.java b/proxy/src/main/java/net/md_5/bungee/connection/UpstreamBridge.java
index 9666e7a2..f08f464a 100644
index 9666e7a2..8c4f999c 100644
--- a/proxy/src/main/java/net/md_5/bungee/connection/UpstreamBridge.java
+++ b/proxy/src/main/java/net/md_5/bungee/connection/UpstreamBridge.java
@@ -33,6 +33,8 @@ public class UpstreamBridge extends PacketHandler
@ -70,11 +81,14 @@ index 9666e7a2..f08f464a 100644
public UpstreamBridge(ProxyServer bungee, UserConnection con)
{
this.bungee = bungee;
@@ -149,6 +151,16 @@ public class UpstreamBridge extends PacketHandler
@@ -149,6 +151,20 @@ public class UpstreamBridge extends PacketHandler
@Override
public void handle(TabCompleteRequest tabComplete) throws Exception
{
+ if ( bungee.getConfig().getTabThrottle() > 0 )
+ // Waterfall start - tab limiter
+ if ( bungee.getConfig().getTabThrottle() > 0 &&
+ ( con.getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_13
+ && !bungee.getConfig().isDisableModernTabLimiter()))
+ {
+ long now = System.currentTimeMillis();
+ if ( lastTabCompletion > 0 && (now - lastTabCompletion) <= bungee.getConfig().getTabThrottle() )
@ -84,6 +98,7 @@ index 9666e7a2..f08f464a 100644
+ lastTabCompletion = now;
+ }
+
+ // Waterfall end - tab limiter
List<String> suggestions = new ArrayList<>();
if ( tabComplete.getCursor().startsWith( "/" ) )

View File

@ -1,4 +1,4 @@
From acc40b9ef7853831675e73f4aee176ea7e856bda Mon Sep 17 00:00:00 2001
From f54312b02382629575ad5dbc2fb00fe4f89b4604 Mon Sep 17 00:00:00 2001
From: Janmm14 <computerjanimaus@yahoo.de>
Date: Sat, 12 Dec 2015 23:43:30 +0100
Subject: [PATCH] Optional server list ping logging.
@ -9,7 +9,7 @@ This avoids spamming the logs with connection notices.
Server list pings are only logged if the log_server_list_pings config.yml option is true, defaults to false
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 3750dc59..7fd5c8e5 100644
index 08d2a870..72f35bd6 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
@@ -84,6 +84,11 @@ public interface ProxyConfig
@ -25,7 +25,7 @@ index 3750dc59..7fd5c8e5 100644
/**
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 0abb4075..93f47511 100644
index 91743f01..a5db82b8 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
@@ -7,6 +7,13 @@ import java.io.File;
@ -42,13 +42,14 @@ index 0abb4075..93f47511 100644
/*
* Throttling options
* Helps prevent players from overloading the servers behind us
@@ -25,10 +32,16 @@ public class WaterfallConfiguration extends Configuration {
@@ -26,11 +33,17 @@ public class WaterfallConfiguration extends Configuration {
super.load();
YamlConfig config = new YamlConfig(new File("waterfall.yml"));
config.load(false); // Load, but no permissions
+ logServerListPing = config.getBoolean( "log_server_list_ping", logServerListPing );
// Throttling options
tabThrottle = config.getInt("throttling.tab_complete", tabThrottle);
disableModernTabLimiter = config.getBoolean("disable_modern_tab_limiter", disableModernTabLimiter);
}
+ @Override
@ -117,10 +118,10 @@ index 0e8041f8..cd240460 100644
@Override
diff --git a/proxy/src/main/java/net/md_5/bungee/connection/UpstreamBridge.java b/proxy/src/main/java/net/md_5/bungee/connection/UpstreamBridge.java
index f08f464a..20b3975a 100644
index 8c4f999c..78b39fef 100644
--- a/proxy/src/main/java/net/md_5/bungee/connection/UpstreamBridge.java
+++ b/proxy/src/main/java/net/md_5/bungee/connection/UpstreamBridge.java
@@ -246,6 +246,6 @@ public class UpstreamBridge extends PacketHandler
@@ -250,6 +250,6 @@ public class UpstreamBridge extends PacketHandler
@Override
public String toString()
{

View File

@ -1,11 +1,11 @@
From d6793fa77ac0f2c27a92d2445f9066c1d340be94 Mon Sep 17 00:00:00 2001
From 97f51be47197095ec5d0b23d01ab5912597a0ed7 Mon Sep 17 00:00:00 2001
From: Troy Frew <fuzzy_bot@arenaga.me>
Date: Wed, 29 Jun 2016 13:56:57 -0500
Subject: [PATCH] Configurable server version in ping response
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 dcd46f4a..d3411929 100644
index 78519227..34d7e2cb 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
@@ -163,6 +163,11 @@ public interface ProxyConfig
@ -21,7 +21,7 @@ index dcd46f4a..d3411929 100644
/**
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 93f47511..15274156 100644
index a5db82b8..e55c28d8 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
@@ -1,7 +1,9 @@
@ -47,15 +47,15 @@ index 93f47511..15274156 100644
/*
* Throttling options
* Helps prevent players from overloading the servers behind us
@@ -33,6 +41,7 @@ public class WaterfallConfiguration extends Configuration {
@@ -34,6 +42,7 @@ public class WaterfallConfiguration extends Configuration {
YamlConfig config = new YamlConfig(new File("waterfall.yml"));
config.load(false); // Load, but no permissions
logServerListPing = config.getBoolean( "log_server_list_ping", logServerListPing );
+ gameVersion = config.getString("game_version", "").isEmpty() ? Joiner.on(", ").join(ProtocolConstants.SUPPORTED_VERSIONS) : config.getString("game_version", "");
// Throttling options
tabThrottle = config.getInt("throttling.tab_complete", tabThrottle);
}
@@ -42,6 +51,11 @@ public class WaterfallConfiguration extends Configuration {
disableModernTabLimiter = config.getBoolean("disable_modern_tab_limiter", disableModernTabLimiter);
@@ -44,6 +53,11 @@ public class WaterfallConfiguration extends Configuration {
return logServerListPing;
}

View File

@ -1,4 +1,4 @@
From 2772e4b241a3cec4e8df622f1f56bcd2c9a0fc93 Mon Sep 17 00:00:00 2001
From 97b134ad0ba83da9fc5539f873b5dbbeaa013400 Mon Sep 17 00:00:00 2001
From: Tux <write@imaginarycode.com>
Date: Wed, 21 Dec 2016 03:13:03 -0500
Subject: [PATCH] Optionally use async Netty DNS resolver
@ -6,7 +6,7 @@ Subject: [PATCH] Optionally use async Netty DNS resolver
We no longer need to cache the address for the session server now.
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 d3411929..6187d6f0 100644
index 34d7e2cb..47d4ab36 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
@@ -168,6 +168,11 @@ public interface ProxyConfig
@ -41,7 +41,7 @@ index 841f014e..2efeaa9e 100644
<groupId>io.netty</groupId>
<artifactId>netty-handler</artifactId>
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 15274156..5c92768a 100644
index e55c28d8..b7e3dad0 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
@@ -22,6 +22,12 @@ public class WaterfallConfiguration extends Configuration {
@ -57,15 +57,15 @@ index 15274156..5c92768a 100644
/*
* Throttling options
* Helps prevent players from overloading the servers behind us
@@ -42,6 +48,7 @@ public class WaterfallConfiguration extends Configuration {
@@ -43,6 +49,7 @@ public class WaterfallConfiguration extends Configuration {
config.load(false); // Load, but no permissions
logServerListPing = config.getBoolean( "log_server_list_ping", logServerListPing );
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
tabThrottle = config.getInt("throttling.tab_complete", tabThrottle);
}
@@ -56,6 +63,11 @@ public class WaterfallConfiguration extends Configuration {
disableModernTabLimiter = config.getBoolean("disable_modern_tab_limiter", disableModernTabLimiter);
@@ -58,6 +65,11 @@ public class WaterfallConfiguration extends Configuration {
return gameVersion;
}

View File

@ -1,11 +1,11 @@
From 72328c146c1a82d7f97e24ae6e769945e0f06d16 Mon Sep 17 00:00:00 2001
From 1447245c1b0233eefc07d701007d55a4fc5d24ea 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 6187d6f0..8a9c3c17 100644
index 47d4ab36..8680fd9b 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
@@ -163,6 +163,11 @@ public interface ProxyConfig
@ -21,7 +21,7 @@ index 6187d6f0..8a9c3c17 100644
* 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 5c92768a..090c550b 100644
index b7e3dad0..d343e9b8 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
@@ -16,6 +16,13 @@ public class WaterfallConfiguration extends Configuration {
@ -38,7 +38,7 @@ index 5c92768a..090c550b 100644
/**
* 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>
@@ -47,6 +54,7 @@ public class WaterfallConfiguration extends Configuration {
@@ -48,6 +55,7 @@ public class WaterfallConfiguration extends Configuration {
YamlConfig config = new YamlConfig(new File("waterfall.yml"));
config.load(false); // Load, but no permissions
logServerListPing = config.getBoolean( "log_server_list_ping", logServerListPing );
@ -46,7 +46,7 @@ index 5c92768a..090c550b 100644
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
@@ -58,6 +66,11 @@ public class WaterfallConfiguration extends Configuration {
@@ -60,6 +68,11 @@ public class WaterfallConfiguration extends Configuration {
return logServerListPing;
}