From 5959e426834b49c9048b862506e9db50870ef867 Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Thu, 12 Feb 2009 18:59:45 +0000 Subject: large scale fix for svn props after "the great refactor" --- OpenSim/Data/IRegionProfileService.cs | 88 +++++++------- OpenSim/Data/RegionProfileServiceProxy.cs | 188 +++++++++++++++--------------- 2 files changed, 138 insertions(+), 138 deletions(-) (limited to 'OpenSim/Data') diff --git a/OpenSim/Data/IRegionProfileService.cs b/OpenSim/Data/IRegionProfileService.cs index 7c41f1a..525f909 100644 --- a/OpenSim/Data/IRegionProfileService.cs +++ b/OpenSim/Data/IRegionProfileService.cs @@ -1,44 +1,44 @@ -using System; -using System.Collections.Generic; -using System.Text; -using OpenMetaverse; - -namespace OpenSim.Data -{ - public interface IRegionProfileService - { - /// - /// Request sim profile information from a grid server, by Region UUID - /// - /// The region UUID to look for - /// - /// - /// - /// The sim profile. Null if there was a request failure - /// This method should be statics - RegionProfileData RequestSimProfileData(UUID regionId, Uri gridserverUrl, - string gridserverSendkey, string gridserverRecvkey); - - /// - /// Request sim profile information from a grid server, by Region Handle - /// - /// the region handle to look for - /// - /// - /// - /// The sim profile. Null if there was a request failure - RegionProfileData RequestSimProfileData(ulong regionHandle, Uri gridserverUrl, - string gridserverSendkey, string gridserverRecvkey); - - /// - /// Request sim profile information from a grid server, by Region Name - /// - /// the region name to look for - /// - /// - /// - /// The sim profile. Null if there was a request failure - RegionProfileData RequestSimProfileData(string regionName, Uri gridserverUrl, - string gridserverSendkey, string gridserverRecvkey); - } -} +using System; +using System.Collections.Generic; +using System.Text; +using OpenMetaverse; + +namespace OpenSim.Data +{ + public interface IRegionProfileService + { + /// + /// Request sim profile information from a grid server, by Region UUID + /// + /// The region UUID to look for + /// + /// + /// + /// The sim profile. Null if there was a request failure + /// This method should be statics + RegionProfileData RequestSimProfileData(UUID regionId, Uri gridserverUrl, + string gridserverSendkey, string gridserverRecvkey); + + /// + /// Request sim profile information from a grid server, by Region Handle + /// + /// the region handle to look for + /// + /// + /// + /// The sim profile. Null if there was a request failure + RegionProfileData RequestSimProfileData(ulong regionHandle, Uri gridserverUrl, + string gridserverSendkey, string gridserverRecvkey); + + /// + /// Request sim profile information from a grid server, by Region Name + /// + /// the region name to look for + /// + /// + /// + /// The sim profile. Null if there was a request failure + RegionProfileData RequestSimProfileData(string regionName, Uri gridserverUrl, + string gridserverSendkey, string gridserverRecvkey); + } +} diff --git a/OpenSim/Data/RegionProfileServiceProxy.cs b/OpenSim/Data/RegionProfileServiceProxy.cs index 998b4ef..be4d9c5 100644 --- a/OpenSim/Data/RegionProfileServiceProxy.cs +++ b/OpenSim/Data/RegionProfileServiceProxy.cs @@ -1,94 +1,94 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Text; -using Nwc.XmlRpc; -using OpenMetaverse; -using OpenSim.Framework; - -namespace OpenSim.Data -{ - public class RegionProfileServiceProxy : IRegionProfileService - { - /// - /// Request sim data based on arbitrary key/value - /// - private RegionProfileData RequestSimData(Uri gridserverUrl, string gridserverSendkey, string keyField, string keyValue) - { - Hashtable requestData = new Hashtable(); - requestData[keyField] = keyValue; - requestData["authkey"] = gridserverSendkey; - ArrayList SendParams = new ArrayList(); - SendParams.Add(requestData); - XmlRpcRequest GridReq = new XmlRpcRequest("simulator_data_request", SendParams); - XmlRpcResponse GridResp = GridReq.Send(gridserverUrl.ToString(), 3000); - - Hashtable responseData = (Hashtable) GridResp.Value; - - RegionProfileData simData = null; - - 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"]; - } - - return simData; - } - - /// - /// Request sim profile information from a grid server, by Region UUID - /// - /// The region UUID to look for - /// - /// - /// - /// The sim profile. Null if there was a request failure - /// This method should be statics - public RegionProfileData RequestSimProfileData(UUID regionId, Uri gridserverUrl, - string gridserverSendkey, string gridserverRecvkey) - { - return RequestSimData(gridserverUrl, gridserverSendkey, "region_UUID", regionId.Guid.ToString()); - } - - /// - /// Request sim profile information from a grid server, by Region Handle - /// - /// the region handle to look for - /// - /// - /// - /// The sim profile. Null if there was a request failure - public RegionProfileData RequestSimProfileData(ulong regionHandle, Uri gridserverUrl, - string gridserverSendkey, string gridserverRecvkey) - { - return RequestSimData(gridserverUrl, gridserverSendkey, "region_handle", regionHandle.ToString()); - } - - /// - /// Request sim profile information from a grid server, by Region Name - /// - /// the region name to look for - /// - /// - /// - /// The sim profile. Null if there was a request failure - public RegionProfileData RequestSimProfileData(string regionName, Uri gridserverUrl, - string gridserverSendkey, string gridserverRecvkey) - { - return RequestSimData(gridserverUrl, gridserverSendkey, "region_name_search", regionName ); - } - } -} +using System; +using System.Collections; +using System.Collections.Generic; +using System.Text; +using Nwc.XmlRpc; +using OpenMetaverse; +using OpenSim.Framework; + +namespace OpenSim.Data +{ + public class RegionProfileServiceProxy : IRegionProfileService + { + /// + /// Request sim data based on arbitrary key/value + /// + private RegionProfileData RequestSimData(Uri gridserverUrl, string gridserverSendkey, string keyField, string keyValue) + { + Hashtable requestData = new Hashtable(); + requestData[keyField] = keyValue; + requestData["authkey"] = gridserverSendkey; + ArrayList SendParams = new ArrayList(); + SendParams.Add(requestData); + XmlRpcRequest GridReq = new XmlRpcRequest("simulator_data_request", SendParams); + XmlRpcResponse GridResp = GridReq.Send(gridserverUrl.ToString(), 3000); + + Hashtable responseData = (Hashtable) GridResp.Value; + + RegionProfileData simData = null; + + 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"]; + } + + return simData; + } + + /// + /// Request sim profile information from a grid server, by Region UUID + /// + /// The region UUID to look for + /// + /// + /// + /// The sim profile. Null if there was a request failure + /// This method should be statics + public RegionProfileData RequestSimProfileData(UUID regionId, Uri gridserverUrl, + string gridserverSendkey, string gridserverRecvkey) + { + return RequestSimData(gridserverUrl, gridserverSendkey, "region_UUID", regionId.Guid.ToString()); + } + + /// + /// Request sim profile information from a grid server, by Region Handle + /// + /// the region handle to look for + /// + /// + /// + /// The sim profile. Null if there was a request failure + public RegionProfileData RequestSimProfileData(ulong regionHandle, Uri gridserverUrl, + string gridserverSendkey, string gridserverRecvkey) + { + return RequestSimData(gridserverUrl, gridserverSendkey, "region_handle", regionHandle.ToString()); + } + + /// + /// Request sim profile information from a grid server, by Region Name + /// + /// the region name to look for + /// + /// + /// + /// The sim profile. Null if there was a request failure + public RegionProfileData RequestSimProfileData(string regionName, Uri gridserverUrl, + string gridserverSendkey, string gridserverRecvkey) + { + return RequestSimData(gridserverUrl, gridserverSendkey, "region_name_search", regionName ); + } + } +} -- cgit v1.1