From 06a8c132005b4ab804f25d54c0c0f899fc98e3a1 Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Sun, 1 Jul 2007 16:07:41 +0000 Subject: MAJOR IP RESTRUCTURING * moving towards IPEndPoints all over the place * trying to make the internal/external division --- .../Region/Communications/Local/LocalUserServices.cs | 6 +++--- OpenSim/Region/Communications/OGS1/OGS1GridServices.cs | 18 ++++++++++++++---- 2 files changed, 17 insertions(+), 7 deletions(-) (limited to 'OpenSim/Region/Communications') 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 "'position':[r" + theUser.homeLocation.X.ToString() + ",r" + theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "], " + "'look_at':[r" + theUser.homeLocation.X.ToString() + ",r" + theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "]}"; string capsPath = Util.GetRandomCapsPath(); - response.SimAddress = reg.CommsExternalAddress; - response.SimPort = (Int32)reg.CommsIPListenPort; + response.SimAddress = reg.ExternalEndPoint.Address.ToString(); + response.SimPort = (Int32)reg.ExternalEndPoint.Port; response.RegionX = reg.RegionLocX ; response.RegionY = reg.RegionLocY ; - response.SeedCapability = "http://" + reg.CommsIPListenAddr + ":" + "9000" + "/CAPS/" + capsPath + "0000/"; + response.SeedCapability = "http://" + reg.ExternalHostName + ":" + reg.ExternalEndPoint.Port.ToString() + "/CAPS/" + capsPath + "0000/"; theUser.currentAgent.currentRegion = reg.SimUUID; theUser.currentAgent.currentHandle = reg.RegionHandle; 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; using Nwc.XmlRpc; using libsecondlife; +using System.Net; namespace OpenSim.Region.Communications.OGS1 { @@ -32,13 +33,15 @@ namespace OpenSim.Region.Communications.OGS1 // Login / Authentication GridParams["authkey"] = gridInfo.GridServerSendKey; GridParams["UUID"] = regionInfo.SimUUID.ToStringHyphenated(); - GridParams["sim_ip"] = regionInfo.CommsExternalAddress; - GridParams["sim_port"] = regionInfo.CommsIPListenPort.ToString(); + GridParams["sim_ip"] = regionInfo.InternalEndPoint.Address.ToString(); + GridParams["sim_port"] = regionInfo.InternalEndPoint.Port.ToString(); // Package into an XMLRPC Request ArrayList SendParams = new ArrayList(); SendParams.Add(GridParams); + + // Send Request XmlRpcRequest GridReq = new XmlRpcRequest("simulator_login", SendParams); XmlRpcResponse GridResp = GridReq.Send(gridInfo.GridServerURI, 3000); @@ -56,7 +59,7 @@ namespace OpenSim.Region.Communications.OGS1 if (!this.listeners.ContainsKey(regionInfo.RegionHandle)) { // initialised = true; - httpListener = new BaseHttpServer(regionInfo.CommsIPListenPort); + httpListener = new BaseHttpServer( regionInfo.InternalEndPoint.Port ); httpListener.AddXmlRPCHandler("expect_user", this.ExpectUser); httpListener.Start(); } @@ -75,7 +78,14 @@ namespace OpenSim.Region.Communications.OGS1 foreach (Hashtable n in (Hashtable)respData.Values) { - RegionInfo neighbour = new RegionInfo( (uint)n["x"], (uint)n["y"], (string)n["sim_ip"], (int)n["sim_port"], (string)n["sim_uri"] ); + string internalIpStr = (string)n["sim_ip"]; + int port = (int)n["sim_port"]; + string externalUri = (string)n["sim_uri"]; + + IPEndPoint neighbourInternalEndPoint = new IPEndPoint( IPAddress.Parse( internalIpStr ), port); + string neighbourExternalUri = externalUri; + + RegionInfo neighbour = new RegionInfo((uint)n["x"], (uint)n["y"], neighbourInternalEndPoint, neighbourExternalUri ); //OGS1 //neighbour.RegionHandle = (ulong)n["regionhandle"]; is now calculated locally -- cgit v1.1