diff options
author | Justin Clark-Casey (justincc) | 2011-03-23 21:50:56 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-03-23 21:53:14 +0000 |
commit | d011896341d09ce6c10a801264e663b6a19f0b48 (patch) | |
tree | 02369e0c5a2103e8f42f5bf6128814de9e2afaf5 /OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs | |
parent | Fix a typo in the SQLite DLL config and amend the instructions for running on... (diff) | |
download | opensim-SC_OLD-d011896341d09ce6c10a801264e663b6a19f0b48.zip opensim-SC_OLD-d011896341d09ce6c10a801264e663b6a19f0b48.tar.gz opensim-SC_OLD-d011896341d09ce6c10a801264e663b6a19f0b48.tar.bz2 opensim-SC_OLD-d011896341d09ce6c10a801264e663b6a19f0b48.tar.xz |
Add generic EventManager.OnObjectAddedToScene and get PrimCountModule to listen for that rather than EventManager.OnParcelPrimCountAdd
OnParcelPrimCountAdd had the wrong semantics for the PrimCountModule - it was invoked for every entity in the scene, not just new ones, which would screw up the untainted count.
Extend automated test for this scenario.
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs b/OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs index c71264c..5371aaf 100644 --- a/OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs | |||
@@ -89,8 +89,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
89 | { | 89 | { |
90 | m_Scene = scene; | 90 | m_Scene = scene; |
91 | 91 | ||
92 | m_Scene.EventManager.OnParcelPrimCountAdd += | 92 | m_Scene.EventManager.OnObjectAddedToScene += OnParcelPrimCountAdd; |
93 | OnParcelPrimCountAdd; | ||
94 | m_Scene.EventManager.OnObjectBeingRemovedFromScene += | 93 | m_Scene.EventManager.OnObjectBeingRemovedFromScene += |
95 | OnObjectBeingRemovedFromScene; | 94 | OnObjectBeingRemovedFromScene; |
96 | m_Scene.EventManager.OnParcelPrimCountTainted += | 95 | m_Scene.EventManager.OnParcelPrimCountTainted += |
@@ -116,6 +115,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
116 | 115 | ||
117 | private void OnParcelPrimCountAdd(SceneObjectGroup obj) | 116 | private void OnParcelPrimCountAdd(SceneObjectGroup obj) |
118 | { | 117 | { |
118 | Console.WriteLine("WIBBLE"); | ||
119 | // If we're tainted already, don't bother to add. The next | 119 | // If we're tainted already, don't bother to add. The next |
120 | // access will cause a recount anyway | 120 | // access will cause a recount anyway |
121 | lock (m_TaintLock) | 121 | lock (m_TaintLock) |
@@ -172,6 +172,10 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
172 | Vector3 pos = obj.AbsolutePosition; | 172 | Vector3 pos = obj.AbsolutePosition; |
173 | ILandObject landObject = m_Scene.LandChannel.GetLandObject(pos.X, pos.Y); | 173 | ILandObject landObject = m_Scene.LandChannel.GetLandObject(pos.X, pos.Y); |
174 | LandData landData = landObject.LandData; | 174 | LandData landData = landObject.LandData; |
175 | |||
176 | // m_log.DebugFormat( | ||
177 | // "[PRIM COUNT MODULE]: Object {0} is owned by {1} over land owned by {2}", | ||
178 | // obj.Name, obj.OwnerID, landData.OwnerID); | ||
175 | 179 | ||
176 | ParcelCounts parcelCounts; | 180 | ParcelCounts parcelCounts; |
177 | if (m_ParcelCounts.TryGetValue(landData.GlobalID, out parcelCounts)) | 181 | if (m_ParcelCounts.TryGetValue(landData.GlobalID, out parcelCounts)) |
@@ -228,6 +232,8 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
228 | 232 | ||
229 | public int GetOwnerCount(UUID parcelID) | 233 | public int GetOwnerCount(UUID parcelID) |
230 | { | 234 | { |
235 | // m_log.DebugFormat("[PRIM COUNT MODULE]: GetOwnerCount for {0}", parcelID); | ||
236 | |||
231 | lock (m_TaintLock) | 237 | lock (m_TaintLock) |
232 | { | 238 | { |
233 | if (m_Tainted) | 239 | if (m_Tainted) |