From 1c503ad27098a42eb1b3cf2c2be1954d293dfa4d Mon Sep 17 00:00:00 2001 From: MW Date: Tue, 28 Aug 2007 15:27:27 +0000 Subject: Attempt to track down the loading prims error. So Temporary fix to see if it is what we think. --- .../MonoSqliteDataStore.cs | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (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 c4fafde..0eb8412 100644 --- a/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs +++ b/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs @@ -122,6 +122,8 @@ namespace OpenSim.DataStore.MonoSqliteStorage public List LoadObjects(LLUUID regionUUID) { Dictionary createdObjects = new Dictionary(); + Dictionary loadedParentlessParts = new Dictionary(); + List retvals = new List(); DataTable prims = ds.Tables["prims"]; @@ -168,8 +170,25 @@ namespace OpenSim.DataStore.MonoSqliteStorage Console.WriteLine("No shape found for prim in storage, so setting default box shape"); prim.Shape = BoxShape.Default; } - createdObjects[new LLUUID(objID)].AddPart(prim); + if (createdObjects.ContainsKey(new LLUUID(objID))) + { + createdObjects[new LLUUID(objID)].AddPart(prim); + } + else + { + loadedParentlessParts.Add(new LLUUID(objID), prim); + } } + + foreach (KeyValuePair kvp in loadedParentlessParts) + { + if (createdObjects.ContainsKey(kvp.Key)) + { + createdObjects[kvp.Key].AddPart(kvp.Value); + } + } + + loadedParentlessParts.Clear(); } MainLog.Instance.Verbose("DATASTORE", "Sqlite - LoadObjects found " + prims.Rows.Count + " primitives"); -- cgit v1.1