From f6251ce810e0bebe68d08a8e4b20a9dfc3fe1af6 Mon Sep 17 00:00:00 2001 From: Kunnis Date: Sat, 15 Aug 2009 06:08:36 -0500 Subject: * Modified SQLite/SQLiteInventoryStore.cs to not throw if the inventory row does not exist, to match the mysql behavior. * Modified SQLite/SQLiteRegionData.cs to only persist temporary items following the same rules mysql uses. * Added another ignore to the inventory test that was missing. * Added a few more ignores to the RegionTest that the first version of my test were missing. * Added ignoring the root Folder ID, which is set by the inventory system. * Added several improvements to the PropertyCompareConstraint: Protection against infinite loops, added IComparable (for UUID) and moved IComparable before the property matching. * Fixed a bug where I was saving the inside of the ignore expression instead of the outside of it. --- OpenSim/Data/SQLite/SQLiteRegionData.cs | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) (limited to 'OpenSim/Data/SQLite/SQLiteRegionData.cs') diff --git a/OpenSim/Data/SQLite/SQLiteRegionData.cs b/OpenSim/Data/SQLite/SQLiteRegionData.cs index d2548c2..0259ac5 100644 --- a/OpenSim/Data/SQLite/SQLiteRegionData.cs +++ b/OpenSim/Data/SQLite/SQLiteRegionData.cs @@ -307,26 +307,21 @@ namespace OpenSim.Data.SQLite /// the region UUID public void StoreObject(SceneObjectGroup obj, UUID regionUUID) { + uint flags = obj.RootPart.GetEffectiveObjectFlags(); + + // Eligibility check + // + if ((flags & (uint)PrimFlags.Temporary) != 0) + return; + if ((flags & (uint)PrimFlags.TemporaryOnRez) != 0) + return; + lock (ds) { foreach (SceneObjectPart prim in obj.Children.Values) { - if ((prim.GetEffectiveObjectFlags() & (uint)PrimFlags.Temporary) == 0 - && (prim.GetEffectiveObjectFlags() & (uint)PrimFlags.TemporaryOnRez) == 0) - { - m_log.Info("[REGION DB]: Adding obj: " + obj.UUID + " to region: " + regionUUID); - addPrim(prim, obj.UUID, regionUUID); - } - else if (prim.Stopped) - { - //m_log.Info("[DATASTORE]: " + - //"Adding stopped obj: " + obj.UUID + " to region: " + regionUUID); - //addPrim(prim, obj.UUID.ToString(), regionUUID.ToString()); - } - else - { - // m_log.Info("[DATASTORE]: Ignoring Physical obj: " + obj.UUID + " in region: " + regionUUID); - } + m_log.Info("[REGION DB]: Adding obj: " + obj.UUID + " to region: " + regionUUID); + addPrim(prim, obj.UUID, regionUUID); } } @@ -1130,7 +1125,7 @@ namespace OpenSim.Data.SQLite // explicit conversion of integers is required, which sort // of sucks. No idea if there is a shortcut here or not. prim.CreationDate = Convert.ToInt32(row["CreationDate"]); - prim.Name = (String) row["Name"]; + prim.Name = row["Name"] == DBNull.Value ? string.Empty : (string)row["Name"]; // various text fields prim.Text = (String) row["Text"]; prim.Color = Color.FromArgb(Convert.ToInt32(row["ColorA"]), -- cgit v1.1