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. --- OpenSim/Data/RegionProfileServiceProxy.cs | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) (limited to 'OpenSim/Data/RegionProfileServiceProxy.cs') diff --git a/OpenSim/Data/RegionProfileServiceProxy.cs b/OpenSim/Data/RegionProfileServiceProxy.cs index 126e363..da71936 100644 --- a/OpenSim/Data/RegionProfileServiceProxy.cs +++ b/OpenSim/Data/RegionProfileServiceProxy.cs @@ -56,20 +56,17 @@ namespace OpenSim.Data if (!responseData.ContainsKey("error")) { - simData = new RegionProfileData(); - simData.regionLocX = Convert.ToUInt32((string) responseData["region_locx"]); - simData.regionLocY = Convert.ToUInt32((string) responseData["region_locy"]); - simData.regionHandle = - Utils.UIntsToLong((simData.regionLocX * Constants.RegionSize), - (simData.regionLocY*Constants.RegionSize)); - simData.serverIP = (string) responseData["sim_ip"]; - simData.serverPort = Convert.ToUInt32((string) responseData["sim_port"]); - simData.httpPort = Convert.ToUInt32((string) responseData["http_port"]); - simData.remotingPort = Convert.ToUInt32((string) responseData["remoting_port"]); - simData.serverURI = (string) responseData["server_uri"]; - simData.httpServerURI = "http://" + (string)responseData["sim_ip"] + ":" + simData.httpPort.ToString() + "/"; - simData.UUID = new UUID((string) responseData["region_UUID"]); - simData.regionName = (string) responseData["region_name"]; + uint locX = Convert.ToUInt32((string)responseData["region_locx"]); + uint locY = Convert.ToUInt32((string)responseData["region_locy"]); + string externalHostName = (string)responseData["sim_ip"]; + uint simPort = Convert.ToUInt32((string)responseData["sim_port"]); + uint httpPort = Convert.ToUInt32((string)responseData["http_port"]); + uint remotingPort = Convert.ToUInt32((string)responseData["remoting_port"]); + string serverUri = (string)responseData["server_uri"]; + UUID regionID = new UUID((string)responseData["region_UUID"]); + string regionName = (string)responseData["region_name"]; + + simData = RegionProfileData.Create(regionID, regionName, locX, locY, externalHostName, simPort, httpPort, remotingPort, serverUri); } return simData; -- cgit v1.1