aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Framework/RegionInfo.cs34
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs11
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs8
-rw-r--r--OpenSim/Tests/Common/Helpers/ClientStackHelpers.cs4
-rw-r--r--OpenSim/Tests/Common/Mock/TestLLUDPServer.cs4
5 files changed, 21 insertions, 40 deletions
diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs
index adffe13..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;
@@ -673,20 +671,6 @@ namespace OpenSim.Framework
673 } 671 }
674 m_internalEndPoint = new IPEndPoint(address, port); 672 m_internalEndPoint = new IPEndPoint(address, port);
675 673
676 // AllowAlternatePorts
677 //
678 allKeys.Remove("AllowAlternatePorts");
679 if (config.Contains("AllowAlternatePorts"))
680 {
681 m_allow_alternate_ports = config.GetBoolean("AllowAlternatePorts", true);
682 }
683 else
684 {
685 m_allow_alternate_ports = Convert.ToBoolean(MainConsole.Instance.CmdPrompt("Allow alternate ports", "False"));
686
687 config.Set("AllowAlternatePorts", m_allow_alternate_ports.ToString());
688 }
689
690 // ResolveAddress 674 // ResolveAddress
691 // 675 //
692 allKeys.Remove("ResolveAddress"); 676 allKeys.Remove("ResolveAddress");
@@ -925,8 +909,6 @@ namespace OpenSim.Framework
925 config.Set("InternalAddress", m_internalEndPoint.Address.ToString()); 909 config.Set("InternalAddress", m_internalEndPoint.Address.ToString());
926 config.Set("InternalPort", m_internalEndPoint.Port); 910 config.Set("InternalPort", m_internalEndPoint.Port);
927 911
928 config.Set("AllowAlternatePorts", m_allow_alternate_ports.ToString());
929
930 config.Set("ExternalHostName", m_externalHostName); 912 config.Set("ExternalHostName", m_externalHostName);
931 913
932 if (m_nonphysPrimMin > 0) 914 if (m_nonphysPrimMin > 0)
@@ -1019,10 +1001,6 @@ namespace OpenSim.Framework
1019 configMember.addConfigurationOption("internal_ip_port", ConfigurationOption.ConfigurationTypes.TYPE_INT32, 1001 configMember.addConfigurationOption("internal_ip_port", ConfigurationOption.ConfigurationTypes.TYPE_INT32,
1020 "Internal IP Port for incoming UDP client connections", 1002 "Internal IP Port for incoming UDP client connections",
1021 m_internalEndPoint.Port.ToString(), true); 1003 m_internalEndPoint.Port.ToString(), true);
1022 configMember.addConfigurationOption("allow_alternate_ports",
1023 ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN,
1024 "Allow sim to find alternate UDP ports when ports are in use?",
1025 m_allow_alternate_ports.ToString(), true);
1026 configMember.addConfigurationOption("external_host_name", 1004 configMember.addConfigurationOption("external_host_name",
1027 ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, 1005 ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY,
1028 "External Host Name", m_externalHostName, true); 1006 "External Host Name", m_externalHostName, true);
@@ -1092,9 +1070,6 @@ namespace OpenSim.Framework
1092 configMember.addConfigurationOption("internal_ip_port", ConfigurationOption.ConfigurationTypes.TYPE_INT32, 1070 configMember.addConfigurationOption("internal_ip_port", ConfigurationOption.ConfigurationTypes.TYPE_INT32,
1093 "Internal IP Port for incoming UDP client connections", 1071 "Internal IP Port for incoming UDP client connections",
1094 ConfigSettings.DefaultRegionHttpPort.ToString(), false); 1072 ConfigSettings.DefaultRegionHttpPort.ToString(), false);
1095 configMember.addConfigurationOption("allow_alternate_ports", ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN,
1096 "Allow sim to find alternate UDP ports when ports are in use?",
1097 "false", true);
1098 configMember.addConfigurationOption("external_host_name", 1073 configMember.addConfigurationOption("external_host_name",
1099 ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, 1074 ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY,
1100 "External Host Name", "127.0.0.1", false); 1075 "External Host Name", "127.0.0.1", false);
@@ -1165,9 +1140,6 @@ namespace OpenSim.Framework
1165 case "internal_ip_port": 1140 case "internal_ip_port":
1166 m_internalEndPoint.Port = (int) configuration_result; 1141 m_internalEndPoint.Port = (int) configuration_result;
1167 break; 1142 break;
1168 case "allow_alternate_ports":
1169 m_allow_alternate_ports = (bool) configuration_result;
1170 break;
1171 case "external_host_name": 1143 case "external_host_name":
1172 if ((string) configuration_result != "SYSTEMIP") 1144 if ((string) configuration_result != "SYSTEMIP")
1173 { 1145 {
@@ -1244,7 +1216,6 @@ namespace OpenSim.Framework
1244 if ((RemotingAddress != null) && !RemotingAddress.Equals("")) 1216 if ((RemotingAddress != null) && !RemotingAddress.Equals(""))
1245 args["remoting_address"] = OSD.FromString(RemotingAddress); 1217 args["remoting_address"] = OSD.FromString(RemotingAddress);
1246 args["remoting_port"] = OSD.FromString(RemotingPort.ToString()); 1218 args["remoting_port"] = OSD.FromString(RemotingPort.ToString());
1247 args["allow_alt_ports"] = OSD.FromBoolean(m_allow_alternate_ports);
1248 if ((proxyUrl != null) && !proxyUrl.Equals("")) 1219 if ((proxyUrl != null) && !proxyUrl.Equals(""))
1249 args["proxy_url"] = OSD.FromString(proxyUrl); 1220 args["proxy_url"] = OSD.FromString(proxyUrl);
1250 if (RegionType != String.Empty) 1221 if (RegionType != String.Empty)
@@ -1299,8 +1270,6 @@ namespace OpenSim.Framework
1299 RemotingAddress = args["remoting_address"].AsString(); 1270 RemotingAddress = args["remoting_address"].AsString();
1300 if (args["remoting_port"] != null) 1271 if (args["remoting_port"] != null)
1301 UInt32.TryParse(args["remoting_port"].AsString(), out m_remotingPort); 1272 UInt32.TryParse(args["remoting_port"].AsString(), out m_remotingPort);
1302 if (args["allow_alt_ports"] != null)
1303 m_allow_alternate_ports = args["allow_alt_ports"].AsBoolean();
1304 if (args["proxy_url"] != null) 1273 if (args["proxy_url"] != null)
1305 proxyUrl = args["proxy_url"].AsString(); 1274 proxyUrl = args["proxy_url"].AsString();
1306 if (args["region_type"] != null) 1275 if (args["region_type"] != null)
@@ -1338,7 +1307,8 @@ namespace OpenSim.Framework
1338 kvp["http_port"] = HttpPort.ToString(); 1307 kvp["http_port"] = HttpPort.ToString();
1339 kvp["internal_ip_address"] = InternalEndPoint.Address.ToString(); 1308 kvp["internal_ip_address"] = InternalEndPoint.Address.ToString();
1340 kvp["internal_port"] = InternalEndPoint.Port.ToString(); 1309 kvp["internal_port"] = InternalEndPoint.Port.ToString();
1341 kvp["alternate_ports"] = m_allow_alternate_ports.ToString(); 1310 // TODO: Remove in next major version
1311 kvp["alternate_ports"] = "False";
1342 kvp["server_uri"] = ServerURI; 1312 kvp["server_uri"] = ServerURI;
1343 1313
1344 return kvp; 1314 return kvp;
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
index a868e3a..cedb9b4 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
@@ -81,7 +81,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
81 uint port = (uint)scene.RegionInfo.InternalEndPoint.Port; 81 uint port = (uint)scene.RegionInfo.InternalEndPoint.Port;
82 82
83 IPAddress listenIP = scene.RegionInfo.InternalEndPoint.Address; 83 IPAddress listenIP = scene.RegionInfo.InternalEndPoint.Address;
84 Initialise(listenIP, ref port, scene.RegionInfo.ProxyOffset, scene.RegionInfo.m_allow_alternate_ports, m_Config, scene.AuthenticateHandler); 84 Initialise(listenIP, ref port, scene.RegionInfo.ProxyOffset, m_Config, scene.AuthenticateHandler);
85 scene.RegionInfo.InternalEndPoint.Port = (int)port; 85 scene.RegionInfo.InternalEndPoint.Port = (int)port;
86 86
87 AddScene(scene); 87 AddScene(scene);
@@ -98,9 +98,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
98 } 98 }
99 #endregion 99 #endregion
100 100
101 public virtual void Initialise(IPAddress listenIP, ref uint port, int proxyPortOffsetParm, bool allow_alternate_port, IConfigSource configSource, AgentCircuitManager circuitManager) 101 public virtual void Initialise(IPAddress listenIP, ref uint port, int proxyPortOffsetParm, IConfigSource configSource, AgentCircuitManager circuitManager)
102 { 102 {
103 m_udpServer = new LLUDPServer(listenIP, ref port, proxyPortOffsetParm, allow_alternate_port, configSource, circuitManager); 103 m_udpServer = new LLUDPServer(listenIP, ref port, proxyPortOffsetParm, configSource, circuitManager);
104 } 104 }
105 105
106 public virtual void AddScene(IScene scene) 106 public virtual void AddScene(IScene scene)
@@ -430,12 +430,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP
430 public JobEngine OqrEngine { get; protected set; } 430 public JobEngine OqrEngine { get; protected set; }
431 431
432 public LLUDPServer( 432 public LLUDPServer(
433 IPAddress listenIP, ref uint port, int proxyPortOffsetParm, bool allow_alternate_port, 433 IPAddress listenIP, ref uint port, int proxyPortOffsetParm,
434 IConfigSource configSource, AgentCircuitManager circuitManager) 434 IConfigSource configSource, AgentCircuitManager circuitManager)
435 : base(listenIP, (int)port) 435 : base(listenIP, (int)port)
436 { 436 {
437 #region Environment.TickCount Measurement 437 #region Environment.TickCount Measurement
438 438
439 // Update the port with the one we actually got
440 port = (uint)Port;
441
439 // Measure the resolution of Environment.TickCount 442 // Measure the resolution of Environment.TickCount
440 TickCountResolution = 0f; 443 TickCountResolution = 0f;
441 for (int i = 0; i < 10; i++) 444 for (int i = 0; i < 10; i++)
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs b/OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs
index fffd02c..831381e 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs
@@ -107,6 +107,11 @@ namespace OpenMetaverse
107 /// </summary> 107 /// </summary>
108 public float AverageReceiveTicksForLastSamplePeriod { get; private set; } 108 public float AverageReceiveTicksForLastSamplePeriod { get; private set; }
109 109
110 public int Port
111 {
112 get { return m_udpPort; }
113 }
114
110 #region PacketDropDebugging 115 #region PacketDropDebugging
111 /// <summary> 116 /// <summary>
112 /// For debugging purposes only... random number generator for dropping 117 /// For debugging purposes only... random number generator for dropping
@@ -257,6 +262,9 @@ namespace OpenMetaverse
257 262
258 m_udpSocket.Bind(ipep); 263 m_udpSocket.Bind(ipep);
259 264
265 if (m_udpPort == 0)
266 m_udpPort = ((IPEndPoint)m_udpSocket.LocalEndPoint).Port;
267
260 IsRunningInbound = true; 268 IsRunningInbound = true;
261 269
262 // kick off an async receive. The Start() method will return, the 270 // kick off an async receive. The Start() method will return, the
diff --git a/OpenSim/Tests/Common/Helpers/ClientStackHelpers.cs b/OpenSim/Tests/Common/Helpers/ClientStackHelpers.cs
index 33cd8a2..df9f6f2 100644
--- a/OpenSim/Tests/Common/Helpers/ClientStackHelpers.cs
+++ b/OpenSim/Tests/Common/Helpers/ClientStackHelpers.cs
@@ -86,10 +86,10 @@ namespace OpenSim.Tests.Common
86 uint port = 0; 86 uint port = 0;
87 AgentCircuitManager acm = scene.AuthenticateHandler; 87 AgentCircuitManager acm = scene.AuthenticateHandler;
88 88
89 TestLLUDPServer udpServer = new TestLLUDPServer(IPAddress.Any, ref port, 0, false, configSource, acm); 89 TestLLUDPServer udpServer = new TestLLUDPServer(IPAddress.Any, ref port, 0, configSource, acm);
90 udpServer.AddScene(scene); 90 udpServer.AddScene(scene);
91 91
92 return udpServer; 92 return udpServer;
93 } 93 }
94 } 94 }
95} \ No newline at end of file 95}
diff --git a/OpenSim/Tests/Common/Mock/TestLLUDPServer.cs b/OpenSim/Tests/Common/Mock/TestLLUDPServer.cs
index 26887c9..b2c6a8c 100644
--- a/OpenSim/Tests/Common/Mock/TestLLUDPServer.cs
+++ b/OpenSim/Tests/Common/Mock/TestLLUDPServer.cs
@@ -43,8 +43,8 @@ namespace OpenSim.Tests.Common
43 { 43 {
44 public List<Packet> PacketsSent { get; private set; } 44 public List<Packet> PacketsSent { get; private set; }
45 45
46 public TestLLUDPServer(IPAddress listenIP, ref uint port, int proxyPortOffsetParm, bool allow_alternate_port, IConfigSource configSource, AgentCircuitManager circuitManager) 46 public TestLLUDPServer(IPAddress listenIP, ref uint port, int proxyPortOffsetParm, IConfigSource configSource, AgentCircuitManager circuitManager)
47 : base(listenIP, ref port, proxyPortOffsetParm, allow_alternate_port, configSource, circuitManager) 47 : base(listenIP, ref port, proxyPortOffsetParm, configSource, circuitManager)
48 { 48 {
49 PacketsSent = new List<Packet>(); 49 PacketsSent = new List<Packet>();
50 } 50 }