move total parcel prim calculations into IPrimCounts instead of doing this in LLClientView
need to move selected prim counts from LandData/LMM still0.7.1-dev
parent
bfd9cc44b4
commit
541cd3e8c8
|
@ -31,10 +31,34 @@ namespace OpenSim.Framework
|
|||
{
|
||||
public interface IPrimCounts
|
||||
{
|
||||
/// <summary>
|
||||
/// Parcel owner owned prims
|
||||
/// </summary>
|
||||
int Owner { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Parcel group owned prims
|
||||
/// </summary>
|
||||
int Group { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Prims owned by others (not parcel owner or parcel group).
|
||||
/// </summary>
|
||||
int Others { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Total prims on the parcel.
|
||||
/// </summary>
|
||||
int Total { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Prims on the simulator that are owned by the parcel owner, even if they are in other parcels.
|
||||
/// </summary>
|
||||
int Simulator { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Prims per individual users.
|
||||
/// </summary>
|
||||
IUserPrimCounts Users { get; }
|
||||
}
|
||||
|
||||
|
|
|
@ -325,6 +325,37 @@ namespace OpenSim.Region.CoreModules.World.Land
|
|||
return count;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the total count of owner, group and others prims on the parcel.
|
||||
/// FIXME: Need to do selected prims once this is reimplemented.
|
||||
/// </summary>
|
||||
/// <param name="parcelID"></param>
|
||||
/// <returns></returns>
|
||||
public int GetTotalCount(UUID parcelID)
|
||||
{
|
||||
int count = 0;
|
||||
|
||||
lock (m_TaintLock)
|
||||
{
|
||||
if (m_Tainted)
|
||||
Recount();
|
||||
|
||||
ParcelCounts counts;
|
||||
if (m_ParcelCounts.TryGetValue(parcelID, out counts))
|
||||
{
|
||||
count = counts.Owner;
|
||||
count += counts.Group;
|
||||
count += counts.Others;
|
||||
}
|
||||
}
|
||||
|
||||
m_log.DebugFormat(
|
||||
"[PRIM COUNT MODULE]: GetTotalCount for parcel {0} in {1} returning {2}",
|
||||
parcelID, m_Scene.RegionInfo.RegionName, count);
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the number of prims that are in the entire simulator for the owner of this parcel.
|
||||
/// </summary>
|
||||
|
@ -458,6 +489,14 @@ namespace OpenSim.Region.CoreModules.World.Land
|
|||
}
|
||||
}
|
||||
|
||||
public int Total
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Parent.GetTotalCount(m_ParcelID);
|
||||
}
|
||||
}
|
||||
|
||||
public int Simulator
|
||||
{
|
||||
get
|
||||
|
|
|
@ -78,6 +78,7 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests
|
|||
Assert.That(pc.Owner, Is.EqualTo(0));
|
||||
Assert.That(pc.Group, Is.EqualTo(0));
|
||||
Assert.That(pc.Others, Is.EqualTo(0));
|
||||
Assert.That(pc.Total, Is.EqualTo(0));
|
||||
Assert.That(pc.Users[m_userId], Is.EqualTo(0));
|
||||
Assert.That(pc.Users[m_dummyUserId], Is.EqualTo(0));
|
||||
Assert.That(pc.Simulator, Is.EqualTo(0));
|
||||
|
@ -88,6 +89,7 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests
|
|||
Assert.That(pc.Owner, Is.EqualTo(3));
|
||||
Assert.That(pc.Group, Is.EqualTo(0));
|
||||
Assert.That(pc.Others, Is.EqualTo(0));
|
||||
Assert.That(pc.Total, Is.EqualTo(3));
|
||||
Assert.That(pc.Users[m_userId], Is.EqualTo(3));
|
||||
Assert.That(pc.Users[m_dummyUserId], Is.EqualTo(0));
|
||||
Assert.That(pc.Simulator, Is.EqualTo(3));
|
||||
|
@ -99,6 +101,7 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests
|
|||
Assert.That(pc.Owner, Is.EqualTo(5));
|
||||
Assert.That(pc.Group, Is.EqualTo(0));
|
||||
Assert.That(pc.Others, Is.EqualTo(0));
|
||||
Assert.That(pc.Total, Is.EqualTo(5));
|
||||
Assert.That(pc.Users[m_userId], Is.EqualTo(5));
|
||||
Assert.That(pc.Users[m_dummyUserId], Is.EqualTo(0));
|
||||
Assert.That(pc.Simulator, Is.EqualTo(5));
|
||||
|
@ -122,6 +125,7 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests
|
|||
Assert.That(pc.Owner, Is.EqualTo(6));
|
||||
Assert.That(pc.Group, Is.EqualTo(0));
|
||||
Assert.That(pc.Others, Is.EqualTo(0));
|
||||
Assert.That(pc.Total, Is.EqualTo(6));
|
||||
Assert.That(pc.Users[m_userId], Is.EqualTo(6));
|
||||
Assert.That(pc.Users[m_dummyUserId], Is.EqualTo(0));
|
||||
Assert.That(pc.Simulator, Is.EqualTo(6));
|
||||
|
@ -146,6 +150,7 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests
|
|||
Assert.That(pc.Owner, Is.EqualTo(1));
|
||||
Assert.That(pc.Group, Is.EqualTo(0));
|
||||
Assert.That(pc.Others, Is.EqualTo(0));
|
||||
Assert.That(pc.Total, Is.EqualTo(1));
|
||||
Assert.That(pc.Users[m_userId], Is.EqualTo(1));
|
||||
Assert.That(pc.Users[m_dummyUserId], Is.EqualTo(0));
|
||||
Assert.That(pc.Simulator, Is.EqualTo(1));
|
||||
|
@ -168,6 +173,7 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests
|
|||
Assert.That(pc.Owner, Is.EqualTo(3));
|
||||
Assert.That(pc.Group, Is.EqualTo(0));
|
||||
Assert.That(pc.Others, Is.EqualTo(0));
|
||||
Assert.That(pc.Total, Is.EqualTo(3));
|
||||
Assert.That(pc.Users[m_userId], Is.EqualTo(3));
|
||||
Assert.That(pc.Users[m_dummyUserId], Is.EqualTo(0));
|
||||
Assert.That(pc.Simulator, Is.EqualTo(3));
|
||||
|
|
Loading…
Reference in New Issue