diff options
author | Justin Clark-Casey (justincc) | 2011-08-05 23:42:05 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-08-05 23:42:05 +0100 |
commit | ba89fc3aa1833c0fd6b5518d85ca966768597c6c (patch) | |
tree | 2713dcb4797e690e6edc21decfc6213d11b19230 /OpenSim/Region/Framework | |
parent | Get "show region" command in GridService to show grid co-ordinates rather tha... (diff) | |
download | opensim-SC_OLD-ba89fc3aa1833c0fd6b5518d85ca966768597c6c.zip opensim-SC_OLD-ba89fc3aa1833c0fd6b5518d85ca966768597c6c.tar.gz opensim-SC_OLD-ba89fc3aa1833c0fd6b5518d85ca966768597c6c.tar.bz2 opensim-SC_OLD-ba89fc3aa1833c0fd6b5518d85ca966768597c6c.tar.xz |
Add regression test for setting phantom status on a scene object. This is not yet complete.
Diffstat (limited to '')
3 files changed, 78 insertions, 13 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 57baa99..3b6a458 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -2253,7 +2253,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2253 | /// <param name="objectGroup"></param> | 2253 | /// <param name="objectGroup"></param> |
2254 | public virtual void DetachFromBackup() | 2254 | public virtual void DetachFromBackup() |
2255 | { | 2255 | { |
2256 | if (m_isBackedUp) | 2256 | if (m_isBackedUp && Scene != null) |
2257 | m_scene.EventManager.OnBackup -= ProcessBackup; | 2257 | m_scene.EventManager.OnBackup -= ProcessBackup; |
2258 | 2258 | ||
2259 | m_isBackedUp = false; | 2259 | m_isBackedUp = false; |
@@ -2520,7 +2520,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2520 | { | 2520 | { |
2521 | SceneObjectPart selectionPart = GetChildPart(localID); | 2521 | SceneObjectPart selectionPart = GetChildPart(localID); |
2522 | 2522 | ||
2523 | if (SetTemporary) | 2523 | if (SetTemporary && Scene != null) |
2524 | { | 2524 | { |
2525 | DetachFromBackup(); | 2525 | DetachFromBackup(); |
2526 | // Remove from database and parcel prim count | 2526 | // Remove from database and parcel prim count |
@@ -2532,15 +2532,19 @@ namespace OpenSim.Region.Framework.Scenes | |||
2532 | if (selectionPart != null) | 2532 | if (selectionPart != null) |
2533 | { | 2533 | { |
2534 | SceneObjectPart[] parts = m_parts.GetArray(); | 2534 | SceneObjectPart[] parts = m_parts.GetArray(); |
2535 | for (int i = 0; i < parts.Length; i++) | 2535 | |
2536 | if (Scene != null) | ||
2536 | { | 2537 | { |
2537 | SceneObjectPart part = parts[i]; | 2538 | for (int i = 0; i < parts.Length; i++) |
2538 | if (part.Scale.X > m_scene.RegionInfo.PhysPrimMax || | ||
2539 | part.Scale.Y > m_scene.RegionInfo.PhysPrimMax || | ||
2540 | part.Scale.Z > m_scene.RegionInfo.PhysPrimMax) | ||
2541 | { | 2539 | { |
2542 | UsePhysics = false; // Reset physics | 2540 | SceneObjectPart part = parts[i]; |
2543 | break; | 2541 | if (part.Scale.X > m_scene.RegionInfo.PhysPrimMax || |
2542 | part.Scale.Y > m_scene.RegionInfo.PhysPrimMax || | ||
2543 | part.Scale.Z > m_scene.RegionInfo.PhysPrimMax) | ||
2544 | { | ||
2545 | UsePhysics = false; // Reset physics | ||
2546 | break; | ||
2547 | } | ||
2544 | } | 2548 | } |
2545 | } | 2549 | } |
2546 | 2550 | ||
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 90ad34e..e8a1070 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -261,12 +261,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
261 | } | 261 | } |
262 | protected SceneObjectPartInventory m_inventory; | 262 | protected SceneObjectPartInventory m_inventory; |
263 | 263 | ||
264 | |||
265 | public bool Undoing; | 264 | public bool Undoing; |
266 | |||
267 | 265 | ||
268 | public bool IgnoreUndoUpdate = false; | 266 | public bool IgnoreUndoUpdate = false; |
269 | |||
270 | 267 | ||
271 | private PrimFlags LocalFlags; | 268 | private PrimFlags LocalFlags; |
272 | 269 | ||
@@ -4645,6 +4642,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
4645 | 4642 | ||
4646 | ParentGroup.HasGroupChanged = true; | 4643 | ParentGroup.HasGroupChanged = true; |
4647 | ScheduleFullUpdate(); | 4644 | ScheduleFullUpdate(); |
4645 | |||
4646 | // m_log.DebugFormat("[SCENE OBJECT PART]: Updated PrimFlags on {0} {1} to {2}", Name, LocalId, Flags); | ||
4648 | } | 4647 | } |
4649 | 4648 | ||
4650 | public void UpdateRotation(Quaternion rot) | 4649 | public void UpdateRotation(Quaternion rot) |
@@ -4864,7 +4863,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4864 | // m_parentGroup.Scene.EventManager.OnScriptTimerEvent -= handleTimerAccounting; | 4863 | // m_parentGroup.Scene.EventManager.OnScriptTimerEvent -= handleTimerAccounting; |
4865 | //} | 4864 | //} |
4866 | 4865 | ||
4867 | LocalFlags=(PrimFlags)objectflagupdate; | 4866 | LocalFlags = (PrimFlags)objectflagupdate; |
4868 | 4867 | ||
4869 | if (m_parentGroup != null && m_parentGroup.RootPart == this) | 4868 | if (m_parentGroup != null && m_parentGroup.RootPart == this) |
4870 | { | 4869 | { |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectStatusTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectStatusTests.cs new file mode 100644 index 0000000..a26fe33 --- /dev/null +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectStatusTests.cs | |||
@@ -0,0 +1,62 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | using System.Reflection; | ||
30 | using NUnit.Framework; | ||
31 | using OpenMetaverse; | ||
32 | using OpenSim.Framework; | ||
33 | using OpenSim.Framework.Communications; | ||
34 | using OpenSim.Region.Framework.Scenes; | ||
35 | using OpenSim.Tests.Common; | ||
36 | using OpenSim.Tests.Common.Mock; | ||
37 | |||
38 | namespace OpenSim.Region.Framework.Scenes.Tests | ||
39 | { | ||
40 | /// <summary> | ||
41 | /// Basic scene object status tests | ||
42 | /// </summary> | ||
43 | [TestFixture] | ||
44 | public class SceneObjectStatusTests | ||
45 | { | ||
46 | [Test] | ||
47 | public void TestSetPhantom() | ||
48 | { | ||
49 | TestHelper.InMethod(); | ||
50 | |||
51 | // Scene scene = SceneSetupHelpers.SetupScene(); | ||
52 | SceneObjectGroup so = SceneSetupHelpers.CreateSceneObject(1, UUID.Zero); | ||
53 | SceneObjectPart rootPart = so.RootPart; | ||
54 | Assert.That(rootPart.Flags, Is.EqualTo(PrimFlags.None)); | ||
55 | |||
56 | so.RootPart.ScriptSetPhantomStatus(true); | ||
57 | |||
58 | Console.WriteLine("so.RootPart.Flags [{0}]", so.RootPart.Flags); | ||
59 | Assert.That(rootPart.Flags, Is.EqualTo(PrimFlags.Phantom)); | ||
60 | } | ||
61 | } | ||
62 | } \ No newline at end of file | ||