aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs')
-rw-r--r--OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs23
1 files changed, 17 insertions, 6 deletions
diff --git a/OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs b/OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs
index 34ef67f..c71264c 100644
--- a/OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs
+++ b/OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs
@@ -51,8 +51,8 @@ namespace OpenSim.Region.CoreModules.World.Land
51 51
52 public class PrimCountModule : IPrimCountModule, INonSharedRegionModule 52 public class PrimCountModule : IPrimCountModule, INonSharedRegionModule
53 { 53 {
54 private static readonly ILog m_log = 54// private static readonly ILog m_log =
55 LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 55// LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
56 56
57 private Scene m_Scene; 57 private Scene m_Scene;
58 private Dictionary<UUID, PrimCounts> m_PrimCounts = 58 private Dictionary<UUID, PrimCounts> m_PrimCounts =
@@ -64,10 +64,16 @@ namespace OpenSim.Region.CoreModules.World.Land
64 private Dictionary<UUID, ParcelCounts> m_ParcelCounts = 64 private Dictionary<UUID, ParcelCounts> m_ParcelCounts =
65 new Dictionary<UUID, ParcelCounts>(); 65 new Dictionary<UUID, ParcelCounts>();
66 66
67 // For now, a simple simwide taint to get this up. Later parcel based 67
68 // taint to allow recounting a parcel if only ownership has changed 68 /// <value>
69 // without recounting the whole sim. 69 /// For now, a simple simwide taint to get this up. Later parcel based
70 /// taint to allow recounting a parcel if only ownership has changed
71 /// without recounting the whole sim.
72 ///
73 /// We start out tainted so that the first get call resets the various prim counts.
74 /// <value>
70 private bool m_Tainted = true; 75 private bool m_Tainted = true;
76
71 private Object m_TaintLock = new Object(); 77 private Object m_TaintLock = new Object();
72 78
73 public Type ReplaceableInterface 79 public Type ReplaceableInterface
@@ -156,6 +162,8 @@ namespace OpenSim.Region.CoreModules.World.Land
156 // NOTE: Call under Taint Lock 162 // NOTE: Call under Taint Lock
157 private void AddObject(SceneObjectGroup obj) 163 private void AddObject(SceneObjectGroup obj)
158 { 164 {
165// m_log.DebugFormat("[PRIM COUNT MODULE]: Adding object {0} to prim count", obj.Name);
166
159 if (obj.IsAttachment) 167 if (obj.IsAttachment)
160 return; 168 return;
161 if (((obj.RootPart.Flags & PrimFlags.TemporaryOnRez) != 0)) 169 if (((obj.RootPart.Flags & PrimFlags.TemporaryOnRez) != 0))
@@ -299,18 +307,21 @@ namespace OpenSim.Region.CoreModules.World.Land
299 // NOTE: This method MUST be called while holding the taint lock! 307 // NOTE: This method MUST be called while holding the taint lock!
300 private void Recount() 308 private void Recount()
301 { 309 {
310// m_log.DebugFormat("[PRIM COUNT MODULE]: Recounting prims on {0}", m_Scene.RegionInfo.RegionName);
311
302 m_OwnerMap.Clear(); 312 m_OwnerMap.Clear();
303 m_SimwideCounts.Clear(); 313 m_SimwideCounts.Clear();
304 m_ParcelCounts.Clear(); 314 m_ParcelCounts.Clear();
305 315
306 List<ILandObject> land = m_Scene.LandChannel.AllParcels(); 316 List<ILandObject> land = m_Scene.LandChannel.AllParcels();
307 317
308 foreach (ILandObject l in land) 318 foreach (ILandObject l in land)
309 { 319 {
310 LandData landData = l.LandData; 320 LandData landData = l.LandData;
311 321
312 m_OwnerMap[landData.GlobalID] = landData.OwnerID; 322 m_OwnerMap[landData.GlobalID] = landData.OwnerID;
313 m_SimwideCounts[landData.OwnerID] = 0; 323 m_SimwideCounts[landData.OwnerID] = 0;
324// m_log.DebugFormat("[PRIM COUNT MODULE]: Adding parcel count for {0}", landData.GlobalID);
314 m_ParcelCounts[landData.GlobalID] = new ParcelCounts(); 325 m_ParcelCounts[landData.GlobalID] = new ParcelCounts();
315 } 326 }
316 327