aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r--OpenSim/Framework/IClientAPI.cs2
-rw-r--r--OpenSim/Framework/RegionInfo.cs48
-rw-r--r--OpenSim/Framework/Util.cs2
3 files changed, 24 insertions, 28 deletions
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs
index f1290b9..c4de81e 100644
--- a/OpenSim/Framework/IClientAPI.cs
+++ b/OpenSim/Framework/IClientAPI.cs
@@ -1293,7 +1293,7 @@ namespace OpenSim.Framework
1293 void SendViewerEffect(ViewerEffectPacket.EffectBlock[] effectBlocks); 1293 void SendViewerEffect(ViewerEffectPacket.EffectBlock[] effectBlocks);
1294 void SendViewerTime(int phase); 1294 void SendViewerTime(int phase);
1295 1295
1296 void SendAvatarProperties(UUID avatarID, string aboutText, string bornOn, Byte[] charterMember, string flAbout, 1296 void SendAvatarProperties(UUID avatarID, string aboutText, string bornOn, Byte[] membershipType, string flAbout,
1297 uint flags, UUID flImageID, UUID imageID, string profileURL, UUID partnerID); 1297 uint flags, UUID flImageID, UUID imageID, string profileURL, UUID partnerID);
1298 1298
1299 void SendScriptQuestion(UUID taskID, string taskName, string ownerName, UUID itemID, int question); 1299 void SendScriptQuestion(UUID taskID, string taskName, string ownerName, UUID itemID, int question);
diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs
index ca17793..8f754a5 100644
--- a/OpenSim/Framework/RegionInfo.cs
+++ b/OpenSim/Framework/RegionInfo.cs
@@ -138,8 +138,6 @@ namespace OpenSim.Framework
138 protected uint m_httpPort; 138 protected uint m_httpPort;
139 protected string m_serverURI; 139 protected string m_serverURI;
140 protected string m_regionName = String.Empty; 140 protected string m_regionName = String.Empty;
141 protected bool Allow_Alternate_Ports;
142 public bool m_allow_alternate_ports;
143 protected string m_externalHostName; 141 protected string m_externalHostName;
144 protected IPEndPoint m_internalEndPoint; 142 protected IPEndPoint m_internalEndPoint;
145 protected uint m_remotingPort; 143 protected uint m_remotingPort;
@@ -147,6 +145,7 @@ namespace OpenSim.Framework
147 public string RemotingAddress; 145 public string RemotingAddress;
148 public UUID ScopeID = UUID.Zero; 146 public UUID ScopeID = UUID.Zero;
149 private UUID m_maptileStaticUUID = UUID.Zero; 147 private UUID m_maptileStaticUUID = UUID.Zero;
148 private bool m_resolveAddress = false;
150 149
151 public uint WorldLocX = 0; 150 public uint WorldLocX = 0;
152 public uint WorldLocY = 0; 151 public uint WorldLocY = 0;
@@ -544,7 +543,7 @@ namespace OpenSim.Framework
544 543
545 private void ReadNiniConfig(IConfigSource source, string name) 544 private void ReadNiniConfig(IConfigSource source, string name)
546 { 545 {
547// bool creatingNew = false; 546 bool creatingNew = false;
548 547
549 if (source.Configs.Count == 0) 548 if (source.Configs.Count == 0)
550 { 549 {
@@ -568,7 +567,7 @@ namespace OpenSim.Framework
568 567
569 source.AddConfig(name); 568 source.AddConfig(name);
570 569
571// creatingNew = true; 570 creatingNew = true;
572 } 571 }
573 572
574 if (name == String.Empty) 573 if (name == String.Empty)
@@ -672,18 +671,19 @@ namespace OpenSim.Framework
672 } 671 }
673 m_internalEndPoint = new IPEndPoint(address, port); 672 m_internalEndPoint = new IPEndPoint(address, port);
674 673
675 // AllowAlternatePorts 674 // ResolveAddress
676 // 675 //
677 allKeys.Remove("AllowAlternatePorts"); 676 allKeys.Remove("ResolveAddress");
678 if (config.Contains("AllowAlternatePorts")) 677 if (config.Contains("ResolveAddress"))
679 { 678 {
680 m_allow_alternate_ports = config.GetBoolean("AllowAlternatePorts", true); 679 m_resolveAddress = config.GetBoolean("ResolveAddress", false);
681 } 680 }
682 else 681 else
683 { 682 {
684 m_allow_alternate_ports = Convert.ToBoolean(MainConsole.Instance.CmdPrompt("Allow alternate ports", "False")); 683 if (creatingNew)
684 m_resolveAddress = Convert.ToBoolean(MainConsole.Instance.CmdPrompt("Resolve hostname to IP on start (for running inside Docker)", "False"));
685 685
686 config.Set("AllowAlternatePorts", m_allow_alternate_ports.ToString()); 686 config.Set("ResolveAddress", m_resolveAddress.ToString());
687 } 687 }
688 688
689 // ExternalHostName 689 // ExternalHostName
@@ -706,10 +706,18 @@ namespace OpenSim.Framework
706 "[REGIONINFO]: Resolving SYSTEMIP to {0} for external hostname of region {1}", 706 "[REGIONINFO]: Resolving SYSTEMIP to {0} for external hostname of region {1}",
707 m_externalHostName, name); 707 m_externalHostName, name);
708 } 708 }
709 else 709 else if (!m_resolveAddress)
710 { 710 {
711 m_externalHostName = externalName; 711 m_externalHostName = externalName;
712 } 712 }
713 else
714 {
715 IPAddress[] addrs = Dns.GetHostAddresses(externalName);
716 if (addrs.Length != 1) // If it is ambiguous or not resolveable, use it literally
717 m_externalHostName = externalName;
718 else
719 m_externalHostName = addrs[0].ToString();
720 }
713 721
714 // RegionType 722 // RegionType
715 m_regionType = config.GetString("RegionType", String.Empty); 723 m_regionType = config.GetString("RegionType", String.Empty);
@@ -901,8 +909,6 @@ namespace OpenSim.Framework
901 config.Set("InternalAddress", m_internalEndPoint.Address.ToString()); 909 config.Set("InternalAddress", m_internalEndPoint.Address.ToString());
902 config.Set("InternalPort", m_internalEndPoint.Port); 910 config.Set("InternalPort", m_internalEndPoint.Port);
903 911
904 config.Set("AllowAlternatePorts", m_allow_alternate_ports.ToString());
905
906 config.Set("ExternalHostName", m_externalHostName); 912 config.Set("ExternalHostName", m_externalHostName);
907 913
908 if (m_nonphysPrimMin > 0) 914 if (m_nonphysPrimMin > 0)
@@ -995,10 +1001,6 @@ namespace OpenSim.Framework
995 configMember.addConfigurationOption("internal_ip_port", ConfigurationOption.ConfigurationTypes.TYPE_INT32, 1001 configMember.addConfigurationOption("internal_ip_port", ConfigurationOption.ConfigurationTypes.TYPE_INT32,
996 "Internal IP Port for incoming UDP client connections", 1002 "Internal IP Port for incoming UDP client connections",
997 m_internalEndPoint.Port.ToString(), true); 1003 m_internalEndPoint.Port.ToString(), true);
998 configMember.addConfigurationOption("allow_alternate_ports",
999 ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN,
1000 "Allow sim to find alternate UDP ports when ports are in use?",
1001 m_allow_alternate_ports.ToString(), true);
1002 configMember.addConfigurationOption("external_host_name", 1004 configMember.addConfigurationOption("external_host_name",
1003 ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, 1005 ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY,
1004 "External Host Name", m_externalHostName, true); 1006 "External Host Name", m_externalHostName, true);
@@ -1068,9 +1070,6 @@ namespace OpenSim.Framework
1068 configMember.addConfigurationOption("internal_ip_port", ConfigurationOption.ConfigurationTypes.TYPE_INT32, 1070 configMember.addConfigurationOption("internal_ip_port", ConfigurationOption.ConfigurationTypes.TYPE_INT32,
1069 "Internal IP Port for incoming UDP client connections", 1071 "Internal IP Port for incoming UDP client connections",
1070 ConfigSettings.DefaultRegionHttpPort.ToString(), false); 1072 ConfigSettings.DefaultRegionHttpPort.ToString(), false);
1071 configMember.addConfigurationOption("allow_alternate_ports", ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN,
1072 "Allow sim to find alternate UDP ports when ports are in use?",
1073 "false", true);
1074 configMember.addConfigurationOption("external_host_name", 1073 configMember.addConfigurationOption("external_host_name",
1075 ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, 1074 ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY,
1076 "External Host Name", "127.0.0.1", false); 1075 "External Host Name", "127.0.0.1", false);
@@ -1141,9 +1140,6 @@ namespace OpenSim.Framework
1141 case "internal_ip_port": 1140 case "internal_ip_port":
1142 m_internalEndPoint.Port = (int) configuration_result; 1141 m_internalEndPoint.Port = (int) configuration_result;
1143 break; 1142 break;
1144 case "allow_alternate_ports":
1145 m_allow_alternate_ports = (bool) configuration_result;
1146 break;
1147 case "external_host_name": 1143 case "external_host_name":
1148 if ((string) configuration_result != "SYSTEMIP") 1144 if ((string) configuration_result != "SYSTEMIP")
1149 { 1145 {
@@ -1220,7 +1216,6 @@ namespace OpenSim.Framework
1220 if ((RemotingAddress != null) && !RemotingAddress.Equals("")) 1216 if ((RemotingAddress != null) && !RemotingAddress.Equals(""))
1221 args["remoting_address"] = OSD.FromString(RemotingAddress); 1217 args["remoting_address"] = OSD.FromString(RemotingAddress);
1222 args["remoting_port"] = OSD.FromString(RemotingPort.ToString()); 1218 args["remoting_port"] = OSD.FromString(RemotingPort.ToString());
1223 args["allow_alt_ports"] = OSD.FromBoolean(m_allow_alternate_ports);
1224 if ((proxyUrl != null) && !proxyUrl.Equals("")) 1219 if ((proxyUrl != null) && !proxyUrl.Equals(""))
1225 args["proxy_url"] = OSD.FromString(proxyUrl); 1220 args["proxy_url"] = OSD.FromString(proxyUrl);
1226 if (RegionType != String.Empty) 1221 if (RegionType != String.Empty)
@@ -1275,8 +1270,6 @@ namespace OpenSim.Framework
1275 RemotingAddress = args["remoting_address"].AsString(); 1270 RemotingAddress = args["remoting_address"].AsString();
1276 if (args["remoting_port"] != null) 1271 if (args["remoting_port"] != null)
1277 UInt32.TryParse(args["remoting_port"].AsString(), out m_remotingPort); 1272 UInt32.TryParse(args["remoting_port"].AsString(), out m_remotingPort);
1278 if (args["allow_alt_ports"] != null)
1279 m_allow_alternate_ports = args["allow_alt_ports"].AsBoolean();
1280 if (args["proxy_url"] != null) 1273 if (args["proxy_url"] != null)
1281 proxyUrl = args["proxy_url"].AsString(); 1274 proxyUrl = args["proxy_url"].AsString();
1282 if (args["region_type"] != null) 1275 if (args["region_type"] != null)
@@ -1314,7 +1307,8 @@ namespace OpenSim.Framework
1314 kvp["http_port"] = HttpPort.ToString(); 1307 kvp["http_port"] = HttpPort.ToString();
1315 kvp["internal_ip_address"] = InternalEndPoint.Address.ToString(); 1308 kvp["internal_ip_address"] = InternalEndPoint.Address.ToString();
1316 kvp["internal_port"] = InternalEndPoint.Port.ToString(); 1309 kvp["internal_port"] = InternalEndPoint.Port.ToString();
1317 kvp["alternate_ports"] = m_allow_alternate_ports.ToString(); 1310 // TODO: Remove in next major version
1311 kvp["alternate_ports"] = "False";
1318 kvp["server_uri"] = ServerURI; 1312 kvp["server_uri"] = ServerURI;
1319 1313
1320 return kvp; 1314 return kvp;
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs
index 01a06cd..a6fd99f 100644
--- a/OpenSim/Framework/Util.cs
+++ b/OpenSim/Framework/Util.cs
@@ -1685,6 +1685,8 @@ namespace OpenSim.Framework
1685 1685
1686 // hide the password in the connection string 1686 // hide the password in the connection string
1687 passPosition = connectionString.IndexOf("password", StringComparison.OrdinalIgnoreCase); 1687 passPosition = connectionString.IndexOf("password", StringComparison.OrdinalIgnoreCase);
1688 if (passPosition == -1)
1689 return connectionString;
1688 passPosition = connectionString.IndexOf("=", passPosition); 1690 passPosition = connectionString.IndexOf("=", passPosition);
1689 if (passPosition < connectionString.Length) 1691 if (passPosition < connectionString.Length)
1690 passPosition += 1; 1692 passPosition += 1;