1
0
Fork 0
4Creative-Changes/CurrentPatches/0001-Add-External-Hostname-...

49 lines
1.9 KiB
Diff
Raw Permalink Normal View History

2022-03-18 12:56:16 +00:00
From 6f363359d89cf5835d2fc32bedbdd89faf1311d1 Mon Sep 17 00:00:00 2001
2022-03-18 12:06:13 +00:00
From: Christopher <git@clatza.dev>
2022-03-18 12:56:16 +00:00
Date: Fri, 18 Mar 2022 13:55:34 +0100
2022-03-18 12:06:13 +00:00
Subject: [PATCH] Add External Hostname == DYNDNSIP to call current external ip
from aws services
---
2022-03-18 12:56:16 +00:00
OpenSim/Framework/RegionInfo.cs | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
2022-03-18 12:06:13 +00:00
diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs
2022-03-18 12:56:16 +00:00
index 507c51852b..f3bc127d54 100755
2022-03-18 12:06:13 +00:00
--- a/OpenSim/Framework/RegionInfo.cs
+++ b/OpenSim/Framework/RegionInfo.cs
2022-03-18 12:56:16 +00:00
@@ -596,6 +596,30 @@ namespace OpenSim.Framework
2022-03-18 12:06:13 +00:00
m_log.InfoFormat(
"[REGIONINFO]: Resolving SYSTEMIP to {0} for external hostname of region {1}",
m_externalHostName, name);
+ }else if(externalName == "DYNDNSIP")
+ {
+ m_externalHostName = Util.GetLocalHost().ToString();
+
+ try
+ {
+ using (WebClient getIpClient = new WebClient())
+ {
2022-03-18 12:56:16 +00:00
+ String externalip = getIpClient.DownloadString("http://checkip.amazonaws.com/");
2022-03-18 12:06:13 +00:00
+
2022-03-18 12:56:16 +00:00
+ if (externalip != null)
+ {
+ m_externalHostName = externalip.Trim();
+ m_log.InfoFormat("[REGIONINFO]: Resolving DYNDNSIP to {0} for region {1}", m_externalHostName, name);
+ }
+ else
+ {
+ m_log.ErrorFormat("[REGIONINFO]: Resolving DYNDNSIP failed for region {0}", name);
+ }
2022-03-18 12:06:13 +00:00
+ }
+ }catch(Exception error)
+ {
2022-03-18 12:56:16 +00:00
+ m_log.ErrorFormat("[REGIONINFO]: Resolving DYNDNSIP failed for region {0}: {1}", name, error.Message);
2022-03-18 12:06:13 +00:00
+ }
}
else if (!m_resolveAddress)
{
--
2.30.0.windows.2