* Yet more inventory shelling

* Very initial MySQL work done
* Refactored some of the MySQL code - functions which are passed a reader are no longer getX() but now readX().
zircon^2
Adam Frisby 2007-05-31 14:05:19 +00:00
parent c955e2fe9b
commit a0305888bc
5 changed files with 76 additions and 24 deletions

View File

@ -62,7 +62,7 @@ namespace OpenGrid.Framework.Data.MySQL
List<SimProfileData> rows = new List<SimProfileData>();
while ((row = database.getSimRow(reader)) != null)
while ((row = database.readSimRow(reader)) != null)
{
rows.Add(row);
}
@ -98,7 +98,7 @@ namespace OpenGrid.Framework.Data.MySQL
System.Data.IDbCommand result = database.Query("SELECT * FROM regions WHERE regionHandle = ?handle", param);
System.Data.IDataReader reader = result.ExecuteReader();
SimProfileData row = database.getSimRow(reader);
SimProfileData row = database.readSimRow(reader);
reader.Close();
result.Dispose();
@ -130,7 +130,7 @@ namespace OpenGrid.Framework.Data.MySQL
System.Data.IDbCommand result = database.Query("SELECT * FROM regions WHERE uuid = ?uuid", param);
System.Data.IDataReader reader = result.ExecuteReader();
SimProfileData row = database.getSimRow(reader);
SimProfileData row = database.readSimRow(reader);
reader.Close();
result.Dispose();

View File

@ -1,10 +1,11 @@
using System;
using System.Collections.Generic;
using System.Text;
using libsecondlife;
namespace OpenGrid.Framework.Data.MySQL
{
class MySQLInventoryData
class MySQLInventoryData : IInventoryData
{
public MySQLManager database;
@ -23,7 +24,7 @@ namespace OpenGrid.Framework.Data.MySQL
public string getName()
{
return "MySQL Logdata Interface";
return "MySQL Inventory Data Interface";
}
public void Close()
@ -35,5 +36,30 @@ namespace OpenGrid.Framework.Data.MySQL
{
return "0.1";
}
public List<InventoryItemBase> getInventoryInFolder(LLUUID folderID)
{
return null;
}
public List<InventoryFolderBase> getUserRootFolders(LLUUID user)
{
return null;
}
public List<InventoryFolderBase> getInventoryFolders(LLUUID parentID)
{
return null;
}
public InventoryItemBase getInventoryItem(LLUUID item)
{
return null;
}
public InventoryFolderBase getInventoryFolder(LLUUID folder)
{
return null;
}
}
}

View File

@ -137,7 +137,7 @@ namespace OpenGrid.Framework.Data.MySQL
}
}
public SimProfileData getSimRow(IDataReader reader)
public SimProfileData readSimRow(IDataReader reader)
{
SimProfileData retval = new SimProfileData();
@ -199,7 +199,7 @@ namespace OpenGrid.Framework.Data.MySQL
return retval;
}
public UserAgentData getAgentRow(IDataReader reader)
public UserAgentData readAgentRow(IDataReader reader)
{
UserAgentData retval = new UserAgentData();
@ -231,7 +231,7 @@ namespace OpenGrid.Framework.Data.MySQL
return retval;
}
public UserProfileData getUserRow(IDataReader reader)
public UserProfileData readUserRow(IDataReader reader)
{
UserProfileData retval = new UserProfileData();
@ -277,6 +277,32 @@ namespace OpenGrid.Framework.Data.MySQL
return retval;
}
public List<InventoryFolderBase> readInventoryInFolder(IDataReader reader)
{
List<InventoryFolderBase> rows = new List<InventoryFolderBase>();
while(reader.Read())
{
try
{
InventoryFolderBase retval = new InventoryFolderBase();
retval.agentID = new libsecondlife.LLUUID((string)reader["agentID"]);
retval.parentID = new libsecondlife.LLUUID((string)reader["parentFolderID"]);
retval.folderID = new libsecondlife.LLUUID((string)reader["folderID"]);
retval.name = (string)reader["folderName"];
rows.Add(retval);
}
catch (Exception e)
{
Console.WriteLine(e.ToString());
}
}
return rows;
}
public bool insertLogRow(string serverDaemon, string target, string methodCall, string arguments, int priority, string logMessage)
{
string sql = "INSERT INTO logs (`target`, `server`, `method`, `arguments`, `priority`, `message`) VALUES ";

View File

@ -41,7 +41,7 @@ namespace OpenGrid.Framework.Data.MySQL
System.Data.IDbCommand result = database.Query("SELECT * FROM users WHERE username = ?first AND lastname = ?second", param);
System.Data.IDataReader reader = result.ExecuteReader();
UserProfileData row = database.getUserRow(reader);
UserProfileData row = database.readUserRow(reader);
reader.Close();
result.Dispose();
@ -69,7 +69,7 @@ namespace OpenGrid.Framework.Data.MySQL
System.Data.IDbCommand result = database.Query("SELECT * FROM users WHERE UUID = ?uuid", param);
System.Data.IDataReader reader = result.ExecuteReader();
UserProfileData row = database.getUserRow(reader);
UserProfileData row = database.readUserRow(reader);
reader.Close();
result.Dispose();
@ -108,7 +108,7 @@ namespace OpenGrid.Framework.Data.MySQL
System.Data.IDbCommand result = database.Query("SELECT * FROM agents WHERE UUID = ?uuid", param);
System.Data.IDataReader reader = result.ExecuteReader();
UserAgentData row = database.getAgentRow(reader);
UserAgentData row = database.readAgentRow(reader);
reader.Close();
result.Dispose();

View File

@ -7,23 +7,23 @@ namespace OpenGrid.Framework.Data
{
public class InventoryItemBase
{
LLUUID inventoryID;
LLUUID assetID;
int type;
LLUUID parentFolderID;
LLUUID avatarID;
string inventoryName;
string inventoryDescription;
uint inventoryNextPermissions;
uint inventoryCurrentPermissions;
public LLUUID inventoryID;
public LLUUID assetID;
public int type;
public LLUUID parentFolderID;
public LLUUID avatarID;
public string inventoryName;
public string inventoryDescription;
public uint inventoryNextPermissions;
public uint inventoryCurrentPermissions;
}
public class InventoryFolderBase
{
string name;
LLUUID agentID;
LLUUID parentID;
LLUUID folderID;
public string name;
public LLUUID agentID;
public LLUUID parentID;
public LLUUID folderID;
}
public interface IInventoryData