* 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.
This commit is contained in:
lbsa71
2009-03-10 09:05:06 +00:00
parent 973ba9c9b7
commit 1b34b94331
4 changed files with 62 additions and 30 deletions

View File

@@ -675,5 +675,18 @@ namespace OpenSim.Framework
if (args["proxy_url"] != null)
proxyUrl = args["proxy_url"].AsString();
}
public static RegionInfo Create(UUID regionID, string regionName, uint regX, uint regY, string externalHostName, uint httpPort, uint simPort, uint remotingPort)
{
RegionInfo regionInfo;
IPEndPoint neighbourInternalEndPoint = new IPEndPoint(Util.GetHostFromDNS(externalHostName), (int)simPort);
regionInfo = new RegionInfo(regX, regY, neighbourInternalEndPoint, externalHostName);
regionInfo.RemotingPort = remotingPort;
regionInfo.RemotingAddress = externalHostName;
regionInfo.HttpPort = httpPort;
regionInfo.RegionID = regionID;
regionInfo.RegionName = regionName;
return regionInfo;
}
}
}