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

45 lines
1.7 KiB
Diff

From affb6e69909f26090497e8e3dae11544c269cd27 Mon Sep 17 00:00:00 2001
From: Christopher <git@clatza.dev>
Date: Fri, 18 Mar 2022 12:52:23 +0100
Subject: [PATCH] Add External Hostname == DYNDNSIP to call current external ip
from aws services
---
OpenSim/Framework/RegionInfo.cs | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs
index 507c51852b..4282fe06c0 100755
--- a/OpenSim/Framework/RegionInfo.cs
+++ b/OpenSim/Framework/RegionInfo.cs
@@ -596,6 +596,26 @@ namespace OpenSim.Framework
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())
+ {
+ m_externalHostName = getIpClient.DownloadString("http://checkip.amazonaws.com/");
+
+ m_log.InfoFormat(
+ "[REGIONINFO]: Resolving DYNDNSIP to {0} for region {1}",
+ m_externalHostName, name);
+ }
+ }catch(Exception error)
+ {
+ m_log.ErrorFormat(
+ "[REGIONINFO]: Resolving DYNDNSIP failed for region {0}: {1}",
+ name, error.Message);
+ }
}
else if (!m_resolveAddress)
{
--
2.30.0.windows.2