implement something in sqlite inventory that wasn't before

not sure how we missed this function
afrisby
Sean Dague 2007-09-27 13:44:45 +00:00
parent 8143c597fc
commit 5b4d631d34
1 changed files with 7 additions and 3 deletions

View File

@ -65,7 +65,7 @@ namespace OpenSim.Framework.Data.SQLite
return; return;
} }
public InventoryItemBase BuildItem(DataRow row) public InventoryItemBase buildItem(DataRow row)
{ {
InventoryItemBase item = new InventoryItemBase(); InventoryItemBase item = new InventoryItemBase();
item.inventoryID = new LLUUID((string)row["UUID"]); item.inventoryID = new LLUUID((string)row["UUID"]);
@ -183,7 +183,7 @@ namespace OpenSim.Framework.Data.SQLite
DataRow[] rows = inventoryItemTable.Select(selectExp); DataRow[] rows = inventoryItemTable.Select(selectExp);
foreach (DataRow row in rows) foreach (DataRow row in rows)
{ {
retval.Add(BuildItem(row)); retval.Add(buildItem(row));
} }
return retval; return retval;
@ -234,6 +234,10 @@ namespace OpenSim.Framework.Data.SQLite
/// <returns>A class containing item information</returns> /// <returns>A class containing item information</returns>
public InventoryItemBase getInventoryItem(LLUUID item) public InventoryItemBase getInventoryItem(LLUUID item)
{ {
DataRows[] rows = ds.Tables["inventoryitems"].Find(item);
if (rows.Length == 1)
return this.buildItem(rows[0]);
else
return null; return null;
} }