* Commented out GridManager lines until they are checked into SVN

* Added new GetProfilesInRange(x,y,x,y) data function to return sim profiles between certain coordinates (for use with World Map information, etc). Implemented in GridServer.Data.Mysql - stub functions placed in other data providers.
zircon^2
Adam Frisby 2007-05-14 16:13:31 +00:00
parent 59e6718482
commit 3ee195b1e6
7 changed files with 64 additions and 3 deletions

View File

@ -15,6 +15,11 @@ namespace OpenGrid.Framework.Data.DB4o
manager = new DB4oGridManager("gridserver.yap"); manager = new DB4oGridManager("gridserver.yap");
} }
public SimProfileData[] GetProfilesInRange(uint a, uint b, uint c, uint d)
{
return null;
}
public SimProfileData GetProfileByHandle(ulong handle) { public SimProfileData GetProfileByHandle(ulong handle) {
lock (manager.simProfiles) lock (manager.simProfiles)
{ {

View File

@ -35,6 +35,11 @@ namespace OpenGrid.Framework.Data.MSSQL
return "0.1"; return "0.1";
} }
public SimProfileData[] GetProfilesInRange(uint a, uint b, uint c, uint d)
{
return null;
}
/// <summary> /// <summary>
/// Returns a sim profile from it's location /// Returns a sim profile from it's location
/// </summary> /// </summary>

View File

@ -14,7 +14,7 @@ namespace OpenGrid.Framework.Data.MySQL
/// </summary> /// </summary>
public void Initialise() public void Initialise()
{ {
database = new MySQLManager("server", "database", "username", "password", "false"); database = new MySQLManager("localhost", "database", "username", "password", "false");
} }
/// <summary> /// <summary>
@ -35,6 +35,43 @@ namespace OpenGrid.Framework.Data.MySQL
return "0.1"; return "0.1";
} }
public SimProfileData[] GetProfilesInRange(uint xmin, uint ymin, uint xmax, uint ymax)
{
try
{
lock (database)
{
Dictionary<string, string> param = new Dictionary<string, string>();
param["?xmin"] = xmin.ToString();
param["?ymin"] = ymin.ToString();
param["?xmax"] = xmax.ToString();
param["?ymax"] = ymax.ToString();
System.Data.IDbCommand result = database.Query("SELECT * FROM regions WHERE locX >= ?xmin AND locX <= ?xmax AND locY >= ?ymin AND locY <= ?ymax", param);
System.Data.IDataReader reader = result.ExecuteReader();
SimProfileData row;
List<SimProfileData> rows = new List<SimProfileData>();
while ((row = database.getSimRow(reader)) != null)
{
rows.Add(row);
}
reader.Close();
result.Dispose();
return rows.ToArray();
}
}
catch (Exception e)
{
Console.WriteLine(e.ToString());
return null;
}
}
/// <summary> /// <summary>
/// Returns a sim profile from it's location /// Returns a sim profile from it's location
/// </summary> /// </summary>

View File

@ -121,7 +121,6 @@ namespace OpenGrid.Framework.Data.MySQL
} }
else else
{ {
throw new Exception("Unable to find region at coordinates");
return null; return null;
} }
return retval; return retval;

View File

@ -35,6 +35,11 @@ namespace OpenGrid.Framework.Data.SQLite
return "0.1"; return "0.1";
} }
public SimProfileData[] GetProfilesInRange(uint a, uint b, uint c, uint d)
{
return null;
}
/// <summary> /// <summary>
/// Returns a sim profile from it's location /// Returns a sim profile from it's location
/// </summary> /// </summary>

View File

@ -31,6 +31,16 @@ namespace OpenGrid.Framework.Data
/// <returns>A sim profile</returns> /// <returns>A sim profile</returns>
SimProfileData GetProfileByLLUUID(libsecondlife.LLUUID UUID); SimProfileData GetProfileByLLUUID(libsecondlife.LLUUID UUID);
/// <summary>
/// Returns all profiles within the specified range
/// </summary>
/// <param name="Xmin">Minimum sim coordinate (X)</param>
/// <param name="Ymin">Minimum sim coordinate (Y)</param>
/// <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);
/// <summary> /// <summary>
/// Authenticates a sim by use of it's recv key. /// Authenticates a sim by use of it's recv key.
/// WARNING: Insecure /// WARNING: Insecure

View File

@ -115,7 +115,7 @@ namespace OpenGridServices.GridServer
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Main.cs:Startup() - Starting HTTP process"); m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Main.cs:Startup() - Starting HTTP process");
BaseHttpServer httpServer = new BaseHttpServer(8001); BaseHttpServer httpServer = new BaseHttpServer(8001);
GridManagementAgent GridManagerAgent = new GridManagementAgent(httpServer,"gridserver",Cfg.SimSendKey,Cfg.SimRecvKey,managercallback); //GridManagementAgent GridManagerAgent = new GridManagementAgent(httpServer,"gridserver",Cfg.SimSendKey,Cfg.SimRecvKey,managercallback);
httpServer.AddXmlRPCHandler("simulator_login", m_gridManager.XmlRpcLoginToSimulatorMethod); httpServer.AddXmlRPCHandler("simulator_login", m_gridManager.XmlRpcLoginToSimulatorMethod);