Renamed SimProfileData to RegionProfileData
parent
7415eb7355
commit
44a7db0e44
|
@ -56,7 +56,7 @@ namespace OpenSim.Framework.Data.DB4o
|
||||||
/// <param name="c">maximum X coordinate</param>
|
/// <param name="c">maximum X coordinate</param>
|
||||||
/// <param name="d">maximum Y coordinate</param>
|
/// <param name="d">maximum Y coordinate</param>
|
||||||
/// <returns>An array of region profiles</returns>
|
/// <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;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -66,7 +66,8 @@ namespace OpenSim.Framework.Data.DB4o
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="handle">The handle to search for</param>
|
/// <param name="handle">The handle to search for</param>
|
||||||
/// <returns>A region profile</returns>
|
/// <returns>A region profile</returns>
|
||||||
public SimProfileData GetProfileByHandle(ulong handle) {
|
public RegionProfileData GetProfileByHandle(ulong handle)
|
||||||
|
{
|
||||||
lock (manager.simProfiles)
|
lock (manager.simProfiles)
|
||||||
{
|
{
|
||||||
foreach (LLUUID UUID in manager.simProfiles.Keys)
|
foreach (LLUUID UUID in manager.simProfiles.Keys)
|
||||||
|
@ -85,7 +86,7 @@ namespace OpenSim.Framework.Data.DB4o
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="uuid">The region ID code</param>
|
/// <param name="uuid">The region ID code</param>
|
||||||
/// <returns>A region profile</returns>
|
/// <returns>A region profile</returns>
|
||||||
public SimProfileData GetProfileByLLUUID(LLUUID uuid)
|
public RegionProfileData GetProfileByLLUUID(LLUUID uuid)
|
||||||
{
|
{
|
||||||
lock (manager.simProfiles)
|
lock (manager.simProfiles)
|
||||||
{
|
{
|
||||||
|
@ -100,7 +101,7 @@ namespace OpenSim.Framework.Data.DB4o
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="profile">The profile to add</param>
|
/// <param name="profile">The profile to add</param>
|
||||||
/// <returns>A dataresponse enum indicating success</returns>
|
/// <returns>A dataresponse enum indicating success</returns>
|
||||||
public DataResponse AddProfile(SimProfileData profile)
|
public DataResponse AddProfile(RegionProfileData profile)
|
||||||
{
|
{
|
||||||
lock (manager.simProfiles)
|
lock (manager.simProfiles)
|
||||||
{
|
{
|
||||||
|
|
|
@ -41,7 +41,7 @@ namespace OpenSim.Framework.Data.DB4o
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A list of the current regions connected (in-memory cache)
|
/// A list of the current regions connected (in-memory cache)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Dictionary<LLUUID, SimProfileData> simProfiles = new Dictionary<LLUUID, SimProfileData>();
|
public Dictionary<LLUUID, RegionProfileData> simProfiles = new Dictionary<LLUUID, RegionProfileData>();
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Database File Name
|
/// Database File Name
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -56,9 +56,10 @@ namespace OpenSim.Framework.Data.DB4o
|
||||||
dbfl = db4odb;
|
dbfl = db4odb;
|
||||||
IObjectContainer database;
|
IObjectContainer database;
|
||||||
database = Db4oFactory.OpenFile(dbfl);
|
database = Db4oFactory.OpenFile(dbfl);
|
||||||
IObjectSet result = database.Get(typeof(SimProfileData));
|
IObjectSet result = database.Get(typeof(RegionProfileData));
|
||||||
// Loads the file into the in-memory cache
|
// Loads the file into the in-memory cache
|
||||||
foreach(SimProfileData row in result) {
|
foreach (RegionProfileData row in result)
|
||||||
|
{
|
||||||
simProfiles.Add(row.UUID, row);
|
simProfiles.Add(row.UUID, row);
|
||||||
}
|
}
|
||||||
database.Close();
|
database.Close();
|
||||||
|
@ -69,7 +70,7 @@ namespace OpenSim.Framework.Data.DB4o
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="row">The profile to add</param>
|
/// <param name="row">The profile to add</param>
|
||||||
/// <returns>Successful?</returns>
|
/// <returns>Successful?</returns>
|
||||||
public bool AddRow(SimProfileData row)
|
public bool AddRow(RegionProfileData row)
|
||||||
{
|
{
|
||||||
if (simProfiles.ContainsKey(row.UUID))
|
if (simProfiles.ContainsKey(row.UUID))
|
||||||
{
|
{
|
||||||
|
|
|
@ -86,7 +86,7 @@ namespace OpenSim.Framework.Data.MSSQL
|
||||||
/// <param name="c">maximum X coordinate</param>
|
/// <param name="c">maximum X coordinate</param>
|
||||||
/// <param name="d">maximum Y coordinate</param>
|
/// <param name="d">maximum Y coordinate</param>
|
||||||
/// <returns>An array of region profiles</returns>
|
/// <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;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -96,7 +96,7 @@ namespace OpenSim.Framework.Data.MSSQL
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="handle">Region location handle</param>
|
/// <param name="handle">Region location handle</param>
|
||||||
/// <returns>Sim profile</returns>
|
/// <returns>Sim profile</returns>
|
||||||
public SimProfileData GetProfileByHandle(ulong handle)
|
public RegionProfileData GetProfileByHandle(ulong handle)
|
||||||
{
|
{
|
||||||
Dictionary<string, string> param = new Dictionary<string, string>();
|
Dictionary<string, string> param = new Dictionary<string, string>();
|
||||||
param["handle"] = handle.ToString();
|
param["handle"] = handle.ToString();
|
||||||
|
@ -104,7 +104,7 @@ namespace OpenSim.Framework.Data.MSSQL
|
||||||
IDbCommand result = database.Query("SELECT * FROM regions WHERE handle = @handle", param);
|
IDbCommand result = database.Query("SELECT * FROM regions WHERE handle = @handle", param);
|
||||||
IDataReader reader = result.ExecuteReader();
|
IDataReader reader = result.ExecuteReader();
|
||||||
|
|
||||||
SimProfileData row = database.getRow(reader);
|
RegionProfileData row = database.getRow(reader);
|
||||||
reader.Close();
|
reader.Close();
|
||||||
result.Dispose();
|
result.Dispose();
|
||||||
|
|
||||||
|
@ -116,7 +116,7 @@ namespace OpenSim.Framework.Data.MSSQL
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="uuid">The region UUID</param>
|
/// <param name="uuid">The region UUID</param>
|
||||||
/// <returns>The sim profile</returns>
|
/// <returns>The sim profile</returns>
|
||||||
public SimProfileData GetProfileByLLUUID(LLUUID uuid)
|
public RegionProfileData GetProfileByLLUUID(LLUUID uuid)
|
||||||
{
|
{
|
||||||
Dictionary<string, string> param = new Dictionary<string, string>();
|
Dictionary<string, string> param = new Dictionary<string, string>();
|
||||||
param["uuid"] = uuid.ToStringHyphenated();
|
param["uuid"] = uuid.ToStringHyphenated();
|
||||||
|
@ -124,7 +124,7 @@ namespace OpenSim.Framework.Data.MSSQL
|
||||||
IDbCommand result = database.Query("SELECT * FROM regions WHERE uuid = @uuid", param);
|
IDbCommand result = database.Query("SELECT * FROM regions WHERE uuid = @uuid", param);
|
||||||
IDataReader reader = result.ExecuteReader();
|
IDataReader reader = result.ExecuteReader();
|
||||||
|
|
||||||
SimProfileData row = database.getRow(reader);
|
RegionProfileData row = database.getRow(reader);
|
||||||
reader.Close();
|
reader.Close();
|
||||||
result.Dispose();
|
result.Dispose();
|
||||||
|
|
||||||
|
@ -136,7 +136,7 @@ namespace OpenSim.Framework.Data.MSSQL
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="profile">The profile to add</param>
|
/// <param name="profile">The profile to add</param>
|
||||||
/// <returns>A dataresponse enum indicating success</returns>
|
/// <returns>A dataresponse enum indicating success</returns>
|
||||||
public DataResponse AddProfile(SimProfileData profile)
|
public DataResponse AddProfile(RegionProfileData profile)
|
||||||
{
|
{
|
||||||
if (database.insertRow(profile))
|
if (database.insertRow(profile))
|
||||||
{
|
{
|
||||||
|
@ -162,7 +162,7 @@ namespace OpenSim.Framework.Data.MSSQL
|
||||||
if (throwHissyFit)
|
if (throwHissyFit)
|
||||||
throw new Exception("CRYPTOWEAK AUTHENTICATE: Refusing to authenticate due to replay potential.");
|
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);
|
return (handle == data.regionHandle && authkey == data.regionSecret);
|
||||||
}
|
}
|
||||||
|
|
|
@ -98,9 +98,9 @@ namespace OpenSim.Framework.Data.MSSQL
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader">An active database reader</param>
|
/// <param name="reader">An active database reader</param>
|
||||||
/// <returns>A region row</returns>
|
/// <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())
|
if (reader.Read())
|
||||||
{
|
{
|
||||||
|
@ -154,7 +154,7 @@ namespace OpenSim.Framework.Data.MSSQL
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="profile">The region profile to insert</param>
|
/// <param name="profile">The region profile to insert</param>
|
||||||
/// <returns>Successful?</returns>
|
/// <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, ";
|
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, ";
|
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="xmax">Maximum X coordinate</param>
|
||||||
/// <param name="ymax">Maximum Y coordinate</param>
|
/// <param name="ymax">Maximum Y coordinate</param>
|
||||||
/// <returns></returns>
|
/// <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
|
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);
|
IDbCommand result = database.Query("SELECT * FROM regions WHERE locX >= ?xmin AND locX <= ?xmax AND locY >= ?ymin AND locY <= ?ymax", param);
|
||||||
IDataReader reader = result.ExecuteReader();
|
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)
|
while ((row = database.readSimRow(reader)) != null)
|
||||||
{
|
{
|
||||||
|
@ -139,7 +139,7 @@ namespace OpenSim.Framework.Data.MySQL
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="handle">Region location handle</param>
|
/// <param name="handle">Region location handle</param>
|
||||||
/// <returns>Sim profile</returns>
|
/// <returns>Sim profile</returns>
|
||||||
public SimProfileData GetProfileByHandle(ulong handle)
|
public RegionProfileData GetProfileByHandle(ulong handle)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -151,7 +151,7 @@ namespace OpenSim.Framework.Data.MySQL
|
||||||
IDbCommand result = database.Query("SELECT * FROM regions WHERE regionHandle = ?handle", param);
|
IDbCommand result = database.Query("SELECT * FROM regions WHERE regionHandle = ?handle", param);
|
||||||
IDataReader reader = result.ExecuteReader();
|
IDataReader reader = result.ExecuteReader();
|
||||||
|
|
||||||
SimProfileData row = database.readSimRow(reader);
|
RegionProfileData row = database.readSimRow(reader);
|
||||||
reader.Close();
|
reader.Close();
|
||||||
result.Dispose();
|
result.Dispose();
|
||||||
|
|
||||||
|
@ -171,7 +171,7 @@ namespace OpenSim.Framework.Data.MySQL
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="uuid">The region UUID</param>
|
/// <param name="uuid">The region UUID</param>
|
||||||
/// <returns>The sim profile</returns>
|
/// <returns>The sim profile</returns>
|
||||||
public SimProfileData GetProfileByLLUUID(LLUUID uuid)
|
public RegionProfileData GetProfileByLLUUID(LLUUID uuid)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -183,7 +183,7 @@ namespace OpenSim.Framework.Data.MySQL
|
||||||
IDbCommand result = database.Query("SELECT * FROM regions WHERE uuid = ?uuid", param);
|
IDbCommand result = database.Query("SELECT * FROM regions WHERE uuid = ?uuid", param);
|
||||||
IDataReader reader = result.ExecuteReader();
|
IDataReader reader = result.ExecuteReader();
|
||||||
|
|
||||||
SimProfileData row = database.readSimRow(reader);
|
RegionProfileData row = database.readSimRow(reader);
|
||||||
reader.Close();
|
reader.Close();
|
||||||
result.Dispose();
|
result.Dispose();
|
||||||
|
|
||||||
|
@ -203,7 +203,7 @@ namespace OpenSim.Framework.Data.MySQL
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="profile">The profile to add</param>
|
/// <param name="profile">The profile to add</param>
|
||||||
/// <returns>Successful?</returns>
|
/// <returns>Successful?</returns>
|
||||||
public DataResponse AddProfile(SimProfileData profile)
|
public DataResponse AddProfile(RegionProfileData profile)
|
||||||
{
|
{
|
||||||
lock (database)
|
lock (database)
|
||||||
{
|
{
|
||||||
|
@ -232,7 +232,7 @@ namespace OpenSim.Framework.Data.MySQL
|
||||||
if (throwHissyFit)
|
if (throwHissyFit)
|
||||||
throw new Exception("CRYPTOWEAK AUTHENTICATE: Refusing to authenticate due to replay potential.");
|
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);
|
return (handle == data.regionHandle && authkey == data.regionSecret);
|
||||||
}
|
}
|
||||||
|
|
|
@ -267,9 +267,9 @@ namespace OpenSim.Framework.Data.MySQL
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader">An active database reader</param>
|
/// <param name="reader">An active database reader</param>
|
||||||
/// <returns>A region profile</returns>
|
/// <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())
|
if (reader.Read())
|
||||||
{
|
{
|
||||||
|
@ -583,7 +583,7 @@ namespace OpenSim.Framework.Data.MySQL
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="profile">The region to insert</param>
|
/// <param name="profile">The region to insert</param>
|
||||||
/// <returns>Success?</returns>
|
/// <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, ";
|
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, ";
|
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="c">maximum X coordinate</param>
|
||||||
/// <param name="d">maximum Y coordinate</param>
|
/// <param name="d">maximum Y coordinate</param>
|
||||||
/// <returns>An array of region profiles</returns>
|
/// <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;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -96,7 +96,7 @@ namespace OpenSim.Framework.Data.SQLite
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="handle">Region location handle</param>
|
/// <param name="handle">Region location handle</param>
|
||||||
/// <returns>Sim profile</returns>
|
/// <returns>Sim profile</returns>
|
||||||
public SimProfileData GetProfileByHandle(ulong handle)
|
public RegionProfileData GetProfileByHandle(ulong handle)
|
||||||
{
|
{
|
||||||
Dictionary<string, string> param = new Dictionary<string, string>();
|
Dictionary<string, string> param = new Dictionary<string, string>();
|
||||||
param["handle"] = handle.ToString();
|
param["handle"] = handle.ToString();
|
||||||
|
@ -104,7 +104,7 @@ namespace OpenSim.Framework.Data.SQLite
|
||||||
IDbCommand result = database.Query("SELECT * FROM regions WHERE handle = @handle", param);
|
IDbCommand result = database.Query("SELECT * FROM regions WHERE handle = @handle", param);
|
||||||
IDataReader reader = result.ExecuteReader();
|
IDataReader reader = result.ExecuteReader();
|
||||||
|
|
||||||
SimProfileData row = database.getRow(reader);
|
RegionProfileData row = database.getRow(reader);
|
||||||
reader.Close();
|
reader.Close();
|
||||||
result.Dispose();
|
result.Dispose();
|
||||||
|
|
||||||
|
@ -116,7 +116,7 @@ namespace OpenSim.Framework.Data.SQLite
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="uuid">The region UUID</param>
|
/// <param name="uuid">The region UUID</param>
|
||||||
/// <returns>The sim profile</returns>
|
/// <returns>The sim profile</returns>
|
||||||
public SimProfileData GetProfileByLLUUID(LLUUID uuid)
|
public RegionProfileData GetProfileByLLUUID(LLUUID uuid)
|
||||||
{
|
{
|
||||||
Dictionary<string, string> param = new Dictionary<string, string>();
|
Dictionary<string, string> param = new Dictionary<string, string>();
|
||||||
param["uuid"] = uuid.ToStringHyphenated();
|
param["uuid"] = uuid.ToStringHyphenated();
|
||||||
|
@ -124,7 +124,7 @@ namespace OpenSim.Framework.Data.SQLite
|
||||||
IDbCommand result = database.Query("SELECT * FROM regions WHERE uuid = @uuid", param);
|
IDbCommand result = database.Query("SELECT * FROM regions WHERE uuid = @uuid", param);
|
||||||
IDataReader reader = result.ExecuteReader();
|
IDataReader reader = result.ExecuteReader();
|
||||||
|
|
||||||
SimProfileData row = database.getRow(reader);
|
RegionProfileData row = database.getRow(reader);
|
||||||
reader.Close();
|
reader.Close();
|
||||||
result.Dispose();
|
result.Dispose();
|
||||||
|
|
||||||
|
@ -136,7 +136,7 @@ namespace OpenSim.Framework.Data.SQLite
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="profile">The profile to add</param>
|
/// <param name="profile">The profile to add</param>
|
||||||
/// <returns>A dataresponse enum indicating success</returns>
|
/// <returns>A dataresponse enum indicating success</returns>
|
||||||
public DataResponse AddProfile(SimProfileData profile)
|
public DataResponse AddProfile(RegionProfileData profile)
|
||||||
{
|
{
|
||||||
if (database.insertRow(profile))
|
if (database.insertRow(profile))
|
||||||
{
|
{
|
||||||
|
@ -162,7 +162,7 @@ namespace OpenSim.Framework.Data.SQLite
|
||||||
if (throwHissyFit)
|
if (throwHissyFit)
|
||||||
throw new Exception("CRYPTOWEAK AUTHENTICATE: Refusing to authenticate due to replay potential.");
|
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);
|
return (handle == data.regionHandle && authkey == data.regionSecret);
|
||||||
}
|
}
|
||||||
|
|
|
@ -161,9 +161,9 @@ namespace OpenSim.Framework.Data.SQLite
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader">An active database reader</param>
|
/// <param name="reader">An active database reader</param>
|
||||||
/// <returns>A region profile</returns>
|
/// <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())
|
if (reader.Read())
|
||||||
{
|
{
|
||||||
|
@ -217,7 +217,7 @@ namespace OpenSim.Framework.Data.SQLite
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="profile">The region to insert</param>
|
/// <param name="profile">The region to insert</param>
|
||||||
/// <returns>Success?</returns>
|
/// <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, ";
|
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, ";
|
sql += "serverIP, serverPort, serverURI, locX, locY, locZ, eastOverrideHandle, westOverrideHandle, southOverrideHandle, northOverrideHandle, regionAssetURI, regionAssetRecvKey, ";
|
||||||
|
|
|
@ -47,14 +47,14 @@ namespace OpenSim.Framework.Data
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="regionHandle">A 64bit Region Handle</param>
|
/// <param name="regionHandle">A 64bit Region Handle</param>
|
||||||
/// <returns>A simprofile</returns>
|
/// <returns>A simprofile</returns>
|
||||||
SimProfileData GetProfileByHandle(ulong regionHandle);
|
RegionProfileData GetProfileByHandle(ulong regionHandle);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns a sim profile from a UUID
|
/// Returns a sim profile from a UUID
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="UUID">A 128bit UUID</param>
|
/// <param name="UUID">A 128bit UUID</param>
|
||||||
/// <returns>A sim profile</returns>
|
/// <returns>A sim profile</returns>
|
||||||
SimProfileData GetProfileByLLUUID(LLUUID UUID);
|
RegionProfileData GetProfileByLLUUID(LLUUID UUID);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns all profiles within the specified range
|
/// 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="Xmax">Maximum sim coordinate (X)</param>
|
||||||
/// <param name="Ymin">Maximum sim coordinate (Y)</param>
|
/// <param name="Ymin">Maximum sim coordinate (Y)</param>
|
||||||
/// <returns>An array containing all the sim profiles in the specified range</returns>
|
/// <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>
|
/// <summary>
|
||||||
/// Authenticates a sim by use of it's recv key.
|
/// Authenticates a sim by use of it's recv key.
|
||||||
|
@ -103,7 +103,7 @@ namespace OpenSim.Framework.Data
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="profile">The profile to add</param>
|
/// <param name="profile">The profile to add</param>
|
||||||
/// <returns>RESPONSE_OK if successful, error if not.</returns>
|
/// <returns>RESPONSE_OK if successful, error if not.</returns>
|
||||||
DataResponse AddProfile(SimProfileData profile);
|
DataResponse AddProfile(RegionProfileData profile);
|
||||||
|
|
||||||
ReservationData GetReservationAtPoint(uint x, uint y);
|
ReservationData GetReservationAtPoint(uint x, uint y);
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ namespace OpenSim.Framework.Data
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A class which contains information known to the grid server about a region
|
/// A class which contains information known to the grid server about a region
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class SimProfileData
|
public class RegionProfileData
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The name of the region
|
/// The name of the region
|
||||||
|
@ -124,7 +124,7 @@ namespace OpenSim.Framework.Data
|
||||||
/// <param name="gridserver_url"></param>
|
/// <param name="gridserver_url"></param>
|
||||||
/// <param name="?"></param>
|
/// <param name="?"></param>
|
||||||
/// <returns></returns>
|
/// <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();
|
Hashtable requestData = new Hashtable();
|
||||||
requestData["region_uuid"] = region_uuid.UUID.ToString();
|
requestData["region_uuid"] = region_uuid.UUID.ToString();
|
||||||
|
@ -141,7 +141,7 @@ namespace OpenSim.Framework.Data
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
SimProfileData simData = new SimProfileData();
|
RegionProfileData simData = new RegionProfileData();
|
||||||
simData.regionLocX = Convert.ToUInt32((string)responseData["region_locx"]);
|
simData.regionLocX = Convert.ToUInt32((string)responseData["region_locx"]);
|
||||||
simData.regionLocY = Convert.ToUInt32((string)responseData["region_locy"]);
|
simData.regionLocY = Convert.ToUInt32((string)responseData["region_locy"]);
|
||||||
simData.regionHandle = Helpers.UIntsToLong((simData.regionLocX * 256), (simData.regionLocY * 256));
|
simData.regionHandle = Helpers.UIntsToLong((simData.regionLocX * 256), (simData.regionLocY * 256));
|
||||||
|
@ -156,7 +156,7 @@ namespace OpenSim.Framework.Data
|
||||||
|
|
||||||
return simData;
|
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();
|
Hashtable requestData = new Hashtable();
|
||||||
requestData["region_handle"] = region_handle.ToString();
|
requestData["region_handle"] = region_handle.ToString();
|
||||||
|
@ -173,7 +173,7 @@ namespace OpenSim.Framework.Data
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
SimProfileData simData = new SimProfileData();
|
RegionProfileData simData = new RegionProfileData();
|
||||||
simData.regionLocX = Convert.ToUInt32((string)responseData["region_locx"]);
|
simData.regionLocX = Convert.ToUInt32((string)responseData["region_locx"]);
|
||||||
simData.regionLocY = Convert.ToUInt32((string)responseData["region_locy"]);
|
simData.regionLocY = Convert.ToUInt32((string)responseData["region_locy"]);
|
||||||
simData.regionHandle = Helpers.UIntsToLong((simData.regionLocX * 256), (simData.regionLocY * 256));
|
simData.regionHandle = Helpers.UIntsToLong((simData.regionLocX * 256), (simData.regionLocY * 256));
|
|
@ -122,7 +122,7 @@ namespace OpenSim.Grid.GridServer
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="uuid">A UUID key of the region to return</param>
|
/// <param name="uuid">A UUID key of the region to return</param>
|
||||||
/// <returns>A SimProfileData for the region</returns>
|
/// <returns>A SimProfileData for the region</returns>
|
||||||
public SimProfileData getRegion(LLUUID uuid)
|
public RegionProfileData getRegion(LLUUID uuid)
|
||||||
{
|
{
|
||||||
foreach(KeyValuePair<string,IGridData> kvp in _plugins) {
|
foreach(KeyValuePair<string,IGridData> kvp in _plugins) {
|
||||||
try
|
try
|
||||||
|
@ -142,7 +142,7 @@ namespace OpenSim.Grid.GridServer
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="uuid">A regionHandle of the region to return</param>
|
/// <param name="uuid">A regionHandle of the region to return</param>
|
||||||
/// <returns>A SimProfileData for the region</returns>
|
/// <returns>A SimProfileData for the region</returns>
|
||||||
public SimProfileData getRegion(ulong handle)
|
public RegionProfileData getRegion(ulong handle)
|
||||||
{
|
{
|
||||||
foreach (KeyValuePair<string, IGridData> kvp in _plugins)
|
foreach (KeyValuePair<string, IGridData> kvp in _plugins)
|
||||||
{
|
{
|
||||||
|
@ -158,16 +158,16 @@ namespace OpenSim.Grid.GridServer
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Dictionary<ulong, SimProfileData> getRegions(uint xmin, uint ymin, uint xmax, uint ymax)
|
public Dictionary<ulong, RegionProfileData> getRegions(uint xmin, uint ymin, uint xmax, uint ymax)
|
||||||
{
|
{
|
||||||
Dictionary<ulong, SimProfileData> regions = new Dictionary<ulong, SimProfileData>();
|
Dictionary<ulong, RegionProfileData> regions = new Dictionary<ulong, RegionProfileData>();
|
||||||
|
|
||||||
foreach (KeyValuePair<string, IGridData> kvp in _plugins)
|
foreach (KeyValuePair<string, IGridData> kvp in _plugins)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
SimProfileData[] neighbours = kvp.Value.GetProfilesInRange(xmin, ymin, xmax, ymax);
|
RegionProfileData[] neighbours = kvp.Value.GetProfilesInRange(xmin, ymin, xmax, ymax);
|
||||||
foreach (SimProfileData neighbour in neighbours)
|
foreach (RegionProfileData neighbour in neighbours)
|
||||||
{
|
{
|
||||||
regions[neighbour.regionHandle] = neighbour;
|
regions[neighbour.regionHandle] = neighbour;
|
||||||
}
|
}
|
||||||
|
@ -191,8 +191,8 @@ namespace OpenSim.Grid.GridServer
|
||||||
public string GetXMLNeighbours(ulong reqhandle)
|
public string GetXMLNeighbours(ulong reqhandle)
|
||||||
{
|
{
|
||||||
string response = "";
|
string response = "";
|
||||||
SimProfileData central_region = getRegion(reqhandle);
|
RegionProfileData central_region = getRegion(reqhandle);
|
||||||
SimProfileData neighbour;
|
RegionProfileData neighbour;
|
||||||
for (int x = -1; x < 2; x++) for (int y = -1; y < 2; y++)
|
for (int x = -1; x < 2; x++) for (int y = -1; y < 2; y++)
|
||||||
{
|
{
|
||||||
if (getRegion(Util.UIntsToLong((uint)((central_region.regionLocX + x) * 256), (uint)(central_region.regionLocY + y) * 256)) != null)
|
if (getRegion(Util.UIntsToLong((uint)((central_region.regionLocX + x) * 256), (uint)(central_region.regionLocY + y) * 256)) != null)
|
||||||
|
@ -223,7 +223,7 @@ namespace OpenSim.Grid.GridServer
|
||||||
Hashtable responseData = new Hashtable();
|
Hashtable responseData = new Hashtable();
|
||||||
response.Value = responseData;
|
response.Value = responseData;
|
||||||
|
|
||||||
SimProfileData TheSim = null;
|
RegionProfileData TheSim = null;
|
||||||
Hashtable requestData = (Hashtable)request.Params[0];
|
Hashtable requestData = (Hashtable)request.Params[0];
|
||||||
string myword;
|
string myword;
|
||||||
if (requestData.ContainsKey("UUID"))
|
if (requestData.ContainsKey("UUID"))
|
||||||
|
@ -254,7 +254,7 @@ namespace OpenSim.Grid.GridServer
|
||||||
myword = "connection";
|
myword = "connection";
|
||||||
}
|
}
|
||||||
|
|
||||||
TheSim = new SimProfileData();
|
TheSim = new RegionProfileData();
|
||||||
|
|
||||||
TheSim.regionRecvKey = config.SimRecvKey;
|
TheSim.regionRecvKey = config.SimRecvKey;
|
||||||
TheSim.regionSendKey = config.SimSendKey;
|
TheSim.regionSendKey = config.SimSendKey;
|
||||||
|
@ -325,16 +325,16 @@ namespace OpenSim.Grid.GridServer
|
||||||
|
|
||||||
ArrayList SimNeighboursData = new ArrayList();
|
ArrayList SimNeighboursData = new ArrayList();
|
||||||
|
|
||||||
SimProfileData neighbour;
|
RegionProfileData neighbour;
|
||||||
Hashtable NeighbourBlock;
|
Hashtable NeighbourBlock;
|
||||||
|
|
||||||
bool fastMode = false; // Only compatible with MySQL right now
|
bool fastMode = false; // Only compatible with MySQL right now
|
||||||
|
|
||||||
if (fastMode)
|
if (fastMode)
|
||||||
{
|
{
|
||||||
Dictionary<ulong, SimProfileData> neighbours = getRegions(TheSim.regionLocX - 1, TheSim.regionLocY - 1, TheSim.regionLocX + 1, TheSim.regionLocY + 1);
|
Dictionary<ulong, RegionProfileData> neighbours = getRegions(TheSim.regionLocX - 1, TheSim.regionLocY - 1, TheSim.regionLocX + 1, TheSim.regionLocY + 1);
|
||||||
|
|
||||||
foreach (KeyValuePair<ulong, SimProfileData> aSim in neighbours)
|
foreach (KeyValuePair<ulong, RegionProfileData> aSim in neighbours)
|
||||||
{
|
{
|
||||||
NeighbourBlock = new Hashtable();
|
NeighbourBlock = new Hashtable();
|
||||||
NeighbourBlock["sim_ip"] = Util.GetHostFromDNS(aSim.Value.serverIP.ToString()).ToString();
|
NeighbourBlock["sim_ip"] = Util.GetHostFromDNS(aSim.Value.serverIP.ToString()).ToString();
|
||||||
|
@ -395,7 +395,7 @@ namespace OpenSim.Grid.GridServer
|
||||||
{
|
{
|
||||||
Hashtable requestData = (Hashtable)request.Params[0];
|
Hashtable requestData = (Hashtable)request.Params[0];
|
||||||
Hashtable responseData = new Hashtable();
|
Hashtable responseData = new Hashtable();
|
||||||
SimProfileData simData = null;
|
RegionProfileData simData = null;
|
||||||
if (requestData.ContainsKey("region_UUID"))
|
if (requestData.ContainsKey("region_UUID"))
|
||||||
{
|
{
|
||||||
simData = getRegion(new LLUUID((string)requestData["region_UUID"]));
|
simData = getRegion(new LLUUID((string)requestData["region_UUID"]));
|
||||||
|
@ -461,9 +461,9 @@ namespace OpenSim.Grid.GridServer
|
||||||
|
|
||||||
if (fastMode)
|
if (fastMode)
|
||||||
{
|
{
|
||||||
Dictionary<ulong, SimProfileData> neighbours = getRegions((uint)xmin, (uint)ymin, (uint)xmax, (uint)ymax);
|
Dictionary<ulong, RegionProfileData> neighbours = getRegions((uint)xmin, (uint)ymin, (uint)xmax, (uint)ymax);
|
||||||
|
|
||||||
foreach (KeyValuePair<ulong, SimProfileData> aSim in neighbours)
|
foreach (KeyValuePair<ulong, RegionProfileData> aSim in neighbours)
|
||||||
{
|
{
|
||||||
Hashtable simProfileBlock = new Hashtable();
|
Hashtable simProfileBlock = new Hashtable();
|
||||||
simProfileBlock["x"] = aSim.Value.regionLocX.ToString();
|
simProfileBlock["x"] = aSim.Value.regionLocX.ToString();
|
||||||
|
@ -489,7 +489,7 @@ namespace OpenSim.Grid.GridServer
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SimProfileData simProfile;
|
RegionProfileData simProfile;
|
||||||
for (int x = xmin; x < xmax+1; x++)
|
for (int x = xmin; x < xmax+1; x++)
|
||||||
{
|
{
|
||||||
for (int y = ymin; y < ymax+1; y++)
|
for (int y = ymin; y < ymax+1; y++)
|
||||||
|
@ -564,7 +564,7 @@ namespace OpenSim.Grid.GridServer
|
||||||
{
|
{
|
||||||
string respstring = String.Empty;
|
string respstring = String.Empty;
|
||||||
|
|
||||||
SimProfileData TheSim;
|
RegionProfileData TheSim;
|
||||||
LLUUID UUID = new LLUUID(param);
|
LLUUID UUID = new LLUUID(param);
|
||||||
TheSim = getRegion(UUID);
|
TheSim = getRegion(UUID);
|
||||||
|
|
||||||
|
@ -598,11 +598,11 @@ namespace OpenSim.Grid.GridServer
|
||||||
public string RestSetSimMethod(string request, string path, string param)
|
public string RestSetSimMethod(string request, string path, string param)
|
||||||
{
|
{
|
||||||
Console.WriteLine("Processing region update via REST method");
|
Console.WriteLine("Processing region update via REST method");
|
||||||
SimProfileData TheSim;
|
RegionProfileData TheSim;
|
||||||
TheSim = getRegion(new LLUUID(param));
|
TheSim = getRegion(new LLUUID(param));
|
||||||
if ((TheSim) == null)
|
if ((TheSim) == null)
|
||||||
{
|
{
|
||||||
TheSim = new SimProfileData();
|
TheSim = new RegionProfileData();
|
||||||
LLUUID UUID = new LLUUID(param);
|
LLUUID UUID = new LLUUID(param);
|
||||||
TheSim.UUID = UUID;
|
TheSim.UUID = UUID;
|
||||||
TheSim.regionRecvKey = config.SimRecvKey;
|
TheSim.regionRecvKey = config.SimRecvKey;
|
||||||
|
|
|
@ -56,8 +56,8 @@ namespace OpenSim.Grid.UserServer
|
||||||
/// <param name="theUser">The user profile</param>
|
/// <param name="theUser">The user profile</param>
|
||||||
public override void CustomiseResponse(LoginResponse response, UserProfileData theUser)
|
public override void CustomiseResponse(LoginResponse response, UserProfileData theUser)
|
||||||
{
|
{
|
||||||
// Load information from the gridserver
|
// Load information from the gridserver
|
||||||
SimProfileData SimInfo = new SimProfileData();
|
RegionProfileData SimInfo = new RegionProfileData();
|
||||||
SimInfo = SimInfo.RequestSimProfileData(theUser.currentAgent.currentHandle, m_config.GridServerURL, m_config.GridSendKey, m_config.GridRecvKey);
|
SimInfo = SimInfo.RequestSimProfileData(theUser.currentAgent.currentHandle, m_config.GridServerURL, m_config.GridSendKey, m_config.GridRecvKey);
|
||||||
|
|
||||||
// Customise the response
|
// Customise the response
|
||||||
|
|
Loading…
Reference in New Issue