2018-07-15 12:58:44 +02:00
|
|
|
From 54013d2709efdb3738c486ad4cdfcb2cd69da490 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
|
2017-09-26 18:50:48 +02:00
|
|
|
index f04e2bf4..a4436141 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
|
|
|
|
@@ -168,6 +168,11 @@ public interface ProxyConfig
|
|
|
|
*/
|
|
|
|
boolean isLogServerListPing();
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * The supported versions
|
|
|
|
+ */
|
|
|
|
+ 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
|
2017-09-26 18:50:48 +02:00
|
|
|
index 68f25460..59835815 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
|
2016-10-25 18:57:11 +02:00
|
|
|
@@ -4,8 +4,11 @@ import lombok.*;
|
2016-07-01 07:28:19 +02:00
|
|
|
|
|
|
|
import java.io.File;
|
|
|
|
|
|
|
|
+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;
|
|
|
|
|
|
|
|
public class WaterfallConfiguration extends Configuration {
|
|
|
|
|
2016-10-25 18:57:11 +02:00
|
|
|
@@ -23,6 +26,13 @@ public class WaterfallConfiguration extends Configuration {
|
2016-07-01 07:28:19 +02:00
|
|
|
*/
|
|
|
|
private boolean logServerListPing = false;
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * The supported versions displayed to the client
|
|
|
|
+ * <p>Default is a comma seperated list of supported versions. For example 1.8.x, 1.9.x, 1.10.x</p>
|
|
|
|
+ */
|
|
|
|
+ @Getter
|
|
|
|
+ private String gameVersion;
|
|
|
|
+
|
|
|
|
/*
|
|
|
|
* Throttling options
|
|
|
|
* Helps prevent players from overloading the servers behind us
|
2016-10-25 18:57:11 +02:00
|
|
|
@@ -45,6 +55,7 @@ public class WaterfallConfiguration extends Configuration {
|
2016-07-01 07:28:19 +02:00
|
|
|
logServerListPing = config.getBoolean( "log_server_list_ping", logServerListPing );
|
|
|
|
// Throttling options
|
|
|
|
tabThrottle = config.getInt("throttling.tab_complete", tabThrottle);
|
|
|
|
+ gameVersion = config.getString("game_version", "").isEmpty() ? Joiner.on(", ").join(ProtocolConstants.SUPPORTED_VERSIONS) : config.getString("game_version", "");
|
|
|
|
}
|
|
|
|
|
2016-11-26 21:39:19 +01:00
|
|
|
@Override
|
|
|
|
diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java
|
2018-07-15 12:58:44 +02:00
|
|
|
index d347d42d..09d53fea 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
|
2018-07-15 12:58:44 +02:00
|
|
|
@@ -650,7 +650,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
|
|
|
|
--
|
2018-07-15 12:58:44 +02:00
|
|
|
2.15.1.windows.2
|
2016-07-01 07:28:19 +02:00
|
|
|
|