diff --git a/LoadBalancerProject-DONT-IMPORT-INTO-UNITY/LRM_LoadBalancer/DataContainer.cs b/LoadBalancerProject-DONT-IMPORT-INTO-UNITY/LRM_LoadBalancer/DataContainer.cs index 71217b1..e7c6cec 100644 --- a/LoadBalancerProject-DONT-IMPORT-INTO-UNITY/LRM_LoadBalancer/DataContainer.cs +++ b/LoadBalancerProject-DONT-IMPORT-INTO-UNITY/LRM_LoadBalancer/DataContainer.cs @@ -24,6 +24,7 @@ namespace LightReflectiveMirror.LoadBalancing public TimeSpan uptime; public long CCU; public long totalServerCount; + public List> connectedNodes; } // container for relay address info diff --git a/LoadBalancerProject-DONT-IMPORT-INTO-UNITY/LRM_LoadBalancer/Endpoint/EndpointVariables.cs b/LoadBalancerProject-DONT-IMPORT-INTO-UNITY/LRM_LoadBalancer/Endpoint/EndpointVariables.cs index 980704e..0d94470 100644 --- a/LoadBalancerProject-DONT-IMPORT-INTO-UNITY/LRM_LoadBalancer/Endpoint/EndpointVariables.cs +++ b/LoadBalancerProject-DONT-IMPORT-INTO-UNITY/LRM_LoadBalancer/Endpoint/EndpointVariables.cs @@ -1,5 +1,7 @@ using System; using System.Collections.Generic; +using System.Linq; + namespace LightReflectiveMirror.LoadBalancing { public partial class Endpoint @@ -22,6 +24,7 @@ namespace LightReflectiveMirror.LoadBalancing uptime = DateTime.Now - Program.startupTime, CCU = Program.instance.GetTotalCCU(), totalServerCount = Program.instance.GetTotalServers(), + connectedNodes = Program.instance.availableRelayServers.ToList() }; } } diff --git a/ServerProject-DONT-IMPORT-INTO-UNITY/LRM/Program/Program.cs b/ServerProject-DONT-IMPORT-INTO-UNITY/LRM/Program/Program.cs index 752c73f..b4582fc 100644 --- a/ServerProject-DONT-IMPORT-INTO-UNITY/LRM/Program/Program.cs +++ b/ServerProject-DONT-IMPORT-INTO-UNITY/LRM/Program/Program.cs @@ -24,7 +24,16 @@ namespace LightReflectiveMirror instance = this; _startupTime = DateTime.Now; using (WebClient wc = new WebClient()) - publicIP = wc.DownloadString("http://ipv4.icanhazip.com").Replace("\\r", "").Replace("\\n", "").Trim(); + { + try + { + publicIP = wc.DownloadString("http://ipv4.icanhazip.com").Replace("\\r", "").Replace("\\n", "").Trim(); + } + catch { + WriteLogMessage("Failed to reach public IP endpoint! Using loopback address.", ConsoleColor.Yellow); + publicIP = "127.0.0.1"; + } + } if (!File.Exists(CONFIG_PATH)) {