From 860b2a502f797e5822c6705d4639f370f3ac5861 Mon Sep 17 00:00:00 2001
From: John Hurliman
Date: Thu, 16 Sep 2010 17:30:46 -0700
Subject: Changed SceneObjectGroup to store parts with the fast and thread-safe
MapAndArray collection
---
OpenSim/Data/MSSQL/MSSQLSimulationData.cs | 4 ++--
OpenSim/Data/MySQL/MySQLSimulationData.cs | 2 +-
OpenSim/Data/SQLite/SQLiteSimulationData.cs | 2 +-
OpenSim/Data/SQLiteLegacy/SQLiteSimulationData.cs | 2 +-
OpenSim/Data/Tests/RegionTests.cs | 14 +++++++-------
5 files changed, 12 insertions(+), 12 deletions(-)
(limited to 'OpenSim/Data')
diff --git a/OpenSim/Data/MSSQL/MSSQLSimulationData.cs b/OpenSim/Data/MSSQL/MSSQLSimulationData.cs
index 8eae0a2..1da52b4 100644
--- a/OpenSim/Data/MSSQL/MSSQLSimulationData.cs
+++ b/OpenSim/Data/MSSQL/MSSQLSimulationData.cs
@@ -241,7 +241,7 @@ namespace OpenSim.Data.MSSQL
///
public void StoreObject(SceneObjectGroup obj, UUID regionUUID)
{
- _Log.DebugFormat("[MSSQL]: Adding/Changing SceneObjectGroup: {0} to region: {1}, object has {2} prims.", obj.UUID, regionUUID, obj.Children.Count);
+ _Log.DebugFormat("[MSSQL]: Adding/Changing SceneObjectGroup: {0} to region: {1}, object has {2} prims.", obj.UUID, regionUUID, obj.Parts.Length);
using (SqlConnection conn = new SqlConnection(m_connectionString))
{
@@ -250,7 +250,7 @@ namespace OpenSim.Data.MSSQL
try
{
- foreach (SceneObjectPart sceneObjectPart in obj.Children.Values)
+ foreach (SceneObjectPart sceneObjectPart in obj.Parts)
{
//Update prim
using (SqlCommand sqlCommand = conn.CreateCommand())
diff --git a/OpenSim/Data/MySQL/MySQLSimulationData.cs b/OpenSim/Data/MySQL/MySQLSimulationData.cs
index 87f6d07..3450e2f 100644
--- a/OpenSim/Data/MySQL/MySQLSimulationData.cs
+++ b/OpenSim/Data/MySQL/MySQLSimulationData.cs
@@ -144,7 +144,7 @@ namespace OpenSim.Data.MySQL
dbcon.Open();
MySqlCommand cmd = dbcon.CreateCommand();
- foreach (SceneObjectPart prim in obj.Children.Values)
+ foreach (SceneObjectPart prim in obj.Parts)
{
cmd.Parameters.Clear();
diff --git a/OpenSim/Data/SQLite/SQLiteSimulationData.cs b/OpenSim/Data/SQLite/SQLiteSimulationData.cs
index 3e9bc3f..ebe6da8 100644
--- a/OpenSim/Data/SQLite/SQLiteSimulationData.cs
+++ b/OpenSim/Data/SQLite/SQLiteSimulationData.cs
@@ -368,7 +368,7 @@ namespace OpenSim.Data.SQLite
lock (ds)
{
- foreach (SceneObjectPart prim in obj.Children.Values)
+ foreach (SceneObjectPart prim in obj.Parts)
{
// m_log.Info("[REGION DB]: Adding obj: " + obj.UUID + " to region: " + regionUUID);
addPrim(prim, obj.UUID, regionUUID);
diff --git a/OpenSim/Data/SQLiteLegacy/SQLiteSimulationData.cs b/OpenSim/Data/SQLiteLegacy/SQLiteSimulationData.cs
index 2dde926..ce18a42 100644
--- a/OpenSim/Data/SQLiteLegacy/SQLiteSimulationData.cs
+++ b/OpenSim/Data/SQLiteLegacy/SQLiteSimulationData.cs
@@ -335,7 +335,7 @@ namespace OpenSim.Data.SQLiteLegacy
lock (ds)
{
- foreach (SceneObjectPart prim in obj.Children.Values)
+ foreach (SceneObjectPart prim in obj.Parts)
{
// m_log.Info("[REGION DB]: Adding obj: " + obj.UUID + " to region: " + regionUUID);
addPrim(prim, obj.UUID, regionUUID);
diff --git a/OpenSim/Data/Tests/RegionTests.cs b/OpenSim/Data/Tests/RegionTests.cs
index a081462..23d498d 100644
--- a/OpenSim/Data/Tests/RegionTests.cs
+++ b/OpenSim/Data/Tests/RegionTests.cs
@@ -232,15 +232,15 @@ namespace OpenSim.Data.Tests
sog.AddPart(p2);
sog.AddPart(p3);
- SceneObjectPart[] parts = sog.GetParts();
+ SceneObjectPart[] parts = sog.Parts;
Assert.That(parts.Length,Is.EqualTo(4), "Assert.That(parts.Length,Is.EqualTo(4))");
db.StoreObject(sog, newregion);
List sogs = db.LoadObjects(newregion);
Assert.That(sogs.Count,Is.EqualTo(1), "Assert.That(sogs.Count,Is.EqualTo(1))");
SceneObjectGroup newsog = sogs[0];
-
- SceneObjectPart[] newparts = newsog.GetParts();
+
+ SceneObjectPart[] newparts = newsog.Parts;
Assert.That(newparts.Length,Is.EqualTo(4), "Assert.That(newparts.Length,Is.EqualTo(4))");
Assert.That(newsog.HasChildPrim(tmp0), "Assert.That(newsog.HasChildPrim(tmp0))");
@@ -560,7 +560,7 @@ namespace OpenSim.Data.Tests
}
SceneObjectGroup retsog = FindSOG("Test SOG", region4);
- SceneObjectPart[] parts = retsog.GetParts();
+ SceneObjectPart[] parts = retsog.Parts;
for (int i=0;i<30;i++)
{
SceneObjectPart cursop = mydic[parts[i].UUID];
@@ -607,7 +607,7 @@ namespace OpenSim.Data.Tests
sog.AddPart(p2);
sog.AddPart(p3);
- SceneObjectPart[] parts = sog.GetParts();
+ SceneObjectPart[] parts = sog.Parts;
Assert.That(parts.Length, Is.EqualTo(4), "Assert.That(parts.Length,Is.EqualTo(4))");
db.StoreObject(sog, newregion);
@@ -615,7 +615,7 @@ namespace OpenSim.Data.Tests
Assert.That(sogs.Count, Is.EqualTo(1), "Assert.That(sogs.Count,Is.EqualTo(1))");
SceneObjectGroup newsog = sogs[0];
- SceneObjectPart[] newparts = newsog.GetParts();
+ SceneObjectPart[] newparts = newsog.Parts;
Assert.That(newparts.Length, Is.EqualTo(4), "Assert.That(newparts.Length,Is.EqualTo(4))");
Assert.That(newsog, Constraints.PropertyCompareConstraint(sog)
@@ -625,7 +625,7 @@ namespace OpenSim.Data.Tests
.IgnoreProperty(x=>x.RegionHandle)
.IgnoreProperty(x=>x.RegionUUID)
.IgnoreProperty(x=>x.Scene)
- .IgnoreProperty(x=>x.Children)
+ .IgnoreProperty(x=>x.Parts)
.IgnoreProperty(x=>x.PassCollision)
.IgnoreProperty(x=>x.RootPart));
}
--
cgit v1.1