mirror of
https://github.com/opensim/opensim.git
synced 2026-08-04 16:22:50 +08:00
* Optimized usings
* Shortened type references * Removed redundant 'this' qualifier
This commit is contained in:
@@ -106,6 +106,5 @@ namespace OpenSim.Framework.Data
|
||||
DataResponse AddProfile(RegionProfileData profile);
|
||||
|
||||
ReservationData GetReservationAtPoint(uint x, uint y);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -63,7 +63,9 @@ namespace OpenSim.Framework.Data
|
||||
/// </summary>
|
||||
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);
|
||||
|
||||
/// <summary>
|
||||
/// Initialises the interface
|
||||
/// </summary>
|
||||
@@ -86,5 +88,4 @@ namespace OpenSim.Framework.Data
|
||||
/// <returns>A string containing the plugin version</returns>
|
||||
string getVersion();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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")]
|
||||
@@ -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
|
||||
/// </summary>
|
||||
public uint regionLocX;
|
||||
|
||||
public uint regionLocY;
|
||||
public uint regionLocZ; // Reserved (round-robin, layers, etc)
|
||||
|
||||
@@ -65,6 +66,7 @@ namespace OpenSim.Framework.Data
|
||||
/// </summary>
|
||||
/// <remarks>Not very secure, needs improvement.</remarks>
|
||||
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
|
||||
/// </summary>
|
||||
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.
|
||||
/// </summary>
|
||||
public ulong regionNorthOverrideHandle;
|
||||
|
||||
public ulong regionSouthOverrideHandle;
|
||||
public ulong regionEastOverrideHandle;
|
||||
public ulong regionWestOverrideHandle;
|
||||
@@ -102,6 +106,7 @@ namespace OpenSim.Framework.Data
|
||||
/// Region Asset Details
|
||||
/// </summary>
|
||||
public string regionAssetURI = "";
|
||||
|
||||
public string regionAssetSendKey = "";
|
||||
public string regionAssetRecvKey = "";
|
||||
|
||||
@@ -109,6 +114,7 @@ namespace OpenSim.Framework.Data
|
||||
/// Region Userserver Details
|
||||
/// </summary>
|
||||
public string regionUserURI = "";
|
||||
|
||||
public string regionUserSendKey = "";
|
||||
public string regionUserRecvKey = "";
|
||||
|
||||
@@ -124,7 +130,8 @@ namespace OpenSim.Framework.Data
|
||||
/// <param name="gridserver_url"></param>
|
||||
/// <param name="?"></param>
|
||||
/// <returns></returns>
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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 = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user