diff options
author | lbsa71 | 2007-07-01 16:07:41 +0000 |
---|---|---|
committer | lbsa71 | 2007-07-01 16:07:41 +0000 |
commit | 06a8c132005b4ab804f25d54c0c0f899fc98e3a1 (patch) | |
tree | 2210d9426050c11035453631735fb1f324a070a7 | |
parent | Fixed SimpleApp - aka thankgoditssundaycommit (diff) | |
download | opensim-SC-06a8c132005b4ab804f25d54c0c0f899fc98e3a1.zip opensim-SC-06a8c132005b4ab804f25d54c0c0f899fc98e3a1.tar.gz opensim-SC-06a8c132005b4ab804f25d54c0c0f899fc98e3a1.tar.bz2 opensim-SC-06a8c132005b4ab804f25d54c0c0f899fc98e3a1.tar.xz |
MAJOR IP RESTRUCTURING
* moving towards IPEndPoints all over the place
* trying to make the internal/external division
-rw-r--r-- | OpenSim/Framework/Console/LogBase.cs | 58 | ||||
-rw-r--r-- | OpenSim/Framework/General/Interfaces/IClientAPI.cs | 7 | ||||
-rw-r--r-- | OpenSim/Framework/General/Types/RegionInfo.cs | 270 | ||||
-rw-r--r-- | OpenSim/Region/Application/OpenSimMain.cs | 2 | ||||
-rw-r--r-- | OpenSim/Region/Capabilities/Caps.cs | 17 | ||||
-rw-r--r-- | OpenSim/Region/ClientStack/ClientView.API.cs | 18 | ||||
-rw-r--r-- | OpenSim/Region/ClientStack/PacketServer.cs | 4 | ||||
-rw-r--r-- | OpenSim/Region/ClientStack/UDPServer.cs | 2 | ||||
-rw-r--r-- | OpenSim/Region/Communications/Local/LocalUserServices.cs | 6 | ||||
-rw-r--r-- | OpenSim/Region/Communications/OGS1/OGS1GridServices.cs | 18 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.cs | 6 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/ScenePresence.cs | 2 | ||||
-rw-r--r-- | OpenSim/Region/Examples/SimpleApp/Program.cs | 16 |
13 files changed, 271 insertions, 155 deletions
diff --git a/OpenSim/Framework/Console/LogBase.cs b/OpenSim/Framework/Console/LogBase.cs index 1a92d8e..a4a17e9 100644 --- a/OpenSim/Framework/Console/LogBase.cs +++ b/OpenSim/Framework/Console/LogBase.cs | |||
@@ -27,6 +27,7 @@ | |||
27 | */ | 27 | */ |
28 | using System; | 28 | using System; |
29 | using System.IO; | 29 | using System.IO; |
30 | using System.Net; | ||
30 | 31 | ||
31 | namespace OpenSim.Framework.Console | 32 | namespace OpenSim.Framework.Console |
32 | { | 33 | { |
@@ -48,18 +49,18 @@ namespace OpenSim.Framework.Console | |||
48 | public string componentname; | 49 | public string componentname; |
49 | private bool m_silent; | 50 | private bool m_silent; |
50 | 51 | ||
51 | public LogBase(string LogFile, string componentname, conscmd_callback cmdparser, bool silent ) | 52 | public LogBase(string LogFile, string componentname, conscmd_callback cmdparser, bool silent) |
52 | { | 53 | { |
53 | this.componentname = componentname; | 54 | this.componentname = componentname; |
54 | this.cmdparser = cmdparser; | 55 | this.cmdparser = cmdparser; |
55 | this.m_silent = silent; | 56 | this.m_silent = silent; |
56 | System.Console.WriteLine("ServerConsole.cs - creating new local console"); | 57 | System.Console.WriteLine("ServerConsole.cs - creating new local console"); |
57 | 58 | ||
58 | if( String.IsNullOrEmpty( LogFile ) ) | 59 | if (String.IsNullOrEmpty(LogFile)) |
59 | { | 60 | { |
60 | LogFile = componentname + ".log"; | 61 | LogFile = componentname + ".log"; |
61 | } | 62 | } |
62 | 63 | ||
63 | System.Console.WriteLine("Logs will be saved to current directory in " + LogFile); | 64 | System.Console.WriteLine("Logs will be saved to current directory in " + LogFile); |
64 | Log = File.AppendText(LogFile); | 65 | Log = File.AppendText(LogFile); |
65 | Log.WriteLine("========================================================================"); | 66 | Log.WriteLine("========================================================================"); |
@@ -74,10 +75,10 @@ namespace OpenSim.Framework.Console | |||
74 | 75 | ||
75 | public void Write(string format, params object[] args) | 76 | public void Write(string format, params object[] args) |
76 | { | 77 | { |
77 | Notice(format,args); | 78 | Notice(format, args); |
78 | return; | 79 | return; |
79 | } | 80 | } |
80 | 81 | ||
81 | public void WriteLine(LogPriority importance, string format, params object[] args) | 82 | public void WriteLine(LogPriority importance, string format, params object[] args) |
82 | { | 83 | { |
83 | Log.WriteLine(format, args); | 84 | Log.WriteLine(format, args); |
@@ -154,6 +155,49 @@ namespace OpenSim.Framework.Console | |||
154 | return TempInt; | 155 | return TempInt; |
155 | } | 156 | } |
156 | 157 | ||
158 | public IPAddress CmdPromptIPAddress(string prompt, string defaultvalue) | ||
159 | { | ||
160 | IPAddress address; | ||
161 | string addressStr; | ||
162 | |||
163 | while (true) | ||
164 | { | ||
165 | addressStr = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt(prompt, defaultvalue); | ||
166 | if (IPAddress.TryParse(addressStr, out address)) | ||
167 | { | ||
168 | break; | ||
169 | } | ||
170 | else | ||
171 | { | ||
172 | OpenSim.Framework.Console.MainLog.Instance.Error("Illegal address. Please re-enter."); | ||
173 | } | ||
174 | } | ||
175 | |||
176 | return address; | ||
177 | } | ||
178 | |||
179 | public int CmdPromptIPPort(string prompt, string defaultvalue) | ||
180 | { | ||
181 | int port; | ||
182 | string portStr; | ||
183 | |||
184 | while (true) | ||
185 | { | ||
186 | portStr = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt(prompt, defaultvalue); | ||
187 | if (int.TryParse(portStr, out port)) | ||
188 | { | ||
189 | if (port >= IPEndPoint.MinPort && port <= IPEndPoint.MaxPort) | ||
190 | { | ||
191 | break; | ||
192 | } | ||
193 | } | ||
194 | |||
195 | OpenSim.Framework.Console.MainLog.Instance.Error("Illegal address. Please re-enter."); | ||
196 | } | ||
197 | |||
198 | return port; | ||
199 | } | ||
200 | |||
157 | // Displays a prompt and waits for the user to enter a string, then returns that string | 201 | // Displays a prompt and waits for the user to enter a string, then returns that string |
158 | // Done with no echo and suitable for passwords | 202 | // Done with no echo and suitable for passwords |
159 | public string PasswdPrompt(string prompt) | 203 | public string PasswdPrompt(string prompt) |
@@ -178,7 +222,7 @@ namespace OpenSim.Framework.Console | |||
178 | // Displays a command prompt and returns a default value if the user simply presses enter | 222 | // Displays a command prompt and returns a default value if the user simply presses enter |
179 | public string CmdPrompt(string prompt, string defaultresponse) | 223 | public string CmdPrompt(string prompt, string defaultresponse) |
180 | { | 224 | { |
181 | string temp = CmdPrompt(String.Format( "{0} [{1}]", prompt, defaultresponse )); | 225 | string temp = CmdPrompt(String.Format("{0} [{1}]", prompt, defaultresponse)); |
182 | if (temp == "") | 226 | if (temp == "") |
183 | { | 227 | { |
184 | return defaultresponse; | 228 | return defaultresponse; |
diff --git a/OpenSim/Framework/General/Interfaces/IClientAPI.cs b/OpenSim/Framework/General/Interfaces/IClientAPI.cs index 4e8ac1a..ea4c5c9 100644 --- a/OpenSim/Framework/General/Interfaces/IClientAPI.cs +++ b/OpenSim/Framework/General/Interfaces/IClientAPI.cs | |||
@@ -32,6 +32,7 @@ using OpenSim.Framework.Inventory; | |||
32 | using libsecondlife; | 32 | using libsecondlife; |
33 | using libsecondlife.Packets; | 33 | using libsecondlife.Packets; |
34 | using OpenSim.Framework.Types; | 34 | using OpenSim.Framework.Types; |
35 | using System.Net; | ||
35 | 36 | ||
36 | namespace OpenSim.Framework.Interfaces | 37 | namespace OpenSim.Framework.Interfaces |
37 | { | 38 | { |
@@ -143,12 +144,12 @@ namespace OpenSim.Framework.Interfaces | |||
143 | void SendLayerData(float[] map); | 144 | void SendLayerData(float[] map); |
144 | void SendLayerData(int px, int py, float[] map); | 145 | void SendLayerData(int px, int py, float[] map); |
145 | void MoveAgentIntoRegion(RegionInfo regInfo, LLVector3 pos, LLVector3 look); | 146 | void MoveAgentIntoRegion(RegionInfo regInfo, LLVector3 pos, LLVector3 look); |
146 | void InformClientOfNeighbour(ulong neighbourHandle, System.Net.IPAddress neighbourIP, ushort neighbourPort); | 147 | void InformClientOfNeighbour(ulong neighbourHandle, IPEndPoint neighbourExternalEndPoint ); |
147 | AgentCircuitData RequestClientInfo(); | 148 | AgentCircuitData RequestClientInfo(); |
148 | void CrossRegion(ulong newRegionHandle, LLVector3 pos, LLVector3 lookAt, System.Net.IPAddress newRegionIP, ushort newRegionPort); | 149 | void CrossRegion(ulong newRegionHandle, LLVector3 pos, LLVector3 lookAt, IPEndPoint newRegionExternalEndPoint ); |
149 | void SendMapBlock(List<MapBlockData> mapBlocks); | 150 | void SendMapBlock(List<MapBlockData> mapBlocks); |
150 | void SendLocalTeleport(LLVector3 position, LLVector3 lookAt, uint flags); | 151 | void SendLocalTeleport(LLVector3 position, LLVector3 lookAt, uint flags); |
151 | void SendRegionTeleport(ulong regionHandle, byte simAccess, string ipAddress, ushort ipPort, uint locationID, uint flags); | 152 | void SendRegionTeleport(ulong regionHandle, byte simAccess, IPEndPoint regionExternalEndPoint, uint locationID, uint flags); |
152 | void SendTeleportCancel(); | 153 | void SendTeleportCancel(); |
153 | void SendTeleportLocationStart(); | 154 | void SendTeleportLocationStart(); |
154 | void SendMoneyBalance(LLUUID transaction, bool success, byte[] description, int balance); | 155 | void SendMoneyBalance(LLUUID transaction, bool success, byte[] description, int balance); |
diff --git a/OpenSim/Framework/General/Types/RegionInfo.cs b/OpenSim/Framework/General/Types/RegionInfo.cs index 1ead3c4..d98dd60 100644 --- a/OpenSim/Framework/General/Types/RegionInfo.cs +++ b/OpenSim/Framework/General/Types/RegionInfo.cs | |||
@@ -33,6 +33,7 @@ using OpenSim.Framework.Interfaces; | |||
33 | using OpenSim.Framework.Utilities; | 33 | using OpenSim.Framework.Utilities; |
34 | using OpenSim.Framework.Console; | 34 | using OpenSim.Framework.Console; |
35 | using libsecondlife; | 35 | using libsecondlife; |
36 | using System.Net; | ||
36 | 37 | ||
37 | namespace OpenSim.Framework.Types | 38 | namespace OpenSim.Framework.Types |
38 | { | 39 | { |
@@ -41,6 +42,32 @@ namespace OpenSim.Framework.Types | |||
41 | public LLUUID SimUUID = new LLUUID(); | 42 | public LLUUID SimUUID = new LLUUID(); |
42 | public string RegionName = ""; | 43 | public string RegionName = ""; |
43 | 44 | ||
45 | private IPEndPoint m_internalEndPoint; | ||
46 | public IPEndPoint InternalEndPoint | ||
47 | { | ||
48 | get | ||
49 | { | ||
50 | return m_internalEndPoint; | ||
51 | } | ||
52 | } | ||
53 | |||
54 | public IPEndPoint ExternalEndPoint | ||
55 | { | ||
56 | get | ||
57 | { | ||
58 | return new IPEndPoint( Dns.GetHostAddresses( m_externalHostName )[0], m_internalEndPoint.Port ); | ||
59 | } | ||
60 | } | ||
61 | |||
62 | private string m_externalHostName; | ||
63 | public string ExternalHostName | ||
64 | { | ||
65 | get | ||
66 | { | ||
67 | return m_externalHostName; | ||
68 | } | ||
69 | } | ||
70 | |||
44 | private uint? m_regionLocX; | 71 | private uint? m_regionLocX; |
45 | public uint RegionLocX | 72 | public uint RegionLocX |
46 | { | 73 | { |
@@ -81,43 +108,43 @@ namespace OpenSim.Framework.Types | |||
81 | public string MasterAvatarLastName = ""; | 108 | public string MasterAvatarLastName = ""; |
82 | public string MasterAvatarSandboxPassword = ""; | 109 | public string MasterAvatarSandboxPassword = ""; |
83 | 110 | ||
84 | private int? m_commsIPListenPort; | 111 | //private int? m_commsIPListenPort; |
85 | 112 | ||
86 | /// <summary> | 113 | ///// <summary> |
87 | /// Port used for listening (TCP and UDP) | 114 | ///// Port used for listening (TCP and UDP) |
88 | /// </summary> | 115 | ///// </summary> |
89 | /// <remarks>Seperate TCP and UDP</remarks> | 116 | ///// <remarks>Seperate TCP and UDP</remarks> |
90 | public int CommsIPListenPort | 117 | //public int CommsIPListenPort |
91 | { | 118 | //{ |
92 | get | 119 | // get |
93 | { | 120 | // { |
94 | return m_commsIPListenPort.Value; | 121 | // return m_commsIPListenPort.Value; |
95 | } | 122 | // } |
96 | } | 123 | //} |
97 | 124 | ||
98 | private string m_commsIPListenAddr; | 125 | //private string m_commsIPListenAddr; |
99 | /// <summary> | 126 | ///// <summary> |
100 | /// Address used for internal listening (default: 0.0.0.0?) | 127 | ///// Address used for internal listening (default: 0.0.0.0?) |
101 | /// </summary> | 128 | ///// </summary> |
102 | public string CommsIPListenAddr | 129 | //public string CommsIPListenAddr |
103 | { | 130 | //{ |
104 | get | 131 | // get |
105 | { | 132 | // { |
106 | return m_commsIPListenAddr; | 133 | // return m_commsIPListenAddr; |
107 | } | 134 | // } |
108 | } | 135 | //} |
109 | 136 | ||
110 | private string m_commsExternalAddress; | 137 | //private string m_commsExternalAddress; |
111 | /// <summary> | 138 | ///// <summary> |
112 | /// Address used for external addressing (DNS or IP) | 139 | ///// Address used for external addressing (DNS or IP) |
113 | /// </summary> | 140 | ///// </summary> |
114 | public string CommsExternalAddress | 141 | //public string CommsExternalAddress |
115 | { | 142 | //{ |
116 | get | 143 | // get |
117 | { | 144 | // { |
118 | return m_commsExternalAddress; | 145 | // return m_commsExternalAddress; |
119 | } | 146 | // } |
120 | } | 147 | //} |
121 | 148 | ||
122 | 149 | ||
123 | public EstateSettings estateSettings; | 150 | public EstateSettings estateSettings; |
@@ -126,15 +153,19 @@ namespace OpenSim.Framework.Types | |||
126 | { | 153 | { |
127 | estateSettings = new EstateSettings(); | 154 | estateSettings = new EstateSettings(); |
128 | } | 155 | } |
129 | 156 | ||
130 | public RegionInfo( uint regionLocX, uint regionLocY, string simIp, int simPort, string simUri ) : this() | 157 | public RegionInfo(uint regionLocX, uint regionLocY, IPEndPoint internalEndPoint, string externalUri) |
158 | : this() | ||
131 | { | 159 | { |
132 | m_regionLocX = regionLocX; | 160 | m_regionLocX = regionLocX; |
133 | m_regionLocY = regionLocY; | 161 | m_regionLocY = regionLocY; |
134 | 162 | ||
135 | m_commsIPListenAddr = simIp; | 163 | //m_commsIPListenAddr = simIp; |
136 | m_commsIPListenPort = simPort; | 164 | //m_commsIPListenPort = simPort; |
137 | m_commsExternalAddress = simUri; | 165 | //m_commsExternalAddress = simUri; |
166 | |||
167 | m_internalEndPoint = internalEndPoint; | ||
168 | m_externalHostName = externalUri; | ||
138 | } | 169 | } |
139 | 170 | ||
140 | public void InitConfig(bool sandboxMode, IGenericConfig configData) | 171 | public void InitConfig(bool sandboxMode, IGenericConfig configData) |
@@ -195,7 +226,7 @@ namespace OpenSim.Framework.Types | |||
195 | } | 226 | } |
196 | 227 | ||
197 | m_regionHandle = null; | 228 | m_regionHandle = null; |
198 | 229 | ||
199 | // Local storage datastore | 230 | // Local storage datastore |
200 | attri = ""; | 231 | attri = ""; |
201 | attri = configData.GetAttribute("Datastore"); | 232 | attri = configData.GetAttribute("Datastore"); |
@@ -210,71 +241,67 @@ namespace OpenSim.Framework.Types | |||
210 | this.DataStore = attri; | 241 | this.DataStore = attri; |
211 | } | 242 | } |
212 | 243 | ||
213 | //Sim Listen Port | 244 | IPAddress internalAddress = GetIPAddress(configData, "InternalIPAddress", "0.0.0.0", "Internal IP Address for UDP client connections"); |
214 | attri = ""; | 245 | int internalPort = GetIPPort(configData, "InternalIPPort", "9000", "Internal IP Port for UDP client connections"); |
215 | attri = configData.GetAttribute("SimListenPort"); | 246 | m_internalEndPoint = new IPEndPoint(internalAddress, internalPort); |
216 | if (attri == "") | 247 | |
217 | { | 248 | m_externalHostName = MainLog.Instance.CmdPrompt("External Host Name", "localhost"); |
218 | string port = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("UDP port for client connections", "9000"); | 249 | |
219 | configData.SetAttribute("SimListenPort", port); | 250 | |
220 | m_commsIPListenPort = Convert.ToInt32(port); | 251 | |
221 | } | 252 | |
222 | else | ||
223 | { | ||
224 | m_commsIPListenPort = Convert.ToInt32(attri); | ||
225 | } | ||
226 | 253 | ||
227 | //Sim Listen Address | 254 | //Sim Listen Address |
228 | attri = ""; | 255 | //attri = ""; |
229 | attri = configData.GetAttribute("SimListenAddress"); | 256 | //attri = configData.GetAttribute("SimListenAddress"); |
230 | if (attri == "") | 257 | //if (attri == "") |
231 | { | 258 | //{ |
232 | m_commsIPListenAddr = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("IP Address to listen on for client connections", "0.0.0.0"); | 259 | // m_commsIPListenAddr = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("IP Address to listen on for client connections", "0.0.0.0"); |
233 | configData.SetAttribute("SimListenAddress", CommsIPListenAddr ); | 260 | // configData.SetAttribute("SimListenAddress", CommsIPListenAddr); |
234 | } | 261 | //} |
235 | else | 262 | //else |
236 | { | 263 | //{ |
237 | // Probably belongs elsewhere, but oh well. | 264 | // // Probably belongs elsewhere, but oh well. |
238 | if (attri.Trim().StartsWith("SYSTEMIP")) | 265 | // if (attri.Trim().StartsWith("SYSTEMIP")) |
239 | { | 266 | // { |
240 | string localhostname = System.Net.Dns.GetHostName(); | 267 | // string localhostname = System.Net.Dns.GetHostName(); |
241 | System.Net.IPAddress[] ips = System.Net.Dns.GetHostAddresses(localhostname); | 268 | // System.Net.IPAddress[] ips = System.Net.Dns.GetHostAddresses(localhostname); |
242 | try | 269 | // try |
243 | { | 270 | // { |
244 | m_commsIPListenAddr = "0.0.0.0"; // Incase a IPv4 address isnt found | 271 | // m_commsIPListenAddr = "0.0.0.0"; // Incase a IPv4 address isnt found |
245 | |||
246 | foreach (System.Net.IPAddress ip in ips) | ||
247 | { | ||
248 | if (ip.AddressFamily.ToString() == System.Net.Sockets.ProtocolFamily.InterNetwork.ToString()) | ||
249 | { | ||
250 | m_commsIPListenAddr = ip.ToString(); | ||
251 | break; | ||
252 | } | ||
253 | } | ||
254 | } | ||
255 | catch (Exception) | ||
256 | { | ||
257 | m_commsIPListenAddr = "0.0.0.0"; // Use the default if we fail | ||
258 | } | ||
259 | } | ||
260 | else | ||
261 | { | ||
262 | m_commsIPListenAddr = attri; | ||
263 | } | ||
264 | } | ||
265 | 272 | ||
266 | // Sim External Address | 273 | // foreach (System.Net.IPAddress ip in ips) |
267 | attri = ""; | 274 | // { |
268 | attri = configData.GetAttribute("SimExternalAddress"); | 275 | // if (ip.AddressFamily.ToString() == System.Net.Sockets.ProtocolFamily.InterNetwork.ToString()) |
269 | if (attri == "") | 276 | // { |
270 | { | 277 | // m_commsIPListenAddr = ip.ToString(); |
271 | m_commsExternalAddress = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("IP or DNS address to send external clients to", "localhost"); | 278 | // break; |
272 | configData.SetAttribute("SimExternalAddress", CommsExternalAddress); | 279 | // } |
273 | } | 280 | // } |
274 | else | 281 | // } |
275 | { | 282 | // catch (Exception) |
276 | m_commsExternalAddress = attri; | 283 | // { |
277 | } | 284 | // m_commsIPListenAddr = "0.0.0.0"; // Use the default if we fail |
285 | // } | ||
286 | // } | ||
287 | // else | ||
288 | // { | ||
289 | // m_commsIPListenAddr = attri; | ||
290 | // } | ||
291 | //} | ||
292 | |||
293 | //// Sim External Address | ||
294 | //attri = ""; | ||
295 | //attri = configData.GetAttribute("SimExternalAddress"); | ||
296 | //if (attri == "") | ||
297 | //{ | ||
298 | // m_commsExternalAddress = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("IP or DNS address to send external clients to", "localhost"); | ||
299 | // configData.SetAttribute("SimExternalAddress", CommsExternalAddress); | ||
300 | //} | ||
301 | //else | ||
302 | //{ | ||
303 | // m_commsExternalAddress = attri; | ||
304 | //} | ||
278 | 305 | ||
279 | attri = ""; | 306 | attri = ""; |
280 | attri = configData.GetAttribute("TerrainFile"); | 307 | attri = configData.GetAttribute("TerrainFile"); |
@@ -357,9 +384,38 @@ namespace OpenSim.Framework.Types | |||
357 | OpenSim.Framework.Console.MainLog.Instance.Verbose("Name: " + this.RegionName); | 384 | OpenSim.Framework.Console.MainLog.Instance.Verbose("Name: " + this.RegionName); |
358 | OpenSim.Framework.Console.MainLog.Instance.Verbose("Region Location: [" + this.RegionLocX.ToString() + "," + this.RegionLocY + "]"); | 385 | OpenSim.Framework.Console.MainLog.Instance.Verbose("Region Location: [" + this.RegionLocX.ToString() + "," + this.RegionLocY + "]"); |
359 | OpenSim.Framework.Console.MainLog.Instance.Verbose("Region Handle: " + this.RegionHandle.ToString()); | 386 | OpenSim.Framework.Console.MainLog.Instance.Verbose("Region Handle: " + this.RegionHandle.ToString()); |
360 | OpenSim.Framework.Console.MainLog.Instance.Verbose("Listening on IP: " + this.CommsIPListenAddr + ":" + this.CommsIPListenPort); | 387 | OpenSim.Framework.Console.MainLog.Instance.Verbose("Listening on IP end point: " + m_internalEndPoint.ToString() ); |
361 | OpenSim.Framework.Console.MainLog.Instance.Verbose("Sandbox Mode? " + isSandbox.ToString()); | 388 | OpenSim.Framework.Console.MainLog.Instance.Verbose("Sandbox Mode? " + isSandbox.ToString()); |
362 | 389 | ||
363 | } | 390 | } |
391 | |||
392 | private IPAddress GetIPAddress(IGenericConfig configData, string attrName, string defaultvalue, string prompt) | ||
393 | { | ||
394 | string addressStr = configData.GetAttribute(attrName); | ||
395 | |||
396 | IPAddress address; | ||
397 | |||
398 | if (!IPAddress.TryParse(addressStr, out address)) | ||
399 | { | ||
400 | address = MainLog.Instance.CmdPromptIPAddress(prompt, defaultvalue); | ||
401 | configData.SetAttribute(attrName, address.ToString()); | ||
402 | } | ||
403 | return address; | ||
404 | } | ||
405 | |||
406 | private int GetIPPort(IGenericConfig configData, string attrName, string defaultvalue, string prompt) | ||
407 | { | ||
408 | string portStr = configData.GetAttribute(attrName); | ||
409 | |||
410 | int port; | ||
411 | |||
412 | if (!int.TryParse(portStr, out port)) | ||
413 | { | ||
414 | port = MainLog.Instance.CmdPromptIPPort(prompt, defaultvalue); | ||
415 | configData.SetAttribute(attrName, port.ToString()); | ||
416 | } | ||
417 | |||
418 | return port; | ||
419 | } | ||
364 | } | 420 | } |
365 | } | 421 | } |
diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs index fcb2493..32faed8 100644 --- a/OpenSim/Region/Application/OpenSimMain.cs +++ b/OpenSim/Region/Application/OpenSimMain.cs | |||
@@ -225,7 +225,7 @@ namespace OpenSim | |||
225 | regionDat.InitConfig(this.m_sandbox, regionConfig); | 225 | regionDat.InitConfig(this.m_sandbox, regionConfig); |
226 | regionConfig.Close(); | 226 | regionConfig.Close(); |
227 | 227 | ||
228 | udpServer = new UDPServer(regionDat.CommsIPListenPort, this.AssetCache, this.InventoryCache, this.m_log, authenBase); | 228 | udpServer = new UDPServer(regionDat.InternalEndPoint.Port, this.AssetCache, this.InventoryCache, this.m_log, authenBase); |
229 | 229 | ||
230 | m_udpServer.Add(udpServer); | 230 | m_udpServer.Add(udpServer); |
231 | this.regionData.Add(regionDat); | 231 | this.regionData.Add(regionDat); |
diff --git a/OpenSim/Region/Capabilities/Caps.cs b/OpenSim/Region/Capabilities/Caps.cs index 416a6bc..2bbf656 100644 --- a/OpenSim/Region/Capabilities/Caps.cs +++ b/OpenSim/Region/Capabilities/Caps.cs | |||
@@ -44,8 +44,8 @@ namespace OpenSim.Region.Capabilities | |||
44 | 44 | ||
45 | public class Caps | 45 | public class Caps |
46 | { | 46 | { |
47 | private string httpListenerAddress; | 47 | private string httpListenerHostName; |
48 | private uint httpListenPort; | 48 | private int httpListenPort; |
49 | private string capsObjectPath = "00001-"; | 49 | private string capsObjectPath = "00001-"; |
50 | private string requestPath = "0000/"; | 50 | private string requestPath = "0000/"; |
51 | private string mapLayerPath = "0001/"; | 51 | private string mapLayerPath = "0001/"; |
@@ -58,12 +58,12 @@ namespace OpenSim.Region.Capabilities | |||
58 | private int eventQueueCount = 1; | 58 | private int eventQueueCount = 1; |
59 | private Queue<string> CapsEventQueue = new Queue<string>(); | 59 | private Queue<string> CapsEventQueue = new Queue<string>(); |
60 | 60 | ||
61 | public Caps(AssetCache assetCach, BaseHttpServer httpServer, string httpListen, uint httpPort, string capsPath, LLUUID agent) | 61 | public Caps(AssetCache assetCach, BaseHttpServer httpServer, string httpListen, int httpPort, string capsPath, LLUUID agent) |
62 | { | 62 | { |
63 | assetCache = assetCach; | 63 | assetCache = assetCach; |
64 | capsObjectPath = capsPath; | 64 | capsObjectPath = capsPath; |
65 | httpListener = httpServer; | 65 | httpListener = httpServer; |
66 | httpListenerAddress = httpListen; | 66 | httpListenerHostName = httpListen; |
67 | httpListenPort = httpPort; | 67 | httpListenPort = httpPort; |
68 | agentID = agent; | 68 | agentID = agent; |
69 | } | 69 | } |
@@ -109,8 +109,11 @@ namespace OpenSim.Region.Capabilities | |||
109 | return capURLS;*/ | 109 | return capURLS;*/ |
110 | 110 | ||
111 | LLSDCapsDetails caps = new LLSDCapsDetails(); | 111 | LLSDCapsDetails caps = new LLSDCapsDetails(); |
112 | caps.MapLayer = "http://" + httpListenerAddress + ":" + httpListenPort.ToString() + "/CAPS/" + capsObjectPath + mapLayerPath; | 112 | string capsBaseUrl = "http://" + httpListenerHostName + ":" + httpListenPort.ToString() + "/CAPS/" + capsObjectPath; |
113 | caps.NewFileAgentInventory = "http://" + httpListenerAddress + ":" + httpListenPort.ToString() + "/CAPS/" + capsObjectPath + newInventory; | 113 | |
114 | caps.MapLayer = capsBaseUrl + mapLayerPath; | ||
115 | caps.NewFileAgentInventory = capsBaseUrl + newInventory; | ||
116 | |||
114 | return caps; | 117 | return caps; |
115 | } | 118 | } |
116 | 119 | ||
@@ -206,7 +209,7 @@ namespace OpenSim.Region.Capabilities | |||
206 | string uploaderPath = capsObjectPath + Util.RandomClass.Next(5000, 8000).ToString("0000"); | 209 | string uploaderPath = capsObjectPath + Util.RandomClass.Next(5000, 8000).ToString("0000"); |
207 | AssetUploader uploader = new AssetUploader(newAsset, newInvItem, uploaderPath, this.httpListener); | 210 | AssetUploader uploader = new AssetUploader(newAsset, newInvItem, uploaderPath, this.httpListener); |
208 | httpListener.AddRestHandler("POST", "/CAPS/" + uploaderPath, uploader.uploaderCaps); | 211 | httpListener.AddRestHandler("POST", "/CAPS/" + uploaderPath, uploader.uploaderCaps); |
209 | string uploaderURL = "http://" + httpListenerAddress + ":" + httpListenPort.ToString() + "/CAPS/" + uploaderPath; | 212 | string uploaderURL = "http://" + httpListenerHostName + ":" + httpListenPort.ToString() + "/CAPS/" + uploaderPath; |
210 | //Console.WriteLine("uploader url is " + uploaderURL); | 213 | //Console.WriteLine("uploader url is " + uploaderURL); |
211 | res += "<llsd><map>"; | 214 | res += "<llsd><map>"; |
212 | res += "<key>uploader</key><string>" + uploaderURL + "</string>"; | 215 | res += "<key>uploader</key><string>" + uploaderURL + "</string>"; |
diff --git a/OpenSim/Region/ClientStack/ClientView.API.cs b/OpenSim/Region/ClientStack/ClientView.API.cs index 9650b42..e683db2 100644 --- a/OpenSim/Region/ClientStack/ClientView.API.cs +++ b/OpenSim/Region/ClientStack/ClientView.API.cs | |||
@@ -34,6 +34,7 @@ using OpenSim.Framework.Types; | |||
34 | 34 | ||
35 | using libsecondlife; | 35 | using libsecondlife; |
36 | using libsecondlife.Packets; | 36 | using libsecondlife.Packets; |
37 | using System.Net; | ||
37 | 38 | ||
38 | namespace OpenSim.Region.ClientStack | 39 | namespace OpenSim.Region.ClientStack |
39 | { | 40 | { |
@@ -293,8 +294,11 @@ namespace OpenSim.Region.ClientStack | |||
293 | /// <param name="neighbourHandle"></param> | 294 | /// <param name="neighbourHandle"></param> |
294 | /// <param name="neighbourIP"></param> | 295 | /// <param name="neighbourIP"></param> |
295 | /// <param name="neighbourPort"></param> | 296 | /// <param name="neighbourPort"></param> |
296 | public void InformClientOfNeighbour(ulong neighbourHandle, System.Net.IPAddress neighbourIP, ushort neighbourPort) | 297 | public void InformClientOfNeighbour(ulong neighbourHandle, IPEndPoint neighbourEndPoint ) |
297 | { | 298 | { |
299 | System.Net.IPAddress neighbourIP = neighbourEndPoint.Address; | ||
300 | ushort neighbourPort = (ushort) neighbourEndPoint.Port; | ||
301 | |||
298 | EnableSimulatorPacket enablesimpacket = new EnableSimulatorPacket(); | 302 | EnableSimulatorPacket enablesimpacket = new EnableSimulatorPacket(); |
299 | enablesimpacket.SimulatorInfo = new EnableSimulatorPacket.SimulatorInfoBlock(); | 303 | enablesimpacket.SimulatorInfo = new EnableSimulatorPacket.SimulatorInfoBlock(); |
300 | enablesimpacket.SimulatorInfo.Handle = neighbourHandle; | 304 | enablesimpacket.SimulatorInfo.Handle = neighbourHandle; |
@@ -326,7 +330,7 @@ namespace OpenSim.Region.ClientStack | |||
326 | return agentData; | 330 | return agentData; |
327 | } | 331 | } |
328 | 332 | ||
329 | public void CrossRegion(ulong newRegionHandle, LLVector3 pos, LLVector3 lookAt, System.Net.IPAddress newRegionIP, ushort newRegionPort) | 333 | public void CrossRegion(ulong newRegionHandle, LLVector3 pos, LLVector3 lookAt, IPEndPoint externalIPEndPoint) |
330 | { | 334 | { |
331 | LLVector3 look = new LLVector3(lookAt.X * 10, lookAt.Y * 10, lookAt.Z * 10); | 335 | LLVector3 look = new LLVector3(lookAt.X * 10, lookAt.Y * 10, lookAt.Z * 10); |
332 | 336 | ||
@@ -339,12 +343,12 @@ namespace OpenSim.Region.ClientStack | |||
339 | newSimPack.Info.LookAt = look; // new LLVector3(0.0f, 0.0f, 0.0f); // copied from Avatar.cs - SHOULD BE DYNAMIC!!!!!!!!!! | 343 | newSimPack.Info.LookAt = look; // new LLVector3(0.0f, 0.0f, 0.0f); // copied from Avatar.cs - SHOULD BE DYNAMIC!!!!!!!!!! |
340 | newSimPack.RegionData = new libsecondlife.Packets.CrossedRegionPacket.RegionDataBlock(); | 344 | newSimPack.RegionData = new libsecondlife.Packets.CrossedRegionPacket.RegionDataBlock(); |
341 | newSimPack.RegionData.RegionHandle = newRegionHandle; | 345 | newSimPack.RegionData.RegionHandle = newRegionHandle; |
342 | byte[] byteIP = newRegionIP.GetAddressBytes(); | 346 | byte[] byteIP = externalIPEndPoint.Address.GetAddressBytes(); |
343 | newSimPack.RegionData.SimIP = (uint)byteIP[3] << 24; | 347 | newSimPack.RegionData.SimIP = (uint)byteIP[3] << 24; |
344 | newSimPack.RegionData.SimIP += (uint)byteIP[2] << 16; | 348 | newSimPack.RegionData.SimIP += (uint)byteIP[2] << 16; |
345 | newSimPack.RegionData.SimIP += (uint)byteIP[1] << 8; | 349 | newSimPack.RegionData.SimIP += (uint)byteIP[1] << 8; |
346 | newSimPack.RegionData.SimIP += (uint)byteIP[0]; | 350 | newSimPack.RegionData.SimIP += (uint)byteIP[0]; |
347 | newSimPack.RegionData.SimPort = newRegionPort; | 351 | newSimPack.RegionData.SimPort = (ushort)externalIPEndPoint.Port; |
348 | newSimPack.RegionData.SeedCapability = new byte[0]; | 352 | newSimPack.RegionData.SeedCapability = new byte[0]; |
349 | 353 | ||
350 | this.OutPacket(newSimPack); | 354 | this.OutPacket(newSimPack); |
@@ -386,7 +390,7 @@ namespace OpenSim.Region.ClientStack | |||
386 | OutPacket(tpLocal); | 390 | OutPacket(tpLocal); |
387 | } | 391 | } |
388 | 392 | ||
389 | public void SendRegionTeleport(ulong regionHandle, byte simAccess, string ipAddress, ushort ipPort, uint locationID, uint flags) | 393 | public void SendRegionTeleport(ulong regionHandle, byte simAccess, IPEndPoint newRegionEndPoint, uint locationID, uint flags) |
390 | { | 394 | { |
391 | TeleportFinishPacket teleport = new TeleportFinishPacket(); | 395 | TeleportFinishPacket teleport = new TeleportFinishPacket(); |
392 | teleport.Info.AgentID = this.AgentID; | 396 | teleport.Info.AgentID = this.AgentID; |
@@ -394,7 +398,7 @@ namespace OpenSim.Region.ClientStack | |||
394 | teleport.Info.SimAccess = simAccess; | 398 | teleport.Info.SimAccess = simAccess; |
395 | teleport.Info.SeedCapability = new byte[0]; | 399 | teleport.Info.SeedCapability = new byte[0]; |
396 | 400 | ||
397 | System.Net.IPAddress oIP = System.Net.IPAddress.Parse(ipAddress); | 401 | IPAddress oIP = newRegionEndPoint.Address; |
398 | byte[] byteIP = oIP.GetAddressBytes(); | 402 | byte[] byteIP = oIP.GetAddressBytes(); |
399 | uint ip = (uint)byteIP[3] << 24; | 403 | uint ip = (uint)byteIP[3] << 24; |
400 | ip += (uint)byteIP[2] << 16; | 404 | ip += (uint)byteIP[2] << 16; |
@@ -402,7 +406,7 @@ namespace OpenSim.Region.ClientStack | |||
402 | ip += (uint)byteIP[0]; | 406 | ip += (uint)byteIP[0]; |
403 | 407 | ||
404 | teleport.Info.SimIP = ip; | 408 | teleport.Info.SimIP = ip; |
405 | teleport.Info.SimPort = ipPort; | 409 | teleport.Info.SimPort = (ushort)newRegionEndPoint.Port; |
406 | teleport.Info.LocationID = 4; | 410 | teleport.Info.LocationID = 4; |
407 | teleport.Info.TeleportFlags = 1 << 4; | 411 | teleport.Info.TeleportFlags = 1 << 4; |
408 | OutPacket(teleport); | 412 | OutPacket(teleport); |
diff --git a/OpenSim/Region/ClientStack/PacketServer.cs b/OpenSim/Region/ClientStack/PacketServer.cs index ffd254e..6f20413 100644 --- a/OpenSim/Region/ClientStack/PacketServer.cs +++ b/OpenSim/Region/ClientStack/PacketServer.cs | |||
@@ -44,12 +44,10 @@ namespace OpenSim.Region.ClientStack | |||
44 | private IWorld _localWorld; | 44 | private IWorld _localWorld; |
45 | public Dictionary<uint, ClientView> ClientThreads = new Dictionary<uint, ClientView>(); | 45 | public Dictionary<uint, ClientView> ClientThreads = new Dictionary<uint, ClientView>(); |
46 | public Dictionary<uint, IClientAPI> ClientAPIs = new Dictionary<uint, IClientAPI>(); | 46 | public Dictionary<uint, IClientAPI> ClientAPIs = new Dictionary<uint, IClientAPI>(); |
47 | protected uint serverPort; | ||
48 | 47 | ||
49 | public PacketServer(ClientStackNetworkHandler networkHandler, uint port) | 48 | public PacketServer(ClientStackNetworkHandler networkHandler) |
50 | { | 49 | { |
51 | _networkHandler = networkHandler; | 50 | _networkHandler = networkHandler; |
52 | this.serverPort = port; | ||
53 | _networkHandler.RegisterPacketServer(this); | 51 | _networkHandler.RegisterPacketServer(this); |
54 | } | 52 | } |
55 | 53 | ||
diff --git a/OpenSim/Region/ClientStack/UDPServer.cs b/OpenSim/Region/ClientStack/UDPServer.cs index b764519..8ad5332 100644 --- a/OpenSim/Region/ClientStack/UDPServer.cs +++ b/OpenSim/Region/ClientStack/UDPServer.cs | |||
@@ -107,7 +107,7 @@ namespace OpenSim.Region.ClientStack | |||
107 | 107 | ||
108 | protected virtual void CreatePacketServer() | 108 | protected virtual void CreatePacketServer() |
109 | { | 109 | { |
110 | PacketServer packetServer = new PacketServer(this, (uint) listenPort); | 110 | PacketServer packetServer = new PacketServer(this); |
111 | } | 111 | } |
112 | 112 | ||
113 | protected virtual void OnReceivedData(IAsyncResult result) | 113 | protected virtual void OnReceivedData(IAsyncResult result) |
diff --git a/OpenSim/Region/Communications/Local/LocalUserServices.cs b/OpenSim/Region/Communications/Local/LocalUserServices.cs index 5a2a5c8..db9d9b9 100644 --- a/OpenSim/Region/Communications/Local/LocalUserServices.cs +++ b/OpenSim/Region/Communications/Local/LocalUserServices.cs | |||
@@ -88,11 +88,11 @@ namespace OpenSim.Region.Communications.Local | |||
88 | "'position':[r" + theUser.homeLocation.X.ToString() + ",r" + theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "], " + | 88 | "'position':[r" + theUser.homeLocation.X.ToString() + ",r" + theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "], " + |
89 | "'look_at':[r" + theUser.homeLocation.X.ToString() + ",r" + theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "]}"; | 89 | "'look_at':[r" + theUser.homeLocation.X.ToString() + ",r" + theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "]}"; |
90 | string capsPath = Util.GetRandomCapsPath(); | 90 | string capsPath = Util.GetRandomCapsPath(); |
91 | response.SimAddress = reg.CommsExternalAddress; | 91 | response.SimAddress = reg.ExternalEndPoint.Address.ToString(); |
92 | response.SimPort = (Int32)reg.CommsIPListenPort; | 92 | response.SimPort = (Int32)reg.ExternalEndPoint.Port; |
93 | response.RegionX = reg.RegionLocX ; | 93 | response.RegionX = reg.RegionLocX ; |
94 | response.RegionY = reg.RegionLocY ; | 94 | response.RegionY = reg.RegionLocY ; |
95 | response.SeedCapability = "http://" + reg.CommsIPListenAddr + ":" + "9000" + "/CAPS/" + capsPath + "0000/"; | 95 | response.SeedCapability = "http://" + reg.ExternalHostName + ":" + reg.ExternalEndPoint.Port.ToString() + "/CAPS/" + capsPath + "0000/"; |
96 | theUser.currentAgent.currentRegion = reg.SimUUID; | 96 | theUser.currentAgent.currentRegion = reg.SimUUID; |
97 | theUser.currentAgent.currentHandle = reg.RegionHandle; | 97 | theUser.currentAgent.currentHandle = reg.RegionHandle; |
98 | 98 | ||
diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs index 2ac7297..977b131 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs | |||
@@ -13,6 +13,7 @@ using OpenSim.Framework.Communications; | |||
13 | 13 | ||
14 | using Nwc.XmlRpc; | 14 | using Nwc.XmlRpc; |
15 | using libsecondlife; | 15 | using libsecondlife; |
16 | using System.Net; | ||
16 | 17 | ||
17 | namespace OpenSim.Region.Communications.OGS1 | 18 | namespace OpenSim.Region.Communications.OGS1 |
18 | { | 19 | { |
@@ -32,13 +33,15 @@ namespace OpenSim.Region.Communications.OGS1 | |||
32 | // Login / Authentication | 33 | // Login / Authentication |
33 | GridParams["authkey"] = gridInfo.GridServerSendKey; | 34 | GridParams["authkey"] = gridInfo.GridServerSendKey; |
34 | GridParams["UUID"] = regionInfo.SimUUID.ToStringHyphenated(); | 35 | GridParams["UUID"] = regionInfo.SimUUID.ToStringHyphenated(); |
35 | GridParams["sim_ip"] = regionInfo.CommsExternalAddress; | 36 | GridParams["sim_ip"] = regionInfo.InternalEndPoint.Address.ToString(); |
36 | GridParams["sim_port"] = regionInfo.CommsIPListenPort.ToString(); | 37 | GridParams["sim_port"] = regionInfo.InternalEndPoint.Port.ToString(); |
37 | 38 | ||
38 | // Package into an XMLRPC Request | 39 | // Package into an XMLRPC Request |
39 | ArrayList SendParams = new ArrayList(); | 40 | ArrayList SendParams = new ArrayList(); |
40 | SendParams.Add(GridParams); | 41 | SendParams.Add(GridParams); |
41 | 42 | ||
43 | |||
44 | |||
42 | // Send Request | 45 | // Send Request |
43 | XmlRpcRequest GridReq = new XmlRpcRequest("simulator_login", SendParams); | 46 | XmlRpcRequest GridReq = new XmlRpcRequest("simulator_login", SendParams); |
44 | XmlRpcResponse GridResp = GridReq.Send(gridInfo.GridServerURI, 3000); | 47 | XmlRpcResponse GridResp = GridReq.Send(gridInfo.GridServerURI, 3000); |
@@ -56,7 +59,7 @@ namespace OpenSim.Region.Communications.OGS1 | |||
56 | if (!this.listeners.ContainsKey(regionInfo.RegionHandle)) | 59 | if (!this.listeners.ContainsKey(regionInfo.RegionHandle)) |
57 | { | 60 | { |
58 | // initialised = true; | 61 | // initialised = true; |
59 | httpListener = new BaseHttpServer(regionInfo.CommsIPListenPort); | 62 | httpListener = new BaseHttpServer( regionInfo.InternalEndPoint.Port ); |
60 | httpListener.AddXmlRPCHandler("expect_user", this.ExpectUser); | 63 | httpListener.AddXmlRPCHandler("expect_user", this.ExpectUser); |
61 | httpListener.Start(); | 64 | httpListener.Start(); |
62 | } | 65 | } |
@@ -75,7 +78,14 @@ namespace OpenSim.Region.Communications.OGS1 | |||
75 | 78 | ||
76 | foreach (Hashtable n in (Hashtable)respData.Values) | 79 | foreach (Hashtable n in (Hashtable)respData.Values) |
77 | { | 80 | { |
78 | RegionInfo neighbour = new RegionInfo( (uint)n["x"], (uint)n["y"], (string)n["sim_ip"], (int)n["sim_port"], (string)n["sim_uri"] ); | 81 | string internalIpStr = (string)n["sim_ip"]; |
82 | int port = (int)n["sim_port"]; | ||
83 | string externalUri = (string)n["sim_uri"]; | ||
84 | |||
85 | IPEndPoint neighbourInternalEndPoint = new IPEndPoint( IPAddress.Parse( internalIpStr ), port); | ||
86 | string neighbourExternalUri = externalUri; | ||
87 | |||
88 | RegionInfo neighbour = new RegionInfo((uint)n["x"], (uint)n["y"], neighbourInternalEndPoint, neighbourExternalUri ); | ||
79 | 89 | ||
80 | //OGS1 | 90 | //OGS1 |
81 | //neighbour.RegionHandle = (ulong)n["regionhandle"]; is now calculated locally | 91 | //neighbour.RegionHandle = (ulong)n["regionhandle"]; is now calculated locally |
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index d5406b6..dbf385d 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -656,7 +656,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
656 | if (agent.CapsPath != "") | 656 | if (agent.CapsPath != "") |
657 | { | 657 | { |
658 | //Console.WriteLine("new user, so creating caps handler for it"); | 658 | //Console.WriteLine("new user, so creating caps handler for it"); |
659 | Caps cap = new Caps(this.assetCache, httpListener, this.m_regInfo.CommsIPListenAddr, 9000, agent.CapsPath, agent.AgentID); | 659 | Caps cap = new Caps(this.assetCache, httpListener, this.m_regInfo.ExternalHostName, this.m_regInfo.ExternalEndPoint.Port, agent.CapsPath, agent.AgentID); |
660 | cap.RegisterHandlers(); | 660 | cap.RegisterHandlers(); |
661 | this.capsHandlers.Add(agent.AgentID, cap); | 661 | this.capsHandlers.Add(agent.AgentID, cap); |
662 | } | 662 | } |
@@ -695,7 +695,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
695 | agent.startpos = new LLVector3(128, 128, 70); | 695 | agent.startpos = new LLVector3(128, 128, 70); |
696 | agent.child = true; | 696 | agent.child = true; |
697 | this.commsManager.InterRegion.InformRegionOfChildAgent(neighbours[i].RegionHandle, agent); | 697 | this.commsManager.InterRegion.InformRegionOfChildAgent(neighbours[i].RegionHandle, agent); |
698 | remoteClient.InformClientOfNeighbour(neighbours[i].RegionHandle, System.Net.IPAddress.Parse(neighbours[i].CommsIPListenAddr), (ushort)neighbours[i].CommsIPListenPort); | 698 | remoteClient.InformClientOfNeighbour(neighbours[i].RegionHandle, neighbours[i].ExternalEndPoint ); |
699 | //this.capsHandlers[remoteClient.AgentId].CreateEstablishAgentComms("", System.Net.IPAddress.Parse(neighbours[i].CommsIPListenAddr) + ":" + neighbours[i].CommsIPListenPort); | 699 | //this.capsHandlers[remoteClient.AgentId].CreateEstablishAgentComms("", System.Net.IPAddress.Parse(neighbours[i].CommsIPListenAddr) + ":" + neighbours[i].CommsIPListenPort); |
700 | } | 700 | } |
701 | } | 701 | } |
@@ -757,7 +757,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
757 | agent.child = true; | 757 | agent.child = true; |
758 | this.commsManager.InterRegion.InformRegionOfChildAgent(regionHandle, agent); | 758 | this.commsManager.InterRegion.InformRegionOfChildAgent(regionHandle, agent); |
759 | this.commsManager.InterRegion.ExpectAvatarCrossing(regionHandle, remoteClient.AgentId, position); | 759 | this.commsManager.InterRegion.ExpectAvatarCrossing(regionHandle, remoteClient.AgentId, position); |
760 | remoteClient.SendRegionTeleport(regionHandle, 13, reg.CommsIPListenAddr, (ushort)reg.CommsIPListenPort, 4, (1 << 4)); | 760 | remoteClient.SendRegionTeleport(regionHandle, 13, reg.ExternalEndPoint, 4, (1 << 4)); |
761 | } | 761 | } |
762 | //remoteClient.SendTeleportCancel(); | 762 | //remoteClient.SendTeleportCancel(); |
763 | } | 763 | } |
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index b90004e..8a8f5ae 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs | |||
@@ -481,7 +481,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
481 | if (res) | 481 | if (res) |
482 | { | 482 | { |
483 | this.MakeChildAgent(); | 483 | this.MakeChildAgent(); |
484 | this.ControllingClient.CrossRegion(neighbourHandle, newpos, vel, System.Net.IPAddress.Parse(neighbourRegion.CommsIPListenAddr), (ushort)neighbourRegion.CommsIPListenPort); | 484 | this.ControllingClient.CrossRegion(neighbourHandle, newpos, vel, neighbourRegion.InternalEndPoint ); |
485 | } | 485 | } |
486 | } | 486 | } |
487 | } | 487 | } |
diff --git a/OpenSim/Region/Examples/SimpleApp/Program.cs b/OpenSim/Region/Examples/SimpleApp/Program.cs index 0d5b4b3..f5c6999 100644 --- a/OpenSim/Region/Examples/SimpleApp/Program.cs +++ b/OpenSim/Region/Examples/SimpleApp/Program.cs | |||
@@ -15,6 +15,7 @@ using OpenSim.Framework.Communications; | |||
15 | using OpenSim.Region.Communications.Local; | 15 | using OpenSim.Region.Communications.Local; |
16 | using OpenSim.Region.ClientStack; | 16 | using OpenSim.Region.ClientStack; |
17 | using OpenSim.Region.Physics.BasicPhysicsPlugin; | 17 | using OpenSim.Region.Physics.BasicPhysicsPlugin; |
18 | using System.Net; | ||
18 | 19 | ||
19 | namespace SimpleApp | 20 | namespace SimpleApp |
20 | { | 21 | { |
@@ -31,9 +32,8 @@ namespace SimpleApp | |||
31 | // CheckSumServer checksumServer = new CheckSumServer(12036); | 32 | // CheckSumServer checksumServer = new CheckSumServer(12036); |
32 | // checksumServer.ServerListener(); | 33 | // checksumServer.ServerListener(); |
33 | 34 | ||
34 | string simAddr = "127.0.0.1"; | 35 | IPEndPoint internalEndPoint = new IPEndPoint( IPAddress.Parse( "127.0.0.1" ), 9000 ); |
35 | int simPort = 9000; | 36 | |
36 | |||
37 | m_circuitManager = new AuthenticateSessionsBase(); | 37 | m_circuitManager = new AuthenticateSessionsBase(); |
38 | 38 | ||
39 | InventoryCache inventoryCache = new InventoryCache(); | 39 | InventoryCache inventoryCache = new InventoryCache(); |
@@ -44,8 +44,8 @@ namespace SimpleApp | |||
44 | 44 | ||
45 | AssetCache assetCache = new AssetCache(assetServer); | 45 | AssetCache assetCache = new AssetCache(assetServer); |
46 | 46 | ||
47 | UDPServer udpServer = new UDPServer(simPort, assetCache, inventoryCache, m_log, m_circuitManager ); | 47 | UDPServer udpServer = new UDPServer( internalEndPoint.Port, assetCache, inventoryCache, m_log, m_circuitManager ); |
48 | PacketServer packetServer = new PacketServer( udpServer, (uint) simPort ); | 48 | PacketServer packetServer = new PacketServer(udpServer); |
49 | udpServer.ServerListener(); | 49 | udpServer.ServerListener(); |
50 | 50 | ||
51 | ClientView.TerrainManager = new TerrainManager(new SecondLife()); | 51 | ClientView.TerrainManager = new TerrainManager(new SecondLife()); |
@@ -53,9 +53,9 @@ namespace SimpleApp | |||
53 | NetworkServersInfo serverInfo = new NetworkServersInfo(); | 53 | NetworkServersInfo serverInfo = new NetworkServersInfo(); |
54 | CommunicationsLocal communicationsManager = new CommunicationsLocal(serverInfo); | 54 | CommunicationsLocal communicationsManager = new CommunicationsLocal(serverInfo); |
55 | 55 | ||
56 | RegionInfo regionInfo = new RegionInfo( 1000, 1000, simAddr, simPort, simAddr ); | 56 | RegionInfo regionInfo = new RegionInfo( 1000, 1000, internalEndPoint, "localhost" ); |
57 | 57 | ||
58 | BaseHttpServer httpServer = new BaseHttpServer(simPort); | 58 | BaseHttpServer httpServer = new BaseHttpServer( internalEndPoint.Port ); |
59 | MyWorld world = new MyWorld(packetServer.ClientAPIs, regionInfo, m_circuitManager, communicationsManager, assetCache, httpServer); | 59 | MyWorld world = new MyWorld(packetServer.ClientAPIs, regionInfo, m_circuitManager, communicationsManager, assetCache, httpServer); |
60 | world.PhysScene = new BasicScene(); | 60 | world.PhysScene = new BasicScene(); |
61 | udpServer.LocalWorld = world; | 61 | udpServer.LocalWorld = world; |