mirror of
https://github.com/PaperMC/Waterfall.git
synced 2024-06-29 07:54:48 +02:00
c21eed1f7b
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: 70370faf Add checkstyle indentation checks 24a53a67 Show socketAddress in BungeeServerInfo.toString 503b4827 Fix bad formatting in EntityMap eeb37479 #2710: Store queue of pending keepalives 3f6aa033 Also check that things that should not be padded are so 78a84953 Add more checkstyle rules 636c0207 #2753: Add configurable remote ping caching a4512e50 Check Maven version in action build & don't print noisy transfer progress f510989c Add building of pull requests via GitHub Actions
123 lines
4.3 KiB
Diff
123 lines
4.3 KiB
Diff
From 4e5947be07add5513e17ef88a8cc8cfea5f16ecc Mon Sep 17 00:00:00 2001
|
|
From: Techcable <Techcable@techcable.net>
|
|
Date: Tue, 25 Oct 2016 11:58:37 -0400
|
|
Subject: [PATCH] Add Waterfall configuration files
|
|
|
|
|
|
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 7a8dbda4..c2dc9bd1 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
|
|
@@ -109,4 +109,9 @@ public interface ProxyConfig
|
|
* @return favicon
|
|
*/
|
|
Favicon getFaviconObject();
|
|
+
|
|
+ //
|
|
+ // Waterfall 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
|
|
new file mode 100644
|
|
index 00000000..741ebfde
|
|
--- /dev/null
|
|
+++ b/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java
|
|
@@ -0,0 +1,17 @@
|
|
+package io.github.waterfallmc.waterfall.conf;
|
|
+
|
|
+import net.md_5.bungee.conf.Configuration;
|
|
+import net.md_5.bungee.conf.YamlConfig;
|
|
+
|
|
+import java.io.File;
|
|
+
|
|
+public class WaterfallConfiguration extends Configuration {
|
|
+
|
|
+ @Override
|
|
+ public void load() {
|
|
+ super.load();
|
|
+ YamlConfig config = new YamlConfig(new File("waterfall.yml"));
|
|
+ config.load(false); // Load, but no permissions
|
|
+ }
|
|
+
|
|
+}
|
|
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 bea66b10..d11c66bb 100644
|
|
--- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java
|
|
+++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java
|
|
@@ -10,6 +10,7 @@ import com.google.common.util.concurrent.ThreadFactoryBuilder;
|
|
import com.google.gson.Gson;
|
|
import com.google.gson.GsonBuilder;
|
|
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
|
|
+import io.github.waterfallmc.waterfall.conf.WaterfallConfiguration;
|
|
import io.netty.bootstrap.ServerBootstrap;
|
|
import io.netty.channel.Channel;
|
|
import io.netty.channel.ChannelException;
|
|
@@ -110,7 +111,7 @@ public class BungeeCord extends ProxyServer
|
|
* Configuration.
|
|
*/
|
|
@Getter
|
|
- public final Configuration config = new Configuration();
|
|
+ public final Configuration config = new WaterfallConfiguration();
|
|
/**
|
|
* Localization bundle.
|
|
*/
|
|
diff --git a/proxy/src/main/java/net/md_5/bungee/conf/Configuration.java b/proxy/src/main/java/net/md_5/bungee/conf/Configuration.java
|
|
index 82ba6afb..03d51d88 100644
|
|
--- a/proxy/src/main/java/net/md_5/bungee/conf/Configuration.java
|
|
+++ b/proxy/src/main/java/net/md_5/bungee/conf/Configuration.java
|
|
@@ -24,7 +24,7 @@ import net.md_5.bungee.util.CaseInsensitiveSet;
|
|
* Core configuration for the proxy.
|
|
*/
|
|
@Getter
|
|
-public class Configuration implements ProxyConfig
|
|
+public abstract class Configuration implements ProxyConfig
|
|
{
|
|
|
|
/**
|
|
diff --git a/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java b/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java
|
|
index 4c9a0054..85c2a0b5 100644
|
|
--- a/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java
|
|
+++ b/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java
|
|
@@ -44,10 +44,15 @@ public class YamlConfig implements ConfigurationAdapter
|
|
}
|
|
private final Yaml yaml;
|
|
private Map<String, Object> config;
|
|
- private final File file = new File( "config.yml" );
|
|
+ private final File file;
|
|
|
|
- public YamlConfig()
|
|
+ public YamlConfig() {
|
|
+ this(new File("config.yml"));
|
|
+ }
|
|
+
|
|
+ public YamlConfig(File file)
|
|
{
|
|
+ this.file = file;
|
|
DumperOptions options = new DumperOptions();
|
|
options.setDefaultFlowStyle( DumperOptions.FlowStyle.BLOCK );
|
|
yaml = new Yaml( options );
|
|
@@ -55,6 +60,11 @@ public class YamlConfig implements ConfigurationAdapter
|
|
|
|
@Override
|
|
public void load()
|
|
+ {
|
|
+ load(true);
|
|
+ }
|
|
+
|
|
+ public void load(boolean doPermissions)
|
|
{
|
|
try
|
|
{
|
|
@@ -83,6 +93,7 @@ public class YamlConfig implements ConfigurationAdapter
|
|
throw new RuntimeException( "Could not load configuration!", ex );
|
|
}
|
|
|
|
+ if(!doPermissions) return; // Waterfall
|
|
Map<String, Object> permissions = get( "permissions", null );
|
|
if ( permissions == null )
|
|
{
|
|
--
|
|
2.25.0
|
|
|