Waterfall/BungeeCord-Patches/0029-Configurable-server-version-in-ping-response.patch
Shane Freeder f48db6b757
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)
2018-10-06 19:59:28 +01:00

86 lines
3.4 KiB
Diff

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 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
*/
boolean isLogServerListPing();
+ /**
+ * The supported versions
+ */
+ String getGameVersion();
+
// Throttling options
/**
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 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 @@
package io.github.waterfallmc.waterfall.conf;
+import com.google.common.base.Joiner;
import net.md_5.bungee.conf.Configuration;
import net.md_5.bungee.conf.YamlConfig;
+import net.md_5.bungee.protocol.ProtocolConstants;
import java.io.File;
@@ -14,6 +16,12 @@ public class WaterfallConfiguration extends Configuration {
*/
private boolean logServerListPing = false;
+ /**
+ * 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>
+ */
+ private String gameVersion;
+
/*
* Throttling options
* Helps prevent players from overloading the servers behind us
@@ -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);
disableModernTabLimiter = config.getBoolean("disable_modern_tab_limiter", disableModernTabLimiter);
@@ -44,6 +53,11 @@ public class WaterfallConfiguration extends Configuration {
return logServerListPing;
}
+ @Override
+ public String getGameVersion() {
+ return gameVersion;
+ }
+
@Override
public int getTabThrottle() {
return tabThrottle;
diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java
index 07eeea16..595b7375 100644
--- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java
+++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java
@@ -646,7 +646,7 @@ public class BungeeCord extends ProxyServer
@Override
public String getGameVersion()
{
- return ProtocolConstants.SUPPORTED_VERSIONS.get( 0 ) + "-" + ProtocolConstants.SUPPORTED_VERSIONS.get( ProtocolConstants.SUPPORTED_VERSIONS.size() - 1 );
+ return getConfig().getGameVersion(); // Waterfall
}
@Override
--
2.19.0