From 5b0936d4b52a972af4f9efa2e69c938e334ad3c7 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 2 Apr 2011 01:07:52 +0100 Subject: If the land has no group ownership (it is UUID.Zero) then don't put prims in the group count when they are also not group owned. Also adds simple test for others owned count when an object is added --- .../CoreModules/World/Land/PrimCountModule.cs | 4 ++-- .../World/Land/Tests/PrimCountModuleTests.cs | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs b/OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs index f07ae31..992cd72 100644 --- a/OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs @@ -210,7 +210,7 @@ namespace OpenSim.Region.CoreModules.World.Land { if (obj.OwnerID == landData.GroupID) parcelCounts.Owner += partCount; - else if (obj.GroupID == landData.GroupID) + else if (landData.GroupID != UUID.Zero && obj.GroupID == landData.GroupID) parcelCounts.Group += partCount; else parcelCounts.Others += partCount; @@ -219,7 +219,7 @@ namespace OpenSim.Region.CoreModules.World.Land { if (obj.OwnerID == landData.OwnerID) parcelCounts.Owner += partCount; - else if (obj.GroupID == landData.GroupID) + else if (landData.GroupID != UUID.Zero && obj.GroupID == landData.GroupID) parcelCounts.Group += partCount; else parcelCounts.Others += partCount; diff --git a/OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs b/OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs index 5a60f22..521effc 100644 --- a/OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs +++ b/OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs @@ -161,6 +161,27 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests Assert.That(pc.Simulator, Is.EqualTo(1)); } + [Test] + public void TestAddOthersObject() + { + TestHelper.InMethod(); +// log4net.Config.XmlConfigurator.Configure(); + + IPrimCounts pc = m_lo.PrimCounts; + + SceneObjectGroup sog = SceneSetupHelpers.CreateSceneObject(3, m_dummyUserId, 0x01); + m_scene.AddNewSceneObject(sog, false); + + Assert.That(pc.Owner, Is.EqualTo(0)); + Assert.That(pc.Group, Is.EqualTo(0)); + Assert.That(pc.Others, Is.EqualTo(3)); + Assert.That(pc.Total, Is.EqualTo(3)); + Assert.That(pc.Selected, Is.EqualTo(0)); + Assert.That(pc.Users[m_userId], Is.EqualTo(0)); + Assert.That(pc.Users[m_dummyUserId], Is.EqualTo(3)); + Assert.That(pc.Simulator, Is.EqualTo(3)); + } + /// /// Test the count is correct after is has been tainted. /// -- cgit v1.1