aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0089-Configurable-RCON-IP-address.patch
blob: fa6341c5b8073c4172ec755ce95ec0e7e9bceafe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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
index efa2dd7947f68aaec479d835f2b1e60d16254ae1..1e01277448a3cf2b2045b54b182166a66c822e20 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
@@ -100,6 +100,8 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie
     @Nullable
     private WorldGenSettings worldGenSettings;
 
+    public final String rconIp; // Paper - Add rcon ip
+
     // CraftBukkit start
     public DedicatedServerProperties(Properties properties, OptionSet optionset) {
         super(properties, optionset);
@@ -152,6 +154,10 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie
             return s.toLowerCase(Locale.ROOT);
         }, WorldPresets.NORMAL.location().toString()));
         this.serverResourcePackInfo = DedicatedServerProperties.getServerPackInfo(this.get("resource-pack", ""), this.get("resource-pack-sha1", ""), this.getLegacyString("resource-pack-hash"), this.get("require-resource-pack", false), this.get("resource-pack-prompt", ""));
+        // Paper start - Configurable rcon ip
+        final String rconIp = this.getStringRaw("rcon.ip");
+        this.rconIp = rconIp == null ? this.serverIp : rconIp;
+        // Paper end
     }
 
     // CraftBukkit start
diff --git a/src/main/java/net/minecraft/server/rcon/thread/RconThread.java b/src/main/java/net/minecraft/server/rcon/thread/RconThread.java
index cb61eaf8447c8340c4b4e1079c0a6aecd41a6116..3bf60f640aa9fa4cabd2b3e5d3931e8467b9df24 100644
--- a/src/main/java/net/minecraft/server/rcon/thread/RconThread.java
+++ b/src/main/java/net/minecraft/server/rcon/thread/RconThread.java
@@ -60,7 +60,7 @@ public class RconThread extends GenericThread {
     @Nullable
     public static RconThread create(ServerInterface server) {
         DedicatedServerProperties dedicatedServerProperties = server.getProperties();
-        String string = server.getServerIp();
+        String string = dedicatedServerProperties.rconIp; // Paper - Configurable rcon ip
         if (string.isEmpty()) {
             string = "0.0.0.0";
         }