From 67e12b95ea7b68f4904a7484d77ecfd787d16d0c Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Tue, 30 Oct 2007 09:05:31 +0000 Subject: * Optimized usings * Shortened type references * Removed redundant 'this' qualifier --- OpenSim/Framework/Data/GridData.cs | 3 +- OpenSim/Framework/Data/ILogData.cs | 7 +-- OpenSim/Framework/Data/IniConfig.cs | 22 ++++---- OpenSim/Framework/Data/Properties/AssemblyInfo.cs | 31 ++++++----- OpenSim/Framework/Data/RegionProfileData.cs | 63 +++++++++++++---------- OpenSim/Framework/Data/ReservationData.cs | 4 +- 6 files changed, 73 insertions(+), 57 deletions(-) (limited to 'OpenSim/Framework/Data') diff --git a/OpenSim/Framework/Data/GridData.cs b/OpenSim/Framework/Data/GridData.cs index 2a5b8f6..b3b6ed7 100644 --- a/OpenSim/Framework/Data/GridData.cs +++ b/OpenSim/Framework/Data/GridData.cs @@ -106,6 +106,5 @@ namespace OpenSim.Framework.Data DataResponse AddProfile(RegionProfileData profile); ReservationData GetReservationAtPoint(uint x, uint y); - } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/Data/ILogData.cs b/OpenSim/Framework/Data/ILogData.cs index b222a28..373d8e1 100644 --- a/OpenSim/Framework/Data/ILogData.cs +++ b/OpenSim/Framework/Data/ILogData.cs @@ -63,7 +63,9 @@ namespace OpenSim.Framework.Data /// public interface ILogData { - void saveLog(string serverDaemon, string target, string methodCall, string arguments, int priority,string logMessage); + void saveLog(string serverDaemon, string target, string methodCall, string arguments, int priority, + string logMessage); + /// /// Initialises the interface /// @@ -86,5 +88,4 @@ namespace OpenSim.Framework.Data /// A string containing the plugin version string getVersion(); } - -} +} \ No newline at end of file diff --git a/OpenSim/Framework/Data/IniConfig.cs b/OpenSim/Framework/Data/IniConfig.cs index f0f63b4..048b491 100644 --- a/OpenSim/Framework/Data/IniConfig.cs +++ b/OpenSim/Framework/Data/IniConfig.cs @@ -27,6 +27,7 @@ */ using System.IO; using System.Text.RegularExpressions; + /* Taken from public code listing at by Alex Pinsker http://alexpinsker.blogspot.com/2005/12/reading-ini-file-from-c_113432097333021549.html @@ -52,7 +53,8 @@ namespace OpenSim.Framework.Data RegexOptions.Compiled | RegexOptions.CultureInvariant); } - static private Regex _iniKeyValuePatternRegex; + + private static Regex _iniKeyValuePatternRegex; public IniFile(string iniFileName) { @@ -62,7 +64,7 @@ namespace OpenSim.Framework.Data public string ParseFileReadValue(string key) { using (StreamReader reader = - new StreamReader(_iniFileName)) + new StreamReader(_iniFileName)) { do { @@ -72,18 +74,16 @@ namespace OpenSim.Framework.Data if (match.Success) { string currentKey = - match.Groups["Key"].Value as string; + match.Groups["Key"].Value as string; if (currentKey != null && - currentKey.Trim().CompareTo(key) == 0) + currentKey.Trim().CompareTo(key) == 0) { string value = - match.Groups["Value"].Value as string; + match.Groups["Value"].Value as string; return value; } } - - } - while (reader.Peek() != -1); + } while (reader.Peek() != -1); } return null; } @@ -91,6 +91,8 @@ namespace OpenSim.Framework.Data public string IniFileName { get { return _iniFileName; } - } private string _iniFileName; + } + + private string _iniFileName; } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/Data/Properties/AssemblyInfo.cs b/OpenSim/Framework/Data/Properties/AssemblyInfo.cs index 556d589..51050d1 100644 --- a/OpenSim/Framework/Data/Properties/AssemblyInfo.cs +++ b/OpenSim/Framework/Data/Properties/AssemblyInfo.cs @@ -1,24 +1,28 @@ -using System.Reflection; +using System.Reflection; using System.Runtime.InteropServices; + // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. -[assembly: AssemblyTitle("OpenSim.Framework.Data")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("OpenSim.Framework.Data")] -[assembly: AssemblyCopyright("Copyright © 2007")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] + +[assembly : AssemblyTitle("OpenSim.Framework.Data")] +[assembly : AssemblyDescription("")] +[assembly : AssemblyConfiguration("")] +[assembly : AssemblyCompany("")] +[assembly : AssemblyProduct("OpenSim.Framework.Data")] +[assembly : AssemblyCopyright("Copyright © 2007")] +[assembly : AssemblyTrademark("")] +[assembly : AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] + +[assembly : ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("3a711c34-b0c0-4264-b0fe-f366eabf9d7b")] + +[assembly : Guid("3a711c34-b0c0-4264-b0fe-f366eabf9d7b")] // Version information for an assembly consists of the following four values: // @@ -29,5 +33,6 @@ using System.Runtime.InteropServices; // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] + +[assembly : AssemblyVersion("1.0.0.0")] +[assembly : AssemblyFileVersion("1.0.0.0")] \ No newline at end of file diff --git a/OpenSim/Framework/Data/RegionProfileData.cs b/OpenSim/Framework/Data/RegionProfileData.cs index 5e5dac6..ab8771a 100644 --- a/OpenSim/Framework/Data/RegionProfileData.cs +++ b/OpenSim/Framework/Data/RegionProfileData.cs @@ -25,11 +25,11 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ -using libsecondlife; -using Nwc.XmlRpc; using System; using System.Collections; +using libsecondlife; +using Nwc.XmlRpc; namespace OpenSim.Framework.Data { @@ -57,6 +57,7 @@ namespace OpenSim.Framework.Data /// Coordinates of the region /// public uint regionLocX; + public uint regionLocY; public uint regionLocZ; // Reserved (round-robin, layers, etc) @@ -65,6 +66,7 @@ namespace OpenSim.Framework.Data /// /// Not very secure, needs improvement. public string regionSendKey = ""; + public string regionRecvKey = ""; public string regionSecret = ""; @@ -77,6 +79,7 @@ namespace OpenSim.Framework.Data /// Information about the server that the region is currently hosted on /// public string serverIP = ""; + public uint serverPort; public string serverURI = ""; @@ -88,6 +91,7 @@ namespace OpenSim.Framework.Data /// Set of optional overrides. Can be used to create non-eulicidean spaces. /// public ulong regionNorthOverrideHandle; + public ulong regionSouthOverrideHandle; public ulong regionEastOverrideHandle; public ulong regionWestOverrideHandle; @@ -102,6 +106,7 @@ namespace OpenSim.Framework.Data /// Region Asset Details /// public string regionAssetURI = ""; + public string regionAssetSendKey = ""; public string regionAssetRecvKey = ""; @@ -109,6 +114,7 @@ namespace OpenSim.Framework.Data /// Region Userserver Details /// public string regionUserURI = ""; + public string regionUserSendKey = ""; public string regionUserRecvKey = ""; @@ -124,7 +130,8 @@ namespace OpenSim.Framework.Data /// /// /// - public RegionProfileData RequestSimProfileData(LLUUID region_uuid, string gridserver_url, string gridserver_sendkey, string gridserver_recvkey) + public RegionProfileData RequestSimProfileData(LLUUID region_uuid, string gridserver_url, + string gridserver_sendkey, string gridserver_recvkey) { Hashtable requestData = new Hashtable(); requestData["region_uuid"] = region_uuid.UUID.ToString(); @@ -134,7 +141,7 @@ namespace OpenSim.Framework.Data XmlRpcRequest GridReq = new XmlRpcRequest("simulator_data_request", SendParams); XmlRpcResponse GridResp = GridReq.Send(gridserver_url, 3000); - Hashtable responseData = (Hashtable)GridResp.Value; + Hashtable responseData = (Hashtable) GridResp.Value; if (responseData.ContainsKey("error")) { @@ -142,21 +149,23 @@ namespace OpenSim.Framework.Data } RegionProfileData simData = new RegionProfileData(); - simData.regionLocX = Convert.ToUInt32((string)responseData["region_locx"]); - simData.regionLocY = Convert.ToUInt32((string)responseData["region_locy"]); - simData.regionHandle = Helpers.UIntsToLong((simData.regionLocX * 256), (simData.regionLocY * 256)); - 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.regionLocX = Convert.ToUInt32((string) responseData["region_locx"]); + simData.regionLocY = Convert.ToUInt32((string) responseData["region_locy"]); + simData.regionHandle = Helpers.UIntsToLong((simData.regionLocX*256), (simData.regionLocY*256)); + 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 = "http://" + simData.serverIP + ":" + simData.serverPort.ToString() + "/"; simData.httpServerURI = "http://" + simData.serverIP + ":" + simData.httpPort.ToString() + "/"; - simData.UUID = new LLUUID((string)responseData["region_UUID"]); - simData.regionName = (string)responseData["region_name"]; + simData.UUID = new LLUUID((string) responseData["region_UUID"]); + simData.regionName = (string) responseData["region_name"]; - return simData; + return simData; } - public RegionProfileData RequestSimProfileData(ulong region_handle, string gridserver_url, string gridserver_sendkey, string gridserver_recvkey) + + public RegionProfileData RequestSimProfileData(ulong region_handle, string gridserver_url, + string gridserver_sendkey, string gridserver_recvkey) { Hashtable requestData = new Hashtable(); requestData["region_handle"] = region_handle.ToString(); @@ -166,7 +175,7 @@ namespace OpenSim.Framework.Data XmlRpcRequest GridReq = new XmlRpcRequest("simulator_data_request", SendParams); XmlRpcResponse GridResp = GridReq.Send(gridserver_url, 3000); - Hashtable responseData = (Hashtable)GridResp.Value; + Hashtable responseData = (Hashtable) GridResp.Value; if (responseData.ContainsKey("error")) { @@ -174,19 +183,19 @@ namespace OpenSim.Framework.Data } RegionProfileData simData = new RegionProfileData(); - simData.regionLocX = Convert.ToUInt32((string)responseData["region_locx"]); - simData.regionLocY = Convert.ToUInt32((string)responseData["region_locy"]); - simData.regionHandle = Helpers.UIntsToLong((simData.regionLocX * 256), (simData.regionLocY * 256)); - 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.regionLocX = Convert.ToUInt32((string) responseData["region_locx"]); + simData.regionLocY = Convert.ToUInt32((string) responseData["region_locy"]); + simData.regionHandle = Helpers.UIntsToLong((simData.regionLocX*256), (simData.regionLocY*256)); + 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.httpServerURI = "http://" + simData.serverIP + ":" + simData.httpPort.ToString() + "/"; simData.serverURI = "http://" + simData.serverIP + ":" + simData.serverPort.ToString() + "/"; - simData.UUID = new LLUUID((string)responseData["region_UUID"]); - simData.regionName = (string)responseData["region_name"]; + simData.UUID = new LLUUID((string) responseData["region_UUID"]); + simData.regionName = (string) responseData["region_name"]; - return simData; + return simData; } } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/Data/ReservationData.cs b/OpenSim/Framework/Data/ReservationData.cs index 1e606ee..06adf04 100644 --- a/OpenSim/Framework/Data/ReservationData.cs +++ b/OpenSim/Framework/Data/ReservationData.cs @@ -36,7 +36,7 @@ namespace OpenSim.Framework.Data public int reservationMinY = 0; public int reservationMaxX = 65536; public int reservationMaxY = 65536; - + public string reservationName = ""; public string reservationCompany = ""; public bool status = true; @@ -44,4 +44,4 @@ namespace OpenSim.Framework.Data public string gridSendKey = ""; public string gridRecvKey = ""; } -} +} \ No newline at end of file -- cgit v1.1