aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-03-30 00:13:07 +0100
committerJustin Clark-Casey (justincc)2011-03-30 00:13:07 +0100
commit8b16f7d976dc60b06f6d08e9d9d853ae69de5fc9 (patch)
tree9cb7254d3731c28aca723a0c6745909319553c66
parentMerge branch 'primcounts' (diff)
downloadopensim-SC_OLD-8b16f7d976dc60b06f6d08e9d9d853ae69de5fc9.zip
opensim-SC_OLD-8b16f7d976dc60b06f6d08e9d9d853ae69de5fc9.tar.gz
opensim-SC_OLD-8b16f7d976dc60b06f6d08e9d9d853ae69de5fc9.tar.bz2
opensim-SC_OLD-8b16f7d976dc60b06f6d08e9d9d853ae69de5fc9.tar.xz
(re)implement selected prim count.
This does not currently count objects that are sat upon (which the viewer ui implies should be included in this count)
-rw-r--r--OpenSim/Framework/IPrimCounts.cs5
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs46
-rw-r--r--OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs43
-rw-r--r--OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs6
4 files changed, 74 insertions, 26 deletions
diff --git a/OpenSim/Framework/IPrimCounts.cs b/OpenSim/Framework/IPrimCounts.cs
index 8ae57fc..3e12348 100644
--- a/OpenSim/Framework/IPrimCounts.cs
+++ b/OpenSim/Framework/IPrimCounts.cs
@@ -45,6 +45,11 @@ namespace OpenSim.Framework
45 /// Prims owned by others (not parcel owner or parcel group). 45 /// Prims owned by others (not parcel owner or parcel group).
46 /// </summary> 46 /// </summary>
47 int Others { get; } 47 int Others { get; }
48
49 /// <summary>
50 /// Selected prims
51 /// </summary>
52 int Selected { get; }
48 53
49 /// <summary> 54 /// <summary>
50 /// Total prims on the parcel. 55 /// Total prims on the parcel.
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index 8ebcabb..2faffae 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -4343,28 +4343,26 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4343 } 4343 }
4344 4344
4345 updateMessage.SnapSelection = snap_selection; 4345 updateMessage.SnapSelection = snap_selection;
4346 updateMessage.SnapshotID = landData.SnapshotID; 4346 updateMessage.SnapshotID = landData.SnapshotID;
4347 updateMessage.Status = (ParcelStatus) landData.Status; 4347 updateMessage.Status = (ParcelStatus) landData.Status;
4348 updateMessage.UserLocation = landData.UserLocation; 4348 updateMessage.UserLocation = landData.UserLocation;
4349 updateMessage.UserLookAt = landData.UserLookAt; 4349 updateMessage.UserLookAt = landData.UserLookAt;
4350 4350
4351 updateMessage.MediaType = landData.MediaType; 4351 updateMessage.MediaType = landData.MediaType;
4352 updateMessage.MediaDesc = landData.MediaDescription; 4352 updateMessage.MediaDesc = landData.MediaDescription;
4353 updateMessage.MediaWidth = landData.MediaWidth; 4353 updateMessage.MediaWidth = landData.MediaWidth;
4354 updateMessage.MediaHeight = landData.MediaHeight; 4354 updateMessage.MediaHeight = landData.MediaHeight;
4355 updateMessage.MediaLoop = landData.MediaLoop; 4355 updateMessage.MediaLoop = landData.MediaLoop;
4356 updateMessage.ObscureMusic = landData.ObscureMusic; 4356 updateMessage.ObscureMusic = landData.ObscureMusic;
4357 updateMessage.ObscureMedia = landData.ObscureMedia; 4357 updateMessage.ObscureMedia = landData.ObscureMedia;
4358 4358
4359 IPrimCounts pc = lo.PrimCounts; 4359 IPrimCounts pc = lo.PrimCounts;
4360 updateMessage.OwnerPrims = pc.Owner; 4360 updateMessage.OwnerPrims = pc.Owner;
4361 updateMessage.GroupPrims = pc.Group; 4361 updateMessage.GroupPrims = pc.Group;
4362 updateMessage.OtherPrims = pc.Others; 4362 updateMessage.OtherPrims = pc.Others;
4363 updateMessage.TotalPrims = pc.Total; 4363 updateMessage.SelectedPrims = pc.Selected;
4364 updateMessage.SimWideTotalPrims = pc.Simulator; 4364 updateMessage.TotalPrims = pc.Total;
4365 4365 updateMessage.SimWideTotalPrims = pc.Simulator;
4366 // TODO: Need to transfer selected prims to new prim count structure.
4367 updateMessage.SelectedPrims = landData.SelectedPrims;
4368 4366
4369 try 4367 try
4370 { 4368 {
@@ -4372,13 +4370,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4372 if (eq != null) 4370 if (eq != null)
4373 { 4371 {
4374 eq.ParcelProperties(updateMessage, this.AgentId); 4372 eq.ParcelProperties(updateMessage, this.AgentId);
4375 } else { 4373 }
4376 m_log.Warn("No EQ Interface when sending parcel data."); 4374 else
4375 {
4376 m_log.Warn("[LLCLIENTVIEW]: No EQ Interface when sending parcel data.");
4377 } 4377 }
4378 } 4378 }
4379 catch (Exception ex) 4379 catch (Exception ex)
4380 { 4380 {
4381 m_log.Error("Unable to send parcel data via eventqueue - exception: " + ex.ToString()); 4381 m_log.Error("[LLCLIENTVIEW]: Unable to send parcel data via eventqueue - exception: " + ex.ToString());
4382 } 4382 }
4383 } 4383 }
4384 4384
diff --git a/OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs b/OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs
index d126b26..ab0e88e 100644
--- a/OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs
+++ b/OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs
@@ -45,13 +45,13 @@ namespace OpenSim.Region.CoreModules.World.Land
45 public int Owner = 0; 45 public int Owner = 0;
46 public int Group = 0; 46 public int Group = 0;
47 public int Others = 0; 47 public int Others = 0;
48 public Dictionary <UUID, int> Users = 48 public int Selected = 0;
49 new Dictionary <UUID, int>(); 49 public Dictionary <UUID, int> Users = new Dictionary <UUID, int>();
50 } 50 }
51 51
52 public class PrimCountModule : IPrimCountModule, INonSharedRegionModule 52 public class PrimCountModule : IPrimCountModule, INonSharedRegionModule
53 { 53 {
54 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 54// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
55 55
56 private Scene m_Scene; 56 private Scene m_Scene;
57 private Dictionary<UUID, PrimCounts> m_PrimCounts = 57 private Dictionary<UUID, PrimCounts> m_PrimCounts =
@@ -219,6 +219,9 @@ namespace OpenSim.Region.CoreModules.World.Land
219 else 219 else
220 parcelCounts.Others += partCount; 220 parcelCounts.Others += partCount;
221 } 221 }
222
223 if (obj.IsSelected)
224 parcelCounts.Selected += partCount;
222 } 225 }
223 } 226 }
224 227
@@ -328,6 +331,32 @@ namespace OpenSim.Region.CoreModules.World.Land
328 } 331 }
329 332
330 /// <summary> 333 /// <summary>
334 /// Get the number of selected prims.
335 /// </summary>
336 /// <param name="parcelID"></param>
337 /// <returns></returns>
338 public int GetSelectedCount(UUID parcelID)
339 {
340 int count = 0;
341
342 lock (m_TaintLock)
343 {
344 if (m_Tainted)
345 Recount();
346
347 ParcelCounts counts;
348 if (m_ParcelCounts.TryGetValue(parcelID, out counts))
349 count = counts.Selected;
350 }
351
352// m_log.DebugFormat(
353// "[PRIM COUNT MODULE]: GetSelectedCount for parcel {0} in {1} returning {2}",
354// parcelID, m_Scene.RegionInfo.RegionName, count);
355
356 return count;
357 }
358
359 /// <summary>
331 /// Get the total count of owner, group and others prims on the parcel. 360 /// Get the total count of owner, group and others prims on the parcel.
332 /// FIXME: Need to do selected prims once this is reimplemented. 361 /// FIXME: Need to do selected prims once this is reimplemented.
333 /// </summary> 362 /// </summary>
@@ -491,6 +520,14 @@ namespace OpenSim.Region.CoreModules.World.Land
491 } 520 }
492 } 521 }
493 522
523 public int Selected
524 {
525 get
526 {
527 return m_Parent.GetSelectedCount(m_ParcelID);
528 }
529 }
530
494 public int Total 531 public int Total
495 { 532 {
496 get 533 get
diff --git a/OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs b/OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs
index 58bd841..5a60f22 100644
--- a/OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs
+++ b/OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs
@@ -79,6 +79,7 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests
79 Assert.That(pc.Group, Is.EqualTo(0)); 79 Assert.That(pc.Group, Is.EqualTo(0));
80 Assert.That(pc.Others, Is.EqualTo(0)); 80 Assert.That(pc.Others, Is.EqualTo(0));
81 Assert.That(pc.Total, Is.EqualTo(0)); 81 Assert.That(pc.Total, Is.EqualTo(0));
82 Assert.That(pc.Selected, Is.EqualTo(0));
82 Assert.That(pc.Users[m_userId], Is.EqualTo(0)); 83 Assert.That(pc.Users[m_userId], Is.EqualTo(0));
83 Assert.That(pc.Users[m_dummyUserId], Is.EqualTo(0)); 84 Assert.That(pc.Users[m_dummyUserId], Is.EqualTo(0));
84 Assert.That(pc.Simulator, Is.EqualTo(0)); 85 Assert.That(pc.Simulator, Is.EqualTo(0));
@@ -90,6 +91,7 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests
90 Assert.That(pc.Group, Is.EqualTo(0)); 91 Assert.That(pc.Group, Is.EqualTo(0));
91 Assert.That(pc.Others, Is.EqualTo(0)); 92 Assert.That(pc.Others, Is.EqualTo(0));
92 Assert.That(pc.Total, Is.EqualTo(3)); 93 Assert.That(pc.Total, Is.EqualTo(3));
94 Assert.That(pc.Selected, Is.EqualTo(0));
93 Assert.That(pc.Users[m_userId], Is.EqualTo(3)); 95 Assert.That(pc.Users[m_userId], Is.EqualTo(3));
94 Assert.That(pc.Users[m_dummyUserId], Is.EqualTo(0)); 96 Assert.That(pc.Users[m_dummyUserId], Is.EqualTo(0));
95 Assert.That(pc.Simulator, Is.EqualTo(3)); 97 Assert.That(pc.Simulator, Is.EqualTo(3));
@@ -102,6 +104,7 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests
102 Assert.That(pc.Group, Is.EqualTo(0)); 104 Assert.That(pc.Group, Is.EqualTo(0));
103 Assert.That(pc.Others, Is.EqualTo(0)); 105 Assert.That(pc.Others, Is.EqualTo(0));
104 Assert.That(pc.Total, Is.EqualTo(5)); 106 Assert.That(pc.Total, Is.EqualTo(5));
107 Assert.That(pc.Selected, Is.EqualTo(0));
105 Assert.That(pc.Users[m_userId], Is.EqualTo(5)); 108 Assert.That(pc.Users[m_userId], Is.EqualTo(5));
106 Assert.That(pc.Users[m_dummyUserId], Is.EqualTo(0)); 109 Assert.That(pc.Users[m_dummyUserId], Is.EqualTo(0));
107 Assert.That(pc.Simulator, Is.EqualTo(5)); 110 Assert.That(pc.Simulator, Is.EqualTo(5));
@@ -126,6 +129,7 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests
126 Assert.That(pc.Group, Is.EqualTo(0)); 129 Assert.That(pc.Group, Is.EqualTo(0));
127 Assert.That(pc.Others, Is.EqualTo(0)); 130 Assert.That(pc.Others, Is.EqualTo(0));
128 Assert.That(pc.Total, Is.EqualTo(6)); 131 Assert.That(pc.Total, Is.EqualTo(6));
132 Assert.That(pc.Selected, Is.EqualTo(0));
129 Assert.That(pc.Users[m_userId], Is.EqualTo(6)); 133 Assert.That(pc.Users[m_userId], Is.EqualTo(6));
130 Assert.That(pc.Users[m_dummyUserId], Is.EqualTo(0)); 134 Assert.That(pc.Users[m_dummyUserId], Is.EqualTo(0));
131 Assert.That(pc.Simulator, Is.EqualTo(6)); 135 Assert.That(pc.Simulator, Is.EqualTo(6));
@@ -151,6 +155,7 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests
151 Assert.That(pc.Group, Is.EqualTo(0)); 155 Assert.That(pc.Group, Is.EqualTo(0));
152 Assert.That(pc.Others, Is.EqualTo(0)); 156 Assert.That(pc.Others, Is.EqualTo(0));
153 Assert.That(pc.Total, Is.EqualTo(1)); 157 Assert.That(pc.Total, Is.EqualTo(1));
158 Assert.That(pc.Selected, Is.EqualTo(0));
154 Assert.That(pc.Users[m_userId], Is.EqualTo(1)); 159 Assert.That(pc.Users[m_userId], Is.EqualTo(1));
155 Assert.That(pc.Users[m_dummyUserId], Is.EqualTo(0)); 160 Assert.That(pc.Users[m_dummyUserId], Is.EqualTo(0));
156 Assert.That(pc.Simulator, Is.EqualTo(1)); 161 Assert.That(pc.Simulator, Is.EqualTo(1));
@@ -174,6 +179,7 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests
174 Assert.That(pc.Group, Is.EqualTo(0)); 179 Assert.That(pc.Group, Is.EqualTo(0));
175 Assert.That(pc.Others, Is.EqualTo(0)); 180 Assert.That(pc.Others, Is.EqualTo(0));
176 Assert.That(pc.Total, Is.EqualTo(3)); 181 Assert.That(pc.Total, Is.EqualTo(3));
182 Assert.That(pc.Selected, Is.EqualTo(0));
177 Assert.That(pc.Users[m_userId], Is.EqualTo(3)); 183 Assert.That(pc.Users[m_userId], Is.EqualTo(3));
178 Assert.That(pc.Users[m_dummyUserId], Is.EqualTo(0)); 184 Assert.That(pc.Users[m_dummyUserId], Is.EqualTo(0));
179 Assert.That(pc.Simulator, Is.EqualTo(3)); 185 Assert.That(pc.Simulator, Is.EqualTo(3));