aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-04-22 19:51:51 +0100
committerJustin Clark-Casey (justincc)2012-04-22 19:51:51 +0100
commit8205fe79ceaeebd31509a044005bf27d226dbe07 (patch)
treeef0c0111f800e61b3365048431ed8689b922423f /OpenSim/Region/Framework
parentComment out spurious Body != IntPtr.Zero code after disableBody(), since disa... (diff)
downloadopensim-SC_OLD-8205fe79ceaeebd31509a044005bf27d226dbe07.zip
opensim-SC_OLD-8205fe79ceaeebd31509a044005bf27d226dbe07.tar.gz
opensim-SC_OLD-8205fe79ceaeebd31509a044005bf27d226dbe07.tar.bz2
opensim-SC_OLD-8205fe79ceaeebd31509a044005bf27d226dbe07.tar.xz
Fix bug where setting phantom on a prim would result in a server log message rather than setting phantom.
This was an oversight when removing some race conditions from PhysicsActor setting recently. Regression tests extended to probe this code path. Extending regression tests required implementation of a BasicPhysicsPrim (there was none before). However, BasicPhysics plugin is still of no current practical use other than to fill in as a component for other parts of regression testing.
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs14
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs9
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/SceneObjectStatusTests.cs2
3 files changed, 13 insertions, 12 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index e488fe1..a87dfb7 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -684,8 +684,8 @@ namespace OpenSim.Region.Framework.Scenes
684 //Animation states 684 //Animation states
685 m_useFlySlow = startupConfig.GetBoolean("enableflyslow", false); 685 m_useFlySlow = startupConfig.GetBoolean("enableflyslow", false);
686 686
687 PhysicalPrims = startupConfig.GetBoolean("physical_prim", true); 687 PhysicalPrims = startupConfig.GetBoolean("physical_prim", PhysicalPrims);
688 CollidablePrims = startupConfig.GetBoolean("collidable_prim", true); 688 CollidablePrims = startupConfig.GetBoolean("collidable_prim", CollidablePrims);
689 689
690 m_maxNonphys = startupConfig.GetFloat("NonphysicalPrimMax", m_maxNonphys); 690 m_maxNonphys = startupConfig.GetFloat("NonphysicalPrimMax", m_maxNonphys);
691 if (RegionInfo.NonphysPrimMax > 0) 691 if (RegionInfo.NonphysPrimMax > 0)
@@ -800,13 +800,11 @@ namespace OpenSim.Region.Framework.Scenes
800 StatsReporter.OnStatsIncorrect += m_sceneGraph.RecalculateStats; 800 StatsReporter.OnStatsIncorrect += m_sceneGraph.RecalculateStats;
801 } 801 }
802 802
803 /// <summary>
804 /// Mock constructor for scene group persistency unit tests.
805 /// SceneObjectGroup RegionId property is delegated to Scene.
806 /// </summary>
807 /// <param name="regInfo"></param>
808 public Scene(RegionInfo regInfo) 803 public Scene(RegionInfo regInfo)
809 { 804 {
805 PhysicalPrims = true;
806 CollidablePrims = true;
807
810 BordersLocked = true; 808 BordersLocked = true;
811 Border northBorder = new Border(); 809 Border northBorder = new Border();
812 northBorder.BorderLine = new Vector3(float.MinValue, float.MaxValue, (int)Constants.RegionSize); //<--- 810 northBorder.BorderLine = new Vector3(float.MinValue, float.MaxValue, (int)Constants.RegionSize); //<---
@@ -833,8 +831,6 @@ namespace OpenSim.Region.Framework.Scenes
833 m_eventManager = new EventManager(); 831 m_eventManager = new EventManager();
834 832
835 m_permissions = new ScenePermissions(this); 833 m_permissions = new ScenePermissions(this);
836
837// m_lastUpdate = Util.EnvironmentTickCount();
838 } 834 }
839 835
840 #endregion 836 #endregion
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 1592131..4bec2d4 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -4290,7 +4290,10 @@ namespace OpenSim.Region.Framework.Scenes
4290 AddFlag(PrimFlags.Phantom); 4290 AddFlag(PrimFlags.Phantom);
4291 4291
4292 if (PhysActor != null) 4292 if (PhysActor != null)
4293 {
4293 RemoveFromPhysics(); 4294 RemoveFromPhysics();
4295 pa = null;
4296 }
4294 } 4297 }
4295 else // Not phantom 4298 else // Not phantom
4296 { 4299 {
@@ -4356,7 +4359,7 @@ namespace OpenSim.Region.Framework.Scenes
4356 { 4359 {
4357 pa.SetVolumeDetect(1); 4360 pa.SetVolumeDetect(1);
4358 AddFlag(PrimFlags.Phantom); // We set this flag also if VD is active 4361 AddFlag(PrimFlags.Phantom); // We set this flag also if VD is active
4359 this.VolumeDetectActive = true; 4362 VolumeDetectActive = true;
4360 } 4363 }
4361 } 4364 }
4362 else 4365 else
@@ -4364,9 +4367,9 @@ namespace OpenSim.Region.Framework.Scenes
4364 // Remove VolumeDetect in any case. Note, it's safe to call SetVolumeDetect as often as you like 4367 // Remove VolumeDetect in any case. Note, it's safe to call SetVolumeDetect as often as you like
4365 // (mumbles, well, at least if you have infinte CPU powers :-)) 4368 // (mumbles, well, at least if you have infinte CPU powers :-))
4366 if (pa != null) 4369 if (pa != null)
4367 PhysActor.SetVolumeDetect(0); 4370 pa.SetVolumeDetect(0);
4368 4371
4369 this.VolumeDetectActive = false; 4372 VolumeDetectActive = false;
4370 } 4373 }
4371 4374
4372 if (SetTemporary) 4375 if (SetTemporary)
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectStatusTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectStatusTests.cs
index 882031c..51751ef 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectStatusTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectStatusTests.cs
@@ -62,6 +62,8 @@ namespace OpenSim.Region.Framework.Scenes.Tests
62 { 62 {
63 TestHelpers.InMethod(); 63 TestHelpers.InMethod();
64 64
65 m_scene.AddSceneObject(m_so1);
66
65 SceneObjectPart rootPart = m_so1.RootPart; 67 SceneObjectPart rootPart = m_so1.RootPart;
66 Assert.That(rootPart.Flags, Is.EqualTo(PrimFlags.None)); 68 Assert.That(rootPart.Flags, Is.EqualTo(PrimFlags.None));
67 69