aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-04-02 01:07:52 +0100
committerJustin Clark-Casey (justincc)2011-04-02 01:07:52 +0100
commit5b0936d4b52a972af4f9efa2e69c938e334ad3c7 (patch)
tree3a13a7be8dd38cf5a5e046c02d15df2fb2e58251
parentA stab at making CHANGED_OWNER work (diff)
downloadopensim-SC_OLD-5b0936d4b52a972af4f9efa2e69c938e334ad3c7.zip
opensim-SC_OLD-5b0936d4b52a972af4f9efa2e69c938e334ad3c7.tar.gz
opensim-SC_OLD-5b0936d4b52a972af4f9efa2e69c938e334ad3c7.tar.bz2
opensim-SC_OLD-5b0936d4b52a972af4f9efa2e69c938e334ad3c7.tar.xz
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
-rw-r--r--OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs4
-rw-r--r--OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs21
2 files changed, 23 insertions, 2 deletions
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
210 { 210 {
211 if (obj.OwnerID == landData.GroupID) 211 if (obj.OwnerID == landData.GroupID)
212 parcelCounts.Owner += partCount; 212 parcelCounts.Owner += partCount;
213 else if (obj.GroupID == landData.GroupID) 213 else if (landData.GroupID != UUID.Zero && obj.GroupID == landData.GroupID)
214 parcelCounts.Group += partCount; 214 parcelCounts.Group += partCount;
215 else 215 else
216 parcelCounts.Others += partCount; 216 parcelCounts.Others += partCount;
@@ -219,7 +219,7 @@ namespace OpenSim.Region.CoreModules.World.Land
219 { 219 {
220 if (obj.OwnerID == landData.OwnerID) 220 if (obj.OwnerID == landData.OwnerID)
221 parcelCounts.Owner += partCount; 221 parcelCounts.Owner += partCount;
222 else if (obj.GroupID == landData.GroupID) 222 else if (landData.GroupID != UUID.Zero && obj.GroupID == landData.GroupID)
223 parcelCounts.Group += partCount; 223 parcelCounts.Group += partCount;
224 else 224 else
225 parcelCounts.Others += partCount; 225 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
161 Assert.That(pc.Simulator, Is.EqualTo(1)); 161 Assert.That(pc.Simulator, Is.EqualTo(1));
162 } 162 }
163 163
164 [Test]
165 public void TestAddOthersObject()
166 {
167 TestHelper.InMethod();
168// log4net.Config.XmlConfigurator.Configure();
169
170 IPrimCounts pc = m_lo.PrimCounts;
171
172 SceneObjectGroup sog = SceneSetupHelpers.CreateSceneObject(3, m_dummyUserId, 0x01);
173 m_scene.AddNewSceneObject(sog, false);
174
175 Assert.That(pc.Owner, Is.EqualTo(0));
176 Assert.That(pc.Group, Is.EqualTo(0));
177 Assert.That(pc.Others, Is.EqualTo(3));
178 Assert.That(pc.Total, Is.EqualTo(3));
179 Assert.That(pc.Selected, Is.EqualTo(0));
180 Assert.That(pc.Users[m_userId], Is.EqualTo(0));
181 Assert.That(pc.Users[m_dummyUserId], Is.EqualTo(3));
182 Assert.That(pc.Simulator, Is.EqualTo(3));
183 }
184
164 /// <summary> 185 /// <summary>
165 /// Test the count is correct after is has been tainted. 186 /// Test the count is correct after is has been tainted.
166 /// </summary> 187 /// </summary>