Merge branch 'master' into dev

dsg
Dan Lake 2011-03-29 16:46:35 -07:00
commit ecee306d3c
4 changed files with 73 additions and 25 deletions

View File

@ -46,6 +46,11 @@ namespace OpenSim.Framework
/// </summary> /// </summary>
int Others { get; } int Others { get; }
/// <summary>
/// Selected prims
/// </summary>
int Selected { get; }
/// <summary> /// <summary>
/// Total prims on the parcel. /// Total prims on the parcel.
/// </summary> /// </summary>

View File

@ -4416,42 +4416,42 @@ namespace OpenSim.Region.ClientStack.LindenUDP
} }
updateMessage.SnapSelection = snap_selection; updateMessage.SnapSelection = snap_selection;
updateMessage.SnapshotID = landData.SnapshotID; updateMessage.SnapshotID = landData.SnapshotID;
updateMessage.Status = (ParcelStatus) landData.Status; updateMessage.Status = (ParcelStatus) landData.Status;
updateMessage.UserLocation = landData.UserLocation; updateMessage.UserLocation = landData.UserLocation;
updateMessage.UserLookAt = landData.UserLookAt; updateMessage.UserLookAt = landData.UserLookAt;
updateMessage.MediaType = landData.MediaType; updateMessage.MediaType = landData.MediaType;
updateMessage.MediaDesc = landData.MediaDescription; updateMessage.MediaDesc = landData.MediaDescription;
updateMessage.MediaWidth = landData.MediaWidth; updateMessage.MediaWidth = landData.MediaWidth;
updateMessage.MediaHeight = landData.MediaHeight; updateMessage.MediaHeight = landData.MediaHeight;
updateMessage.MediaLoop = landData.MediaLoop; updateMessage.MediaLoop = landData.MediaLoop;
updateMessage.ObscureMusic = landData.ObscureMusic; updateMessage.ObscureMusic = landData.ObscureMusic;
updateMessage.ObscureMedia = landData.ObscureMedia; updateMessage.ObscureMedia = landData.ObscureMedia;
IPrimCounts pc = lo.PrimCounts; IPrimCounts pc = lo.PrimCounts;
updateMessage.OwnerPrims = pc.Owner; updateMessage.OwnerPrims = pc.Owner;
updateMessage.GroupPrims = pc.Group; updateMessage.GroupPrims = pc.Group;
updateMessage.OtherPrims = pc.Others; updateMessage.OtherPrims = pc.Others;
updateMessage.TotalPrims = pc.Total; updateMessage.SelectedPrims = pc.Selected;
updateMessage.TotalPrims = pc.Total;
updateMessage.SimWideTotalPrims = pc.Simulator; updateMessage.SimWideTotalPrims = pc.Simulator;
// TODO: Need to transfer selected prims to new prim count structure.
updateMessage.SelectedPrims = landData.SelectedPrims;
try try
{ {
IEventQueue eq = Scene.RequestModuleInterface<IEventQueue>(); IEventQueue eq = Scene.RequestModuleInterface<IEventQueue>();
if (eq != null) if (eq != null)
{ {
eq.ParcelProperties(updateMessage, this.AgentId); eq.ParcelProperties(updateMessage, this.AgentId);
} else { }
m_log.Warn("No EQ Interface when sending parcel data."); else
{
m_log.Warn("[LLCLIENTVIEW]: No EQ Interface when sending parcel data.");
} }
} }
catch (Exception ex) catch (Exception ex)
{ {
m_log.Error("Unable to send parcel data via eventqueue - exception: " + ex.ToString()); m_log.Error("[LLCLIENTVIEW]: Unable to send parcel data via eventqueue - exception: " + ex.ToString());
} }
} }

View File

@ -45,8 +45,8 @@ namespace OpenSim.Region.CoreModules.World.Land
public int Owner = 0; public int Owner = 0;
public int Group = 0; public int Group = 0;
public int Others = 0; public int Others = 0;
public Dictionary <UUID, int> Users = public int Selected = 0;
new Dictionary <UUID, int>(); public Dictionary <UUID, int> Users = new Dictionary <UUID, int>();
} }
public class PrimCountModule : IPrimCountModule, INonSharedRegionModule public class PrimCountModule : IPrimCountModule, INonSharedRegionModule
@ -63,7 +63,6 @@ namespace OpenSim.Region.CoreModules.World.Land
private Dictionary<UUID, ParcelCounts> m_ParcelCounts = private Dictionary<UUID, ParcelCounts> m_ParcelCounts =
new Dictionary<UUID, ParcelCounts>(); new Dictionary<UUID, ParcelCounts>();
/// <value> /// <value>
/// For now, a simple simwide taint to get this up. Later parcel based /// For now, a simple simwide taint to get this up. Later parcel based
/// taint to allow recounting a parcel if only ownership has changed /// taint to allow recounting a parcel if only ownership has changed
@ -95,6 +94,7 @@ namespace OpenSim.Region.CoreModules.World.Land
OnObjectBeingRemovedFromScene; OnObjectBeingRemovedFromScene;
m_Scene.EventManager.OnParcelPrimCountTainted += m_Scene.EventManager.OnParcelPrimCountTainted +=
OnParcelPrimCountTainted; OnParcelPrimCountTainted;
m_Scene.EventManager.OnLandObjectAdded += delegate(ILandObject lo) { OnParcelPrimCountTainted(); };
} }
public void RegionLoaded(Scene scene) public void RegionLoaded(Scene scene)
@ -219,6 +219,9 @@ namespace OpenSim.Region.CoreModules.World.Land
else else
parcelCounts.Others += partCount; parcelCounts.Others += partCount;
} }
if (obj.IsSelected)
parcelCounts.Selected += partCount;
} }
} }
@ -327,6 +330,32 @@ namespace OpenSim.Region.CoreModules.World.Land
return count; return count;
} }
/// <summary>
/// Get the number of selected prims.
/// </summary>
/// <param name="parcelID"></param>
/// <returns></returns>
public int GetSelectedCount(UUID parcelID)
{
int count = 0;
lock (m_TaintLock)
{
if (m_Tainted)
Recount();
ParcelCounts counts;
if (m_ParcelCounts.TryGetValue(parcelID, out counts))
count = counts.Selected;
}
// m_log.DebugFormat(
// "[PRIM COUNT MODULE]: GetSelectedCount for parcel {0} in {1} returning {2}",
// parcelID, m_Scene.RegionInfo.RegionName, count);
return count;
}
/// <summary> /// <summary>
/// Get the total count of owner, group and others prims on the parcel. /// Get the total count of owner, group and others prims on the parcel.
/// FIXME: Need to do selected prims once this is reimplemented. /// FIXME: Need to do selected prims once this is reimplemented.
@ -491,6 +520,14 @@ namespace OpenSim.Region.CoreModules.World.Land
} }
} }
public int Selected
{
get
{
return m_Parent.GetSelectedCount(m_ParcelID);
}
}
public int Total public int Total
{ {
get get

View File

@ -79,6 +79,7 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests
Assert.That(pc.Group, Is.EqualTo(0)); Assert.That(pc.Group, Is.EqualTo(0));
Assert.That(pc.Others, Is.EqualTo(0)); Assert.That(pc.Others, Is.EqualTo(0));
Assert.That(pc.Total, Is.EqualTo(0)); Assert.That(pc.Total, Is.EqualTo(0));
Assert.That(pc.Selected, Is.EqualTo(0));
Assert.That(pc.Users[m_userId], Is.EqualTo(0)); Assert.That(pc.Users[m_userId], Is.EqualTo(0));
Assert.That(pc.Users[m_dummyUserId], Is.EqualTo(0)); Assert.That(pc.Users[m_dummyUserId], Is.EqualTo(0));
Assert.That(pc.Simulator, Is.EqualTo(0)); Assert.That(pc.Simulator, Is.EqualTo(0));
@ -90,6 +91,7 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests
Assert.That(pc.Group, Is.EqualTo(0)); Assert.That(pc.Group, Is.EqualTo(0));
Assert.That(pc.Others, Is.EqualTo(0)); Assert.That(pc.Others, Is.EqualTo(0));
Assert.That(pc.Total, Is.EqualTo(3)); Assert.That(pc.Total, Is.EqualTo(3));
Assert.That(pc.Selected, Is.EqualTo(0));
Assert.That(pc.Users[m_userId], Is.EqualTo(3)); Assert.That(pc.Users[m_userId], Is.EqualTo(3));
Assert.That(pc.Users[m_dummyUserId], Is.EqualTo(0)); Assert.That(pc.Users[m_dummyUserId], Is.EqualTo(0));
Assert.That(pc.Simulator, Is.EqualTo(3)); Assert.That(pc.Simulator, Is.EqualTo(3));
@ -102,6 +104,7 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests
Assert.That(pc.Group, Is.EqualTo(0)); Assert.That(pc.Group, Is.EqualTo(0));
Assert.That(pc.Others, Is.EqualTo(0)); Assert.That(pc.Others, Is.EqualTo(0));
Assert.That(pc.Total, Is.EqualTo(5)); Assert.That(pc.Total, Is.EqualTo(5));
Assert.That(pc.Selected, Is.EqualTo(0));
Assert.That(pc.Users[m_userId], Is.EqualTo(5)); Assert.That(pc.Users[m_userId], Is.EqualTo(5));
Assert.That(pc.Users[m_dummyUserId], Is.EqualTo(0)); Assert.That(pc.Users[m_dummyUserId], Is.EqualTo(0));
Assert.That(pc.Simulator, Is.EqualTo(5)); Assert.That(pc.Simulator, Is.EqualTo(5));
@ -126,6 +129,7 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests
Assert.That(pc.Group, Is.EqualTo(0)); Assert.That(pc.Group, Is.EqualTo(0));
Assert.That(pc.Others, Is.EqualTo(0)); Assert.That(pc.Others, Is.EqualTo(0));
Assert.That(pc.Total, Is.EqualTo(6)); Assert.That(pc.Total, Is.EqualTo(6));
Assert.That(pc.Selected, Is.EqualTo(0));
Assert.That(pc.Users[m_userId], Is.EqualTo(6)); Assert.That(pc.Users[m_userId], Is.EqualTo(6));
Assert.That(pc.Users[m_dummyUserId], Is.EqualTo(0)); Assert.That(pc.Users[m_dummyUserId], Is.EqualTo(0));
Assert.That(pc.Simulator, Is.EqualTo(6)); Assert.That(pc.Simulator, Is.EqualTo(6));
@ -151,6 +155,7 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests
Assert.That(pc.Group, Is.EqualTo(0)); Assert.That(pc.Group, Is.EqualTo(0));
Assert.That(pc.Others, Is.EqualTo(0)); Assert.That(pc.Others, Is.EqualTo(0));
Assert.That(pc.Total, Is.EqualTo(1)); Assert.That(pc.Total, Is.EqualTo(1));
Assert.That(pc.Selected, Is.EqualTo(0));
Assert.That(pc.Users[m_userId], Is.EqualTo(1)); Assert.That(pc.Users[m_userId], Is.EqualTo(1));
Assert.That(pc.Users[m_dummyUserId], Is.EqualTo(0)); Assert.That(pc.Users[m_dummyUserId], Is.EqualTo(0));
Assert.That(pc.Simulator, Is.EqualTo(1)); Assert.That(pc.Simulator, Is.EqualTo(1));
@ -174,6 +179,7 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests
Assert.That(pc.Group, Is.EqualTo(0)); Assert.That(pc.Group, Is.EqualTo(0));
Assert.That(pc.Others, Is.EqualTo(0)); Assert.That(pc.Others, Is.EqualTo(0));
Assert.That(pc.Total, Is.EqualTo(3)); Assert.That(pc.Total, Is.EqualTo(3));
Assert.That(pc.Selected, Is.EqualTo(0));
Assert.That(pc.Users[m_userId], Is.EqualTo(3)); Assert.That(pc.Users[m_userId], Is.EqualTo(3));
Assert.That(pc.Users[m_dummyUserId], Is.EqualTo(0)); Assert.That(pc.Users[m_dummyUserId], Is.EqualTo(0));
Assert.That(pc.Simulator, Is.EqualTo(3)); Assert.That(pc.Simulator, Is.EqualTo(3));