testserver/patches/server/0085-Configurable-RCON-IP-a...

45 lines
2.3 KiB
Diff
Raw Normal View History

2021-06-11 12:02:28 +00: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
2022-03-01 05:43:03 +00:00
index 703403222763e42566552f2c6f3852e07f727f76..a7938420f6840b9d3880fb895aaf709ebd844312 100644
2021-06-11 12:02:28 +00:00
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
2022-03-01 05:43:03 +00:00
@@ -74,6 +74,8 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie
2021-06-12 04:38:04 +00:00
@Nullable
2021-07-07 06:52:40 +00:00
private WorldGenSettings worldGenSettings;
2021-06-11 12:02:28 +00:00
+ public final String rconIp; // Paper - Add rcon ip
+
// CraftBukkit start
2021-06-12 04:38:04 +00:00
public DedicatedServerProperties(Properties properties, OptionSet optionset) {
2021-06-11 12:02:28 +00:00
super(properties, optionset);
2022-03-01 05:43:03 +00:00
@@ -124,6 +126,10 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie
}, new JsonObject()), this.get("generate-structures", true), (String) this.get("level-type", (s) -> {
return s.toLowerCase(Locale.ROOT);
}, "default"));
2021-06-11 12:02:28 +00:00
+ // Paper start - Configurable rcon ip
2021-06-12 04:38:04 +00:00
+ final String rconIp = this.getStringRaw("rcon.ip");
2021-06-11 12:02:28 +00:00
+ this.rconIp = rconIp == null ? this.serverIp : rconIp;
+ // Paper end
}
2021-06-12 04:38:04 +00:00
// CraftBukkit start
2021-06-11 12:02:28 +00: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
2022-03-01 05:43:03 +00:00
index cb61eaf8447c8340c4b4e1079c0a6aecd41a6116..3bf60f640aa9fa4cabd2b3e5d3931e8467b9df24 100644
2021-06-11 12:02:28 +00: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 04:38:04 +00:00
@@ -60,7 +60,7 @@ public class RconThread extends GenericThread {
2021-06-11 12:02:28 +00:00
@Nullable
public static RconThread create(ServerInterface server) {
2021-06-12 04:38:04 +00: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";
}