2020-07-01 11:39:43 +02:00
|
|
|
From 05f79876d9c969dd45af3c5c3d0e0751c19b997d Mon Sep 17 00:00:00 2001
|
2016-07-01 07:28:19 +02:00
|
|
|
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
|
2020-02-01 16:39:53 +01:00
|
|
|
index edbae4ea..749059ab 100644
|
2016-07-01 07:28:19 +02:00
|
|
|
--- a/api/src/main/java/net/md_5/bungee/api/ProxyConfig.java
|
|
|
|
+++ b/api/src/main/java/net/md_5/bungee/api/ProxyConfig.java
|
2020-02-01 16:39:53 +01:00
|
|
|
@@ -214,6 +214,13 @@ public interface ProxyConfig
|
2019-03-30 19:01:17 +01:00
|
|
|
// Waterfall Options
|
|
|
|
//
|
2016-07-01 07:28:19 +02:00
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * The supported versions
|
2019-03-30 17:09:06 +01:00
|
|
|
+ *
|
|
|
|
+ * @return the supported versions
|
2016-07-01 07:28:19 +02:00
|
|
|
+ */
|
|
|
|
+ String getGameVersion();
|
|
|
|
+
|
|
|
|
// Throttling options
|
|
|
|
|
|
|
|
/**
|
2016-11-26 21:39:19 +01:00
|
|
|
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
|
2019-03-30 19:01:17 +01:00
|
|
|
index 91743f01..111404fb 100644
|
2016-11-26 21:39:19 +01:00
|
|
|
--- a/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java
|
|
|
|
+++ b/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java
|
2019-03-30 19:01:17 +01:00
|
|
|
@@ -1,12 +1,20 @@
|
2018-07-22 18:40:31 +02:00
|
|
|
package io.github.waterfallmc.waterfall.conf;
|
2016-07-01 07:28:19 +02:00
|
|
|
|
|
|
|
+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;
|
|
|
|
|
2018-07-22 18:40:31 +02:00
|
|
|
import java.io.File;
|
2016-07-01 07:28:19 +02:00
|
|
|
|
2019-03-30 19:01:17 +01:00
|
|
|
public class WaterfallConfiguration extends Configuration {
|
2016-07-01 07:28:19 +02:00
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * The supported versions displayed to the client
|
2018-07-22 18:40:31 +02:00
|
|
|
+ * <p>Default is a comma separated list of supported versions. For example 1.8.x, 1.9.x, 1.10.x</p>
|
2016-07-01 07:28:19 +02:00
|
|
|
+ */
|
|
|
|
+ private String gameVersion;
|
|
|
|
+
|
|
|
|
/*
|
|
|
|
* Throttling options
|
|
|
|
* Helps prevent players from overloading the servers behind us
|
2019-03-30 19:01:17 +01:00
|
|
|
@@ -26,11 +34,17 @@ public class WaterfallConfiguration extends Configuration {
|
|
|
|
super.load();
|
2018-07-22 18:40:31 +02:00
|
|
|
YamlConfig config = new YamlConfig(new File("waterfall.yml"));
|
|
|
|
config.load(false); // Load, but no permissions
|
|
|
|
+ gameVersion = config.getString("game_version", "").isEmpty() ? Joiner.on(", ").join(ProtocolConstants.SUPPORTED_VERSIONS) : config.getString("game_version", "");
|
2016-07-01 07:28:19 +02:00
|
|
|
// Throttling options
|
|
|
|
tabThrottle = config.getInt("throttling.tab_complete", tabThrottle);
|
2018-10-06 20:54:52 +02:00
|
|
|
disableModernTabLimiter = config.getBoolean("disable_modern_tab_limiter", disableModernTabLimiter);
|
2016-07-01 07:28:19 +02:00
|
|
|
}
|
|
|
|
|
2018-07-22 18:40:31 +02:00
|
|
|
+ @Override
|
|
|
|
+ public String getGameVersion() {
|
|
|
|
+ return gameVersion;
|
|
|
|
+ }
|
|
|
|
+
|
2016-11-26 21:39:19 +01:00
|
|
|
@Override
|
2018-07-22 18:40:31 +02:00
|
|
|
public int getTabThrottle() {
|
|
|
|
return tabThrottle;
|
2016-11-26 21:39:19 +01:00
|
|
|
diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java
|
2020-07-01 11:39:43 +02:00
|
|
|
index 1d141981..8c933123 100644
|
2016-11-26 21:39:19 +01:00
|
|
|
--- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java
|
|
|
|
+++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java
|
2020-07-01 11:39:43 +02:00
|
|
|
@@ -687,7 +687,7 @@ public class BungeeCord extends ProxyServer
|
2016-11-26 21:39:19 +01:00
|
|
|
@Override
|
|
|
|
public String getGameVersion()
|
|
|
|
{
|
2017-06-08 17:57:34 +02:00
|
|
|
- return ProtocolConstants.SUPPORTED_VERSIONS.get( 0 ) + "-" + ProtocolConstants.SUPPORTED_VERSIONS.get( ProtocolConstants.SUPPORTED_VERSIONS.size() - 1 );
|
2016-11-26 21:39:19 +01:00
|
|
|
+ return getConfig().getGameVersion(); // Waterfall
|
|
|
|
}
|
|
|
|
|
2016-07-01 07:28:19 +02:00
|
|
|
@Override
|
|
|
|
--
|
2020-07-01 11:39:43 +02:00
|
|
|
2.27.0
|
2016-07-01 07:28:19 +02:00
|
|
|
|