mirror of
https://github.com/PaperMC/Waterfall.git
synced 2024-10-08 11:28:04 +02:00
3a793b886c
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: d8c222ae Update date d20e622b Apply checkstyle to javadoc 6c8a0cce Remove m2e settings, causes useless warnings 2f547f73 Fix some javadoc warnings 5f29e939 #2720: Send different log message for pings (vs login) 46521568 #2740: Fix BaseComponent#equals() stack overflow d2ceccd6 #2725: Various improvements to chat API 7ed4c41d #2723: Improved Send Command
84 lines
3.2 KiB
Diff
84 lines
3.2 KiB
Diff
From 6952c252c0b236b01aacc624bd2845ff554780e9 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 69cbbf9b..9218f31f 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
|
|
@@ -190,6 +190,13 @@ public interface ProxyConfig
|
|
// Waterfall Options
|
|
//
|
|
|
|
+ /**
|
|
+ * The supported versions
|
|
+ *
|
|
+ * @return 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 91743f01..111404fb 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,12 +1,20 @@
|
|
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;
|
|
|
|
public class WaterfallConfiguration extends Configuration {
|
|
|
|
+ /**
|
|
+ * 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
|
|
@@ -26,11 +34,17 @@ public class WaterfallConfiguration extends Configuration {
|
|
super.load();
|
|
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", "");
|
|
// Throttling options
|
|
tabThrottle = config.getInt("throttling.tab_complete", tabThrottle);
|
|
disableModernTabLimiter = config.getBoolean("disable_modern_tab_limiter", disableModernTabLimiter);
|
|
}
|
|
|
|
+ @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 69d60a5f..46720458 100644
|
|
--- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java
|
|
+++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java
|
|
@@ -650,7 +650,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.24.1
|
|
|