From 1b34b94331ca810ed53669699abcff3a6a99de83 Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Tue, 10 Mar 2009 09:05:06 +0000 Subject: * Refactored out Create() methods to ensure proper transformation between RegionProfileData and RegionInfo * Created ToRegionInfo method, still not using it pending peer review. * This is a preparatory commit for a subsequent login service refactoring. --- .../Region/Communications/OGS1/OGS1GridServices.cs | 24 ++++++++++------------ 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'OpenSim/Region/Communications/OGS1') diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs index 5f00f15..1a72f31 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs @@ -405,24 +405,22 @@ namespace OpenSim.Region.Communications.OGS1 uint regX = Convert.ToUInt32((string) responseData["region_locx"]); uint regY = Convert.ToUInt32((string) responseData["region_locy"]); string externalHostName = (string) responseData["sim_ip"]; - uint port = Convert.ToUInt32(responseData["sim_port"]); - // string externalUri = (string) responseData["sim_uri"]; - - //IPEndPoint neighbourInternalEndPoint = new IPEndPoint(IPAddress.Parse(internalIpStr), (int) port); - IPEndPoint neighbourInternalEndPoint = new IPEndPoint(Util.GetHostFromDNS(externalHostName), (int)port); + uint simPort = Convert.ToUInt32(responseData["sim_port"]); + string regionName = (string)responseData["region_name"]; + UUID regionID = new UUID((string)responseData["region_UUID"]); + uint remotingPort = Convert.ToUInt32((string)responseData["remoting_port"]); - regionInfo = new RegionInfo(regX, regY, neighbourInternalEndPoint, externalHostName); - - regionInfo.RemotingPort = Convert.ToUInt32((string) responseData["remoting_port"]); - regionInfo.RemotingAddress = externalHostName; - + uint httpPort = 9000; if (responseData.ContainsKey("http_port")) { - regionInfo.HttpPort = Convert.ToUInt32((string) responseData["http_port"]); + httpPort = Convert.ToUInt32((string)responseData["http_port"]); } - regionInfo.RegionID = new UUID((string) responseData["region_UUID"]); - regionInfo.RegionName = (string) responseData["region_name"]; + + // string externalUri = (string) responseData["sim_uri"]; + + //IPEndPoint neighbourInternalEndPoint = new IPEndPoint(IPAddress.Parse(internalIpStr), (int) port); + regionInfo = RegionInfo.Create(regionID, regionName, regX, regY, externalHostName, httpPort, simPort, remotingPort); lock (m_remoteRegionInfoCache) { -- cgit v1.1