aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Application/OpenSimMain.cs2
-rw-r--r--OpenSim/Region/Capabilities/Caps.cs17
-rw-r--r--OpenSim/Region/ClientStack/ClientView.API.cs18
-rw-r--r--OpenSim/Region/ClientStack/PacketServer.cs4
-rw-r--r--OpenSim/Region/ClientStack/UDPServer.cs2
-rw-r--r--OpenSim/Region/Communications/Local/LocalUserServices.cs6
-rw-r--r--OpenSim/Region/Communications/OGS1/OGS1GridServices.cs18
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs6
-rw-r--r--OpenSim/Region/Environment/Scenes/ScenePresence.cs2
-rw-r--r--OpenSim/Region/Examples/SimpleApp/Program.cs16
10 files changed, 53 insertions, 38 deletions
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
35using libsecondlife; 35using libsecondlife;
36using libsecondlife.Packets; 36using libsecondlife.Packets;
37using System.Net;
37 38
38namespace OpenSim.Region.ClientStack 39namespace 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
14using Nwc.XmlRpc; 14using Nwc.XmlRpc;
15using libsecondlife; 15using libsecondlife;
16using System.Net;
16 17
17namespace OpenSim.Region.Communications.OGS1 18namespace 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;
15using OpenSim.Region.Communications.Local; 15using OpenSim.Region.Communications.Local;
16using OpenSim.Region.ClientStack; 16using OpenSim.Region.ClientStack;
17using OpenSim.Region.Physics.BasicPhysicsPlugin; 17using OpenSim.Region.Physics.BasicPhysicsPlugin;
18using System.Net;
18 19
19namespace SimpleApp 20namespace 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;