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
0.7.1-dev
Justin Clark-Casey (justincc) 2011-04-02 01:07:52 +01:00
parent 3a113f9902
commit 5b0936d4b5
2 changed files with 23 additions and 2 deletions

View File

@ -210,7 +210,7 @@ namespace OpenSim.Region.CoreModules.World.Land
{ {
if (obj.OwnerID == landData.GroupID) if (obj.OwnerID == landData.GroupID)
parcelCounts.Owner += partCount; parcelCounts.Owner += partCount;
else if (obj.GroupID == landData.GroupID) else if (landData.GroupID != UUID.Zero && obj.GroupID == landData.GroupID)
parcelCounts.Group += partCount; parcelCounts.Group += partCount;
else else
parcelCounts.Others += partCount; parcelCounts.Others += partCount;
@ -219,7 +219,7 @@ namespace OpenSim.Region.CoreModules.World.Land
{ {
if (obj.OwnerID == landData.OwnerID) if (obj.OwnerID == landData.OwnerID)
parcelCounts.Owner += partCount; parcelCounts.Owner += partCount;
else if (obj.GroupID == landData.GroupID) else if (landData.GroupID != UUID.Zero && obj.GroupID == landData.GroupID)
parcelCounts.Group += partCount; parcelCounts.Group += partCount;
else else
parcelCounts.Others += partCount; parcelCounts.Others += partCount;

View File

@ -161,6 +161,27 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests
Assert.That(pc.Simulator, Is.EqualTo(1)); 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));
}
/// <summary> /// <summary>
/// Test the count is correct after is has been tainted. /// Test the count is correct after is has been tainted.
/// </summary> /// </summary>