From 7cedb098699fe31ac906c95d1b1fd906dd502955 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Sun, 6 Jan 2008 01:16:06 +0000 Subject: Prim inventory phase 4. Properly recover the prim folder ID from storage. Scripts now show up in prim inventories after region restart. Probably doesn't yet work for any items other than scripts. Still some work to do. No user functionality exposed. Not yet user tieable into normal code. --- .../OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region/Storage') diff --git a/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs b/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs index f9ab0c5..8bad730 100644 --- a/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs +++ b/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs @@ -340,18 +340,24 @@ namespace OpenSim.DataStore.MonoSqlite String sql = String.Format("primID = '{0}'", prim.UUID.ToString()); DataRow[] dbItemRows = dbItems.Select(sql); - IDictionary inventory - = new Dictionary(); + IList inventory = new List(); foreach (DataRow row in dbItemRows) { SceneObjectPart.TaskInventoryItem item = buildItem(row); - inventory.Add(item.item_id, item); + inventory.Add(item); MainLog.Instance.Verbose("DATASTORE", "Restored item {0}, {1}", item.name, item.item_id); } - prim.TaskInventory = inventory; + prim.AddInventoryItems(inventory); + + // XXX A nasty little hack to recover the folder id for the prim (which is currently stored in + // every item). This data should really be stored in the prim table itself. + if (dbItemRows.Length > 0) + { + prim.FolderID = inventory[0].parent_id; + } } public void StoreTerrain(double[,] ter, LLUUID regionID) -- cgit v1.1