diff options
author | John Hurliman | 2010-09-16 17:30:46 -0700 |
---|---|---|
committer | John Hurliman | 2010-09-16 17:30:46 -0700 |
commit | 860b2a502f797e5822c6705d4639f370f3ac5861 (patch) | |
tree | 5a74ddbd626142e27f6c3439ea267b8ea348ce9c /OpenSim/Data | |
parent | Add the modules include line back that i dropped by mistake (diff) | |
download | opensim-SC_OLD-860b2a502f797e5822c6705d4639f370f3ac5861.zip opensim-SC_OLD-860b2a502f797e5822c6705d4639f370f3ac5861.tar.gz opensim-SC_OLD-860b2a502f797e5822c6705d4639f370f3ac5861.tar.bz2 opensim-SC_OLD-860b2a502f797e5822c6705d4639f370f3ac5861.tar.xz |
Changed SceneObjectGroup to store parts with the fast and thread-safe MapAndArray collection
Diffstat (limited to 'OpenSim/Data')
-rw-r--r-- | OpenSim/Data/MSSQL/MSSQLSimulationData.cs | 4 | ||||
-rw-r--r-- | OpenSim/Data/MySQL/MySQLSimulationData.cs | 2 | ||||
-rw-r--r-- | OpenSim/Data/SQLite/SQLiteSimulationData.cs | 2 | ||||
-rw-r--r-- | OpenSim/Data/SQLiteLegacy/SQLiteSimulationData.cs | 2 | ||||
-rw-r--r-- | OpenSim/Data/Tests/RegionTests.cs | 14 |
5 files changed, 12 insertions, 12 deletions
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 | |||
241 | /// <param name="regionUUID"></param> | 241 | /// <param name="regionUUID"></param> |
242 | public void StoreObject(SceneObjectGroup obj, UUID regionUUID) | 242 | public void StoreObject(SceneObjectGroup obj, UUID regionUUID) |
243 | { | 243 | { |
244 | _Log.DebugFormat("[MSSQL]: Adding/Changing SceneObjectGroup: {0} to region: {1}, object has {2} prims.", obj.UUID, regionUUID, obj.Children.Count); | 244 | _Log.DebugFormat("[MSSQL]: Adding/Changing SceneObjectGroup: {0} to region: {1}, object has {2} prims.", obj.UUID, regionUUID, obj.Parts.Length); |
245 | 245 | ||
246 | using (SqlConnection conn = new SqlConnection(m_connectionString)) | 246 | using (SqlConnection conn = new SqlConnection(m_connectionString)) |
247 | { | 247 | { |
@@ -250,7 +250,7 @@ namespace OpenSim.Data.MSSQL | |||
250 | 250 | ||
251 | try | 251 | try |
252 | { | 252 | { |
253 | foreach (SceneObjectPart sceneObjectPart in obj.Children.Values) | 253 | foreach (SceneObjectPart sceneObjectPart in obj.Parts) |
254 | { | 254 | { |
255 | //Update prim | 255 | //Update prim |
256 | using (SqlCommand sqlCommand = conn.CreateCommand()) | 256 | 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 | |||
144 | dbcon.Open(); | 144 | dbcon.Open(); |
145 | MySqlCommand cmd = dbcon.CreateCommand(); | 145 | MySqlCommand cmd = dbcon.CreateCommand(); |
146 | 146 | ||
147 | foreach (SceneObjectPart prim in obj.Children.Values) | 147 | foreach (SceneObjectPart prim in obj.Parts) |
148 | { | 148 | { |
149 | cmd.Parameters.Clear(); | 149 | cmd.Parameters.Clear(); |
150 | 150 | ||
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 | |||
368 | 368 | ||
369 | lock (ds) | 369 | lock (ds) |
370 | { | 370 | { |
371 | foreach (SceneObjectPart prim in obj.Children.Values) | 371 | foreach (SceneObjectPart prim in obj.Parts) |
372 | { | 372 | { |
373 | // m_log.Info("[REGION DB]: Adding obj: " + obj.UUID + " to region: " + regionUUID); | 373 | // m_log.Info("[REGION DB]: Adding obj: " + obj.UUID + " to region: " + regionUUID); |
374 | addPrim(prim, obj.UUID, regionUUID); | 374 | 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 | |||
335 | 335 | ||
336 | lock (ds) | 336 | lock (ds) |
337 | { | 337 | { |
338 | foreach (SceneObjectPart prim in obj.Children.Values) | 338 | foreach (SceneObjectPart prim in obj.Parts) |
339 | { | 339 | { |
340 | // m_log.Info("[REGION DB]: Adding obj: " + obj.UUID + " to region: " + regionUUID); | 340 | // m_log.Info("[REGION DB]: Adding obj: " + obj.UUID + " to region: " + regionUUID); |
341 | addPrim(prim, obj.UUID, regionUUID); | 341 | 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 | |||
232 | sog.AddPart(p2); | 232 | sog.AddPart(p2); |
233 | sog.AddPart(p3); | 233 | sog.AddPart(p3); |
234 | 234 | ||
235 | SceneObjectPart[] parts = sog.GetParts(); | 235 | SceneObjectPart[] parts = sog.Parts; |
236 | Assert.That(parts.Length,Is.EqualTo(4), "Assert.That(parts.Length,Is.EqualTo(4))"); | 236 | Assert.That(parts.Length,Is.EqualTo(4), "Assert.That(parts.Length,Is.EqualTo(4))"); |
237 | 237 | ||
238 | db.StoreObject(sog, newregion); | 238 | db.StoreObject(sog, newregion); |
239 | List<SceneObjectGroup> sogs = db.LoadObjects(newregion); | 239 | List<SceneObjectGroup> sogs = db.LoadObjects(newregion); |
240 | Assert.That(sogs.Count,Is.EqualTo(1), "Assert.That(sogs.Count,Is.EqualTo(1))"); | 240 | Assert.That(sogs.Count,Is.EqualTo(1), "Assert.That(sogs.Count,Is.EqualTo(1))"); |
241 | SceneObjectGroup newsog = sogs[0]; | 241 | SceneObjectGroup newsog = sogs[0]; |
242 | 242 | ||
243 | SceneObjectPart[] newparts = newsog.GetParts(); | 243 | SceneObjectPart[] newparts = newsog.Parts; |
244 | Assert.That(newparts.Length,Is.EqualTo(4), "Assert.That(newparts.Length,Is.EqualTo(4))"); | 244 | Assert.That(newparts.Length,Is.EqualTo(4), "Assert.That(newparts.Length,Is.EqualTo(4))"); |
245 | 245 | ||
246 | Assert.That(newsog.HasChildPrim(tmp0), "Assert.That(newsog.HasChildPrim(tmp0))"); | 246 | Assert.That(newsog.HasChildPrim(tmp0), "Assert.That(newsog.HasChildPrim(tmp0))"); |
@@ -560,7 +560,7 @@ namespace OpenSim.Data.Tests | |||
560 | } | 560 | } |
561 | 561 | ||
562 | SceneObjectGroup retsog = FindSOG("Test SOG", region4); | 562 | SceneObjectGroup retsog = FindSOG("Test SOG", region4); |
563 | SceneObjectPart[] parts = retsog.GetParts(); | 563 | SceneObjectPart[] parts = retsog.Parts; |
564 | for (int i=0;i<30;i++) | 564 | for (int i=0;i<30;i++) |
565 | { | 565 | { |
566 | SceneObjectPart cursop = mydic[parts[i].UUID]; | 566 | SceneObjectPart cursop = mydic[parts[i].UUID]; |
@@ -607,7 +607,7 @@ namespace OpenSim.Data.Tests | |||
607 | sog.AddPart(p2); | 607 | sog.AddPart(p2); |
608 | sog.AddPart(p3); | 608 | sog.AddPart(p3); |
609 | 609 | ||
610 | SceneObjectPart[] parts = sog.GetParts(); | 610 | SceneObjectPart[] parts = sog.Parts; |
611 | Assert.That(parts.Length, Is.EqualTo(4), "Assert.That(parts.Length,Is.EqualTo(4))"); | 611 | Assert.That(parts.Length, Is.EqualTo(4), "Assert.That(parts.Length,Is.EqualTo(4))"); |
612 | 612 | ||
613 | db.StoreObject(sog, newregion); | 613 | db.StoreObject(sog, newregion); |
@@ -615,7 +615,7 @@ namespace OpenSim.Data.Tests | |||
615 | Assert.That(sogs.Count, Is.EqualTo(1), "Assert.That(sogs.Count,Is.EqualTo(1))"); | 615 | Assert.That(sogs.Count, Is.EqualTo(1), "Assert.That(sogs.Count,Is.EqualTo(1))"); |
616 | SceneObjectGroup newsog = sogs[0]; | 616 | SceneObjectGroup newsog = sogs[0]; |
617 | 617 | ||
618 | SceneObjectPart[] newparts = newsog.GetParts(); | 618 | SceneObjectPart[] newparts = newsog.Parts; |
619 | Assert.That(newparts.Length, Is.EqualTo(4), "Assert.That(newparts.Length,Is.EqualTo(4))"); | 619 | Assert.That(newparts.Length, Is.EqualTo(4), "Assert.That(newparts.Length,Is.EqualTo(4))"); |
620 | 620 | ||
621 | Assert.That(newsog, Constraints.PropertyCompareConstraint(sog) | 621 | Assert.That(newsog, Constraints.PropertyCompareConstraint(sog) |
@@ -625,7 +625,7 @@ namespace OpenSim.Data.Tests | |||
625 | .IgnoreProperty(x=>x.RegionHandle) | 625 | .IgnoreProperty(x=>x.RegionHandle) |
626 | .IgnoreProperty(x=>x.RegionUUID) | 626 | .IgnoreProperty(x=>x.RegionUUID) |
627 | .IgnoreProperty(x=>x.Scene) | 627 | .IgnoreProperty(x=>x.Scene) |
628 | .IgnoreProperty(x=>x.Children) | 628 | .IgnoreProperty(x=>x.Parts) |
629 | .IgnoreProperty(x=>x.PassCollision) | 629 | .IgnoreProperty(x=>x.PassCollision) |
630 | .IgnoreProperty(x=>x.RootPart)); | 630 | .IgnoreProperty(x=>x.RootPart)); |
631 | } | 631 | } |