Paper/patches/server/0087-Configurable-RCON-IP-address.patch

45 lines
2.4 KiB
Diff
Raw Normal View History

2021-06-11 14:02:28 +02:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
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/dedicated/DedicatedServerProperties.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
2021-11-23 14:22:49 +01:00
index 9682a149d996cc19d7bc0e9506acb1346e5c222e..07fd3da4de300f80516961ae22700dbc741e81dc 100644
2021-06-11 14:02:28 +02:00
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
2021-11-23 14:22:49 +01:00
@@ -70,6 +70,8 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie
2021-06-12 06:38:04 +02:00
@Nullable
2021-07-07 08:52:40 +02:00
private WorldGenSettings worldGenSettings;
2021-06-11 14:02:28 +02:00
+ public final String rconIp; // Paper - Add rcon ip
+
// CraftBukkit start
2021-06-12 06:38:04 +02:00
public DedicatedServerProperties(Properties properties, OptionSet optionset) {
2021-06-11 14:02:28 +02:00
super(properties, optionset);
@@ -115,6 +117,10 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie
this.textFilteringConfig = this.get("text-filtering-config", "");
this.playerIdleTimeout = this.getMutable("player-idle-timeout", 0);
this.whiteList = this.getMutable("white-list", false);
+ // Paper start - Configurable rcon ip
2021-06-12 06:38:04 +02:00
+ final String rconIp = this.getStringRaw("rcon.ip");
2021-06-11 14:02:28 +02:00
+ this.rconIp = rconIp == null ? this.serverIp : rconIp;
+ // Paper end
}
2021-06-12 06:38:04 +02:00
// CraftBukkit start
2021-06-11 14:02:28 +02:00
diff --git a/src/main/java/net/minecraft/server/rcon/thread/RconThread.java b/src/main/java/net/minecraft/server/rcon/thread/RconThread.java
2021-06-12 06:38:04 +02:00
index 5e642ab9947f054c1741e13170a36f8fe300cdbe..a93e0eb67a78abb2eabd549cd5240095a24e5545 100644
2021-06-11 14:02:28 +02:00
--- a/src/main/java/net/minecraft/server/rcon/thread/RconThread.java
+++ b/src/main/java/net/minecraft/server/rcon/thread/RconThread.java
2021-06-12 06:38:04 +02:00
@@ -60,7 +60,7 @@ public class RconThread extends GenericThread {
2021-06-11 14:02:28 +02:00
@Nullable
public static RconThread create(ServerInterface server) {
2021-06-12 06:38:04 +02:00
DedicatedServerProperties dedicatedServerProperties = server.getProperties();
- String string = server.getServerIp();
+ String string = dedicatedServerProperties.rconIp; // Paper - Configurable rcon ip
if (string.isEmpty()) {
string = "0.0.0.0";
}