mirror of
https://github.com/opensim/opensim.git
synced 2026-08-13 05:05:43 +08:00
Renamed SimProfileData to RegionProfileData
This commit is contained in:
@@ -56,7 +56,7 @@ namespace OpenSim.Framework.Data.DB4o
|
||||
/// <param name="c">maximum X coordinate</param>
|
||||
/// <param name="d">maximum Y coordinate</param>
|
||||
/// <returns>An array of region profiles</returns>
|
||||
public SimProfileData[] GetProfilesInRange(uint a, uint b, uint c, uint d)
|
||||
public RegionProfileData[] GetProfilesInRange(uint a, uint b, uint c, uint d)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
@@ -66,7 +66,8 @@ namespace OpenSim.Framework.Data.DB4o
|
||||
/// </summary>
|
||||
/// <param name="handle">The handle to search for</param>
|
||||
/// <returns>A region profile</returns>
|
||||
public SimProfileData GetProfileByHandle(ulong handle) {
|
||||
public RegionProfileData GetProfileByHandle(ulong handle)
|
||||
{
|
||||
lock (manager.simProfiles)
|
||||
{
|
||||
foreach (LLUUID UUID in manager.simProfiles.Keys)
|
||||
@@ -85,7 +86,7 @@ namespace OpenSim.Framework.Data.DB4o
|
||||
/// </summary>
|
||||
/// <param name="uuid">The region ID code</param>
|
||||
/// <returns>A region profile</returns>
|
||||
public SimProfileData GetProfileByLLUUID(LLUUID uuid)
|
||||
public RegionProfileData GetProfileByLLUUID(LLUUID uuid)
|
||||
{
|
||||
lock (manager.simProfiles)
|
||||
{
|
||||
@@ -100,7 +101,7 @@ namespace OpenSim.Framework.Data.DB4o
|
||||
/// </summary>
|
||||
/// <param name="profile">The profile to add</param>
|
||||
/// <returns>A dataresponse enum indicating success</returns>
|
||||
public DataResponse AddProfile(SimProfileData profile)
|
||||
public DataResponse AddProfile(RegionProfileData profile)
|
||||
{
|
||||
lock (manager.simProfiles)
|
||||
{
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace OpenSim.Framework.Data.DB4o
|
||||
/// <summary>
|
||||
/// A list of the current regions connected (in-memory cache)
|
||||
/// </summary>
|
||||
public Dictionary<LLUUID, SimProfileData> simProfiles = new Dictionary<LLUUID, SimProfileData>();
|
||||
public Dictionary<LLUUID, RegionProfileData> simProfiles = new Dictionary<LLUUID, RegionProfileData>();
|
||||
/// <summary>
|
||||
/// Database File Name
|
||||
/// </summary>
|
||||
@@ -56,9 +56,10 @@ namespace OpenSim.Framework.Data.DB4o
|
||||
dbfl = db4odb;
|
||||
IObjectContainer database;
|
||||
database = Db4oFactory.OpenFile(dbfl);
|
||||
IObjectSet result = database.Get(typeof(SimProfileData));
|
||||
IObjectSet result = database.Get(typeof(RegionProfileData));
|
||||
// Loads the file into the in-memory cache
|
||||
foreach(SimProfileData row in result) {
|
||||
foreach (RegionProfileData row in result)
|
||||
{
|
||||
simProfiles.Add(row.UUID, row);
|
||||
}
|
||||
database.Close();
|
||||
@@ -69,7 +70,7 @@ namespace OpenSim.Framework.Data.DB4o
|
||||
/// </summary>
|
||||
/// <param name="row">The profile to add</param>
|
||||
/// <returns>Successful?</returns>
|
||||
public bool AddRow(SimProfileData row)
|
||||
public bool AddRow(RegionProfileData row)
|
||||
{
|
||||
if (simProfiles.ContainsKey(row.UUID))
|
||||
{
|
||||
|
||||
@@ -86,7 +86,7 @@ namespace OpenSim.Framework.Data.MSSQL
|
||||
/// <param name="c">maximum X coordinate</param>
|
||||
/// <param name="d">maximum Y coordinate</param>
|
||||
/// <returns>An array of region profiles</returns>
|
||||
public SimProfileData[] GetProfilesInRange(uint a, uint b, uint c, uint d)
|
||||
public RegionProfileData[] GetProfilesInRange(uint a, uint b, uint c, uint d)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
@@ -96,7 +96,7 @@ namespace OpenSim.Framework.Data.MSSQL
|
||||
/// </summary>
|
||||
/// <param name="handle">Region location handle</param>
|
||||
/// <returns>Sim profile</returns>
|
||||
public SimProfileData GetProfileByHandle(ulong handle)
|
||||
public RegionProfileData GetProfileByHandle(ulong handle)
|
||||
{
|
||||
Dictionary<string, string> param = new Dictionary<string, string>();
|
||||
param["handle"] = handle.ToString();
|
||||
@@ -104,7 +104,7 @@ namespace OpenSim.Framework.Data.MSSQL
|
||||
IDbCommand result = database.Query("SELECT * FROM regions WHERE handle = @handle", param);
|
||||
IDataReader reader = result.ExecuteReader();
|
||||
|
||||
SimProfileData row = database.getRow(reader);
|
||||
RegionProfileData row = database.getRow(reader);
|
||||
reader.Close();
|
||||
result.Dispose();
|
||||
|
||||
@@ -116,7 +116,7 @@ namespace OpenSim.Framework.Data.MSSQL
|
||||
/// </summary>
|
||||
/// <param name="uuid">The region UUID</param>
|
||||
/// <returns>The sim profile</returns>
|
||||
public SimProfileData GetProfileByLLUUID(LLUUID uuid)
|
||||
public RegionProfileData GetProfileByLLUUID(LLUUID uuid)
|
||||
{
|
||||
Dictionary<string, string> param = new Dictionary<string, string>();
|
||||
param["uuid"] = uuid.ToStringHyphenated();
|
||||
@@ -124,7 +124,7 @@ namespace OpenSim.Framework.Data.MSSQL
|
||||
IDbCommand result = database.Query("SELECT * FROM regions WHERE uuid = @uuid", param);
|
||||
IDataReader reader = result.ExecuteReader();
|
||||
|
||||
SimProfileData row = database.getRow(reader);
|
||||
RegionProfileData row = database.getRow(reader);
|
||||
reader.Close();
|
||||
result.Dispose();
|
||||
|
||||
@@ -136,7 +136,7 @@ namespace OpenSim.Framework.Data.MSSQL
|
||||
/// </summary>
|
||||
/// <param name="profile">The profile to add</param>
|
||||
/// <returns>A dataresponse enum indicating success</returns>
|
||||
public DataResponse AddProfile(SimProfileData profile)
|
||||
public DataResponse AddProfile(RegionProfileData profile)
|
||||
{
|
||||
if (database.insertRow(profile))
|
||||
{
|
||||
@@ -162,7 +162,7 @@ namespace OpenSim.Framework.Data.MSSQL
|
||||
if (throwHissyFit)
|
||||
throw new Exception("CRYPTOWEAK AUTHENTICATE: Refusing to authenticate due to replay potential.");
|
||||
|
||||
SimProfileData data = GetProfileByLLUUID(uuid);
|
||||
RegionProfileData data = GetProfileByLLUUID(uuid);
|
||||
|
||||
return (handle == data.regionHandle && authkey == data.regionSecret);
|
||||
}
|
||||
|
||||
@@ -98,9 +98,9 @@ namespace OpenSim.Framework.Data.MSSQL
|
||||
/// </summary>
|
||||
/// <param name="reader">An active database reader</param>
|
||||
/// <returns>A region row</returns>
|
||||
public SimProfileData getRow(IDataReader reader)
|
||||
public RegionProfileData getRow(IDataReader reader)
|
||||
{
|
||||
SimProfileData regionprofile = new SimProfileData();
|
||||
RegionProfileData regionprofile = new RegionProfileData();
|
||||
|
||||
if (reader.Read())
|
||||
{
|
||||
@@ -154,7 +154,7 @@ namespace OpenSim.Framework.Data.MSSQL
|
||||
/// </summary>
|
||||
/// <param name="profile">The region profile to insert</param>
|
||||
/// <returns>Successful?</returns>
|
||||
public bool insertRow(SimProfileData profile)
|
||||
public bool insertRow(RegionProfileData profile)
|
||||
{
|
||||
string sql = "REPLACE INTO regions VALUES (regionHandle, regionName, uuid, regionRecvKey, regionSecret, regionSendKey, regionDataURI, ";
|
||||
sql += "serverIP, serverPort, serverURI, locX, locY, locZ, eastOverrideHandle, westOverrideHandle, southOverrideHandle, northOverrideHandle, regionAssetURI, regionAssetRecvKey, ";
|
||||
|
||||
@@ -96,7 +96,7 @@ namespace OpenSim.Framework.Data.MySQL
|
||||
/// <param name="xmax">Maximum X coordinate</param>
|
||||
/// <param name="ymax">Maximum Y coordinate</param>
|
||||
/// <returns></returns>
|
||||
public SimProfileData[] GetProfilesInRange(uint xmin, uint ymin, uint xmax, uint ymax)
|
||||
public RegionProfileData[] GetProfilesInRange(uint xmin, uint ymin, uint xmax, uint ymax)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -111,9 +111,9 @@ namespace OpenSim.Framework.Data.MySQL
|
||||
IDbCommand result = database.Query("SELECT * FROM regions WHERE locX >= ?xmin AND locX <= ?xmax AND locY >= ?ymin AND locY <= ?ymax", param);
|
||||
IDataReader reader = result.ExecuteReader();
|
||||
|
||||
SimProfileData row;
|
||||
RegionProfileData row;
|
||||
|
||||
List<SimProfileData> rows = new List<SimProfileData>();
|
||||
List<RegionProfileData> rows = new List<RegionProfileData>();
|
||||
|
||||
while ((row = database.readSimRow(reader)) != null)
|
||||
{
|
||||
@@ -139,7 +139,7 @@ namespace OpenSim.Framework.Data.MySQL
|
||||
/// </summary>
|
||||
/// <param name="handle">Region location handle</param>
|
||||
/// <returns>Sim profile</returns>
|
||||
public SimProfileData GetProfileByHandle(ulong handle)
|
||||
public RegionProfileData GetProfileByHandle(ulong handle)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -151,7 +151,7 @@ namespace OpenSim.Framework.Data.MySQL
|
||||
IDbCommand result = database.Query("SELECT * FROM regions WHERE regionHandle = ?handle", param);
|
||||
IDataReader reader = result.ExecuteReader();
|
||||
|
||||
SimProfileData row = database.readSimRow(reader);
|
||||
RegionProfileData row = database.readSimRow(reader);
|
||||
reader.Close();
|
||||
result.Dispose();
|
||||
|
||||
@@ -171,7 +171,7 @@ namespace OpenSim.Framework.Data.MySQL
|
||||
/// </summary>
|
||||
/// <param name="uuid">The region UUID</param>
|
||||
/// <returns>The sim profile</returns>
|
||||
public SimProfileData GetProfileByLLUUID(LLUUID uuid)
|
||||
public RegionProfileData GetProfileByLLUUID(LLUUID uuid)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -183,7 +183,7 @@ namespace OpenSim.Framework.Data.MySQL
|
||||
IDbCommand result = database.Query("SELECT * FROM regions WHERE uuid = ?uuid", param);
|
||||
IDataReader reader = result.ExecuteReader();
|
||||
|
||||
SimProfileData row = database.readSimRow(reader);
|
||||
RegionProfileData row = database.readSimRow(reader);
|
||||
reader.Close();
|
||||
result.Dispose();
|
||||
|
||||
@@ -203,7 +203,7 @@ namespace OpenSim.Framework.Data.MySQL
|
||||
/// </summary>
|
||||
/// <param name="profile">The profile to add</param>
|
||||
/// <returns>Successful?</returns>
|
||||
public DataResponse AddProfile(SimProfileData profile)
|
||||
public DataResponse AddProfile(RegionProfileData profile)
|
||||
{
|
||||
lock (database)
|
||||
{
|
||||
@@ -232,7 +232,7 @@ namespace OpenSim.Framework.Data.MySQL
|
||||
if (throwHissyFit)
|
||||
throw new Exception("CRYPTOWEAK AUTHENTICATE: Refusing to authenticate due to replay potential.");
|
||||
|
||||
SimProfileData data = GetProfileByLLUUID(uuid);
|
||||
RegionProfileData data = GetProfileByLLUUID(uuid);
|
||||
|
||||
return (handle == data.regionHandle && authkey == data.regionSecret);
|
||||
}
|
||||
|
||||
@@ -267,9 +267,9 @@ namespace OpenSim.Framework.Data.MySQL
|
||||
/// </summary>
|
||||
/// <param name="reader">An active database reader</param>
|
||||
/// <returns>A region profile</returns>
|
||||
public SimProfileData readSimRow(IDataReader reader)
|
||||
public RegionProfileData readSimRow(IDataReader reader)
|
||||
{
|
||||
SimProfileData retval = new SimProfileData();
|
||||
RegionProfileData retval = new RegionProfileData();
|
||||
|
||||
if (reader.Read())
|
||||
{
|
||||
@@ -583,7 +583,7 @@ namespace OpenSim.Framework.Data.MySQL
|
||||
/// </summary>
|
||||
/// <param name="profile">The region to insert</param>
|
||||
/// <returns>Success?</returns>
|
||||
public bool insertRegion(SimProfileData regiondata)
|
||||
public bool insertRegion(RegionProfileData regiondata)
|
||||
{
|
||||
string sql = "REPLACE INTO regions (regionHandle, regionName, uuid, regionRecvKey, regionSecret, regionSendKey, regionDataURI, ";
|
||||
sql += "serverIP, serverPort, serverURI, locX, locY, locZ, eastOverrideHandle, westOverrideHandle, southOverrideHandle, northOverrideHandle, regionAssetURI, regionAssetRecvKey, ";
|
||||
|
||||
@@ -86,7 +86,7 @@ namespace OpenSim.Framework.Data.SQLite
|
||||
/// <param name="c">maximum X coordinate</param>
|
||||
/// <param name="d">maximum Y coordinate</param>
|
||||
/// <returns>An array of region profiles</returns>
|
||||
public SimProfileData[] GetProfilesInRange(uint a, uint b, uint c, uint d)
|
||||
public RegionProfileData[] GetProfilesInRange(uint a, uint b, uint c, uint d)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
@@ -96,7 +96,7 @@ namespace OpenSim.Framework.Data.SQLite
|
||||
/// </summary>
|
||||
/// <param name="handle">Region location handle</param>
|
||||
/// <returns>Sim profile</returns>
|
||||
public SimProfileData GetProfileByHandle(ulong handle)
|
||||
public RegionProfileData GetProfileByHandle(ulong handle)
|
||||
{
|
||||
Dictionary<string, string> param = new Dictionary<string, string>();
|
||||
param["handle"] = handle.ToString();
|
||||
@@ -104,7 +104,7 @@ namespace OpenSim.Framework.Data.SQLite
|
||||
IDbCommand result = database.Query("SELECT * FROM regions WHERE handle = @handle", param);
|
||||
IDataReader reader = result.ExecuteReader();
|
||||
|
||||
SimProfileData row = database.getRow(reader);
|
||||
RegionProfileData row = database.getRow(reader);
|
||||
reader.Close();
|
||||
result.Dispose();
|
||||
|
||||
@@ -116,7 +116,7 @@ namespace OpenSim.Framework.Data.SQLite
|
||||
/// </summary>
|
||||
/// <param name="uuid">The region UUID</param>
|
||||
/// <returns>The sim profile</returns>
|
||||
public SimProfileData GetProfileByLLUUID(LLUUID uuid)
|
||||
public RegionProfileData GetProfileByLLUUID(LLUUID uuid)
|
||||
{
|
||||
Dictionary<string, string> param = new Dictionary<string, string>();
|
||||
param["uuid"] = uuid.ToStringHyphenated();
|
||||
@@ -124,7 +124,7 @@ namespace OpenSim.Framework.Data.SQLite
|
||||
IDbCommand result = database.Query("SELECT * FROM regions WHERE uuid = @uuid", param);
|
||||
IDataReader reader = result.ExecuteReader();
|
||||
|
||||
SimProfileData row = database.getRow(reader);
|
||||
RegionProfileData row = database.getRow(reader);
|
||||
reader.Close();
|
||||
result.Dispose();
|
||||
|
||||
@@ -136,7 +136,7 @@ namespace OpenSim.Framework.Data.SQLite
|
||||
/// </summary>
|
||||
/// <param name="profile">The profile to add</param>
|
||||
/// <returns>A dataresponse enum indicating success</returns>
|
||||
public DataResponse AddProfile(SimProfileData profile)
|
||||
public DataResponse AddProfile(RegionProfileData profile)
|
||||
{
|
||||
if (database.insertRow(profile))
|
||||
{
|
||||
@@ -162,7 +162,7 @@ namespace OpenSim.Framework.Data.SQLite
|
||||
if (throwHissyFit)
|
||||
throw new Exception("CRYPTOWEAK AUTHENTICATE: Refusing to authenticate due to replay potential.");
|
||||
|
||||
SimProfileData data = GetProfileByLLUUID(uuid);
|
||||
RegionProfileData data = GetProfileByLLUUID(uuid);
|
||||
|
||||
return (handle == data.regionHandle && authkey == data.regionSecret);
|
||||
}
|
||||
|
||||
@@ -161,9 +161,9 @@ namespace OpenSim.Framework.Data.SQLite
|
||||
/// </summary>
|
||||
/// <param name="reader">An active database reader</param>
|
||||
/// <returns>A region profile</returns>
|
||||
public SimProfileData getRow(IDataReader reader)
|
||||
public RegionProfileData getRow(IDataReader reader)
|
||||
{
|
||||
SimProfileData retval = new SimProfileData();
|
||||
RegionProfileData retval = new RegionProfileData();
|
||||
|
||||
if (reader.Read())
|
||||
{
|
||||
@@ -217,7 +217,7 @@ namespace OpenSim.Framework.Data.SQLite
|
||||
/// </summary>
|
||||
/// <param name="profile">The region to insert</param>
|
||||
/// <returns>Success?</returns>
|
||||
public bool insertRow(SimProfileData profile)
|
||||
public bool insertRow(RegionProfileData profile)
|
||||
{
|
||||
string sql = "REPLACE INTO regions VALUES (regionHandle, regionName, uuid, regionRecvKey, regionSecret, regionSendKey, regionDataURI, ";
|
||||
sql += "serverIP, serverPort, serverURI, locX, locY, locZ, eastOverrideHandle, westOverrideHandle, southOverrideHandle, northOverrideHandle, regionAssetURI, regionAssetRecvKey, ";
|
||||
|
||||
@@ -47,14 +47,14 @@ namespace OpenSim.Framework.Data
|
||||
/// </summary>
|
||||
/// <param name="regionHandle">A 64bit Region Handle</param>
|
||||
/// <returns>A simprofile</returns>
|
||||
SimProfileData GetProfileByHandle(ulong regionHandle);
|
||||
RegionProfileData GetProfileByHandle(ulong regionHandle);
|
||||
|
||||
/// <summary>
|
||||
/// Returns a sim profile from a UUID
|
||||
/// </summary>
|
||||
/// <param name="UUID">A 128bit UUID</param>
|
||||
/// <returns>A sim profile</returns>
|
||||
SimProfileData GetProfileByLLUUID(LLUUID UUID);
|
||||
RegionProfileData GetProfileByLLUUID(LLUUID UUID);
|
||||
|
||||
/// <summary>
|
||||
/// Returns all profiles within the specified range
|
||||
@@ -64,7 +64,7 @@ namespace OpenSim.Framework.Data
|
||||
/// <param name="Xmax">Maximum sim coordinate (X)</param>
|
||||
/// <param name="Ymin">Maximum sim coordinate (Y)</param>
|
||||
/// <returns>An array containing all the sim profiles in the specified range</returns>
|
||||
SimProfileData[] GetProfilesInRange(uint Xmin, uint Ymin, uint Xmax, uint Ymax);
|
||||
RegionProfileData[] GetProfilesInRange(uint Xmin, uint Ymin, uint Xmax, uint Ymax);
|
||||
|
||||
/// <summary>
|
||||
/// Authenticates a sim by use of it's recv key.
|
||||
@@ -103,7 +103,7 @@ namespace OpenSim.Framework.Data
|
||||
/// </summary>
|
||||
/// <param name="profile">The profile to add</param>
|
||||
/// <returns>RESPONSE_OK if successful, error if not.</returns>
|
||||
DataResponse AddProfile(SimProfileData profile);
|
||||
DataResponse AddProfile(RegionProfileData profile);
|
||||
|
||||
ReservationData GetReservationAtPoint(uint x, uint y);
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace OpenSim.Framework.Data
|
||||
/// <summary>
|
||||
/// A class which contains information known to the grid server about a region
|
||||
/// </summary>
|
||||
public class SimProfileData
|
||||
public class RegionProfileData
|
||||
{
|
||||
/// <summary>
|
||||
/// The name of the region
|
||||
@@ -124,7 +124,7 @@ namespace OpenSim.Framework.Data
|
||||
/// <param name="gridserver_url"></param>
|
||||
/// <param name="?"></param>
|
||||
/// <returns></returns>
|
||||
public SimProfileData 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();
|
||||
@@ -141,7 +141,7 @@ namespace OpenSim.Framework.Data
|
||||
return null;
|
||||
}
|
||||
|
||||
SimProfileData simData = new SimProfileData();
|
||||
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));
|
||||
@@ -156,7 +156,7 @@ namespace OpenSim.Framework.Data
|
||||
|
||||
return simData;
|
||||
}
|
||||
public SimProfileData 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();
|
||||
@@ -173,7 +173,7 @@ namespace OpenSim.Framework.Data
|
||||
return null;
|
||||
}
|
||||
|
||||
SimProfileData simData = new SimProfileData();
|
||||
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));
|
||||
Reference in New Issue
Block a user