Paper/Spigot-Server-Patches/0089-Configurable-RCON-IP-address.patch

60 lines
3.3 KiB
Diff
Raw Normal View History

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2019-04-27 05:05:36 +02:00
From: Aikar <aikar@aikar.co>
Date: Sat, 16 Apr 2016 00:39:33 -0400
Subject: [PATCH] Configurable RCON IP address
For servers with multiple IP's, ability to bind to a specific interface.
diff --git a/src/main/java/net/minecraft/server/DedicatedServerProperties.java b/src/main/java/net/minecraft/server/DedicatedServerProperties.java
index bec3a69b0f68a29ecff71f10c7b195adc91d16b3..3ecfb193be1d83d2b2c90ca9e264388dabb88c05 100644
2019-04-27 05:05:36 +02:00
--- a/src/main/java/net/minecraft/server/DedicatedServerProperties.java
+++ b/src/main/java/net/minecraft/server/DedicatedServerProperties.java
@@ -57,6 +57,8 @@ public class DedicatedServerProperties extends PropertyManager<DedicatedServerPr
2019-04-27 05:05:36 +02:00
public final PropertyManager<DedicatedServerProperties>.EditableProperty<Boolean> whiteList;
2020-06-25 13:00:35 +02:00
public final GeneratorSettings generatorSettings;
2019-04-27 05:05:36 +02:00
+ public final String rconIp; // Paper - Add rcon ip
+
// CraftBukkit start
public DedicatedServerProperties(Properties properties, IRegistryCustom iregistrycustom, OptionSet optionset) {
2019-04-27 05:05:36 +02:00
super(properties, optionset);
@@ -108,6 +110,10 @@ public class DedicatedServerProperties extends PropertyManager<DedicatedServerPr
this.textFilteringConfig = this.getString("text-filtering-config", "");
2019-04-27 05:05:36 +02:00
this.playerIdleTimeout = this.b("player-idle-timeout", 0);
this.whiteList = this.b("white-list", false);
+ // Paper start - Configurable rcon ip
+ final String rconIp = this.getSettingIfExists("rcon.ip");
+ this.rconIp = rconIp == null ? this.serverIp : rconIp;
+ // Paper end
this.generatorSettings = GeneratorSettings.a(iregistrycustom, properties);
2019-04-27 05:05:36 +02:00
}
diff --git a/src/main/java/net/minecraft/server/PropertyManager.java b/src/main/java/net/minecraft/server/PropertyManager.java
index 3aa05fd2b38562039960b58cab0ea40743ef06bb..2170d539a72a3e254a688e6148b282975e84e491 100644
2019-04-27 05:05:36 +02:00
--- a/src/main/java/net/minecraft/server/PropertyManager.java
+++ b/src/main/java/net/minecraft/server/PropertyManager.java
@@ -127,8 +127,8 @@ public abstract class PropertyManager<T extends PropertyManager<T>> {
};
}
- @Nullable
- private String c(String s) {
+ @Nullable String getSettingIfExists(final String path) { return this.c(path); } // Paper - OBFHELPER
+ @Nullable private String c(String s) { // Paper - OBFHELPER
return (String) getOverride(s, this.properties.getProperty(s)); // CraftBukkit
}
diff --git a/src/main/java/net/minecraft/server/RemoteControlListener.java b/src/main/java/net/minecraft/server/RemoteControlListener.java
index 44afacf7ebbdf09a25189cc636e9c8149e03c9f2..8006659f167879863b5e89e527813e6f664e90d6 100644
2019-04-27 05:05:36 +02:00
--- a/src/main/java/net/minecraft/server/RemoteControlListener.java
+++ b/src/main/java/net/minecraft/server/RemoteControlListener.java
@@ -60,7 +60,7 @@ public class RemoteControlListener extends RemoteConnectionThread {
@Nullable
public static RemoteControlListener a(IMinecraftServer iminecraftserver) {
DedicatedServerProperties dedicatedserverproperties = iminecraftserver.getDedicatedServerProperties();
- String s = iminecraftserver.h_();
+ String s = dedicatedserverproperties.rconIp; // Paper - Configurable rcon ip
2019-04-27 05:05:36 +02:00
if (s.isEmpty()) {
s = "0.0.0.0";