Merge branch 'master' of git://opensimulator.org/git/opensim
commit
a0be3e2c5f
|
@ -46,6 +46,11 @@ namespace OpenSim.Framework
|
|||
/// </summary>
|
||||
int Others { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Selected prims
|
||||
/// </summary>
|
||||
int Selected { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Total prims on the parcel.
|
||||
/// </summary>
|
||||
|
|
|
@ -4343,42 +4343,42 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
}
|
||||
|
||||
updateMessage.SnapSelection = snap_selection;
|
||||
updateMessage.SnapshotID = landData.SnapshotID;
|
||||
updateMessage.Status = (ParcelStatus) landData.Status;
|
||||
updateMessage.UserLocation = landData.UserLocation;
|
||||
updateMessage.UserLookAt = landData.UserLookAt;
|
||||
updateMessage.SnapshotID = landData.SnapshotID;
|
||||
updateMessage.Status = (ParcelStatus) landData.Status;
|
||||
updateMessage.UserLocation = landData.UserLocation;
|
||||
updateMessage.UserLookAt = landData.UserLookAt;
|
||||
|
||||
updateMessage.MediaType = landData.MediaType;
|
||||
updateMessage.MediaDesc = landData.MediaDescription;
|
||||
updateMessage.MediaWidth = landData.MediaWidth;
|
||||
updateMessage.MediaHeight = landData.MediaHeight;
|
||||
updateMessage.MediaLoop = landData.MediaLoop;
|
||||
updateMessage.ObscureMusic = landData.ObscureMusic;
|
||||
updateMessage.ObscureMedia = landData.ObscureMedia;
|
||||
updateMessage.MediaType = landData.MediaType;
|
||||
updateMessage.MediaDesc = landData.MediaDescription;
|
||||
updateMessage.MediaWidth = landData.MediaWidth;
|
||||
updateMessage.MediaHeight = landData.MediaHeight;
|
||||
updateMessage.MediaLoop = landData.MediaLoop;
|
||||
updateMessage.ObscureMusic = landData.ObscureMusic;
|
||||
updateMessage.ObscureMedia = landData.ObscureMedia;
|
||||
|
||||
IPrimCounts pc = lo.PrimCounts;
|
||||
updateMessage.OwnerPrims = pc.Owner;
|
||||
updateMessage.GroupPrims = pc.Group;
|
||||
updateMessage.OtherPrims = pc.Others;
|
||||
updateMessage.TotalPrims = pc.Total;
|
||||
updateMessage.OwnerPrims = pc.Owner;
|
||||
updateMessage.GroupPrims = pc.Group;
|
||||
updateMessage.OtherPrims = pc.Others;
|
||||
updateMessage.SelectedPrims = pc.Selected;
|
||||
updateMessage.TotalPrims = pc.Total;
|
||||
updateMessage.SimWideTotalPrims = pc.Simulator;
|
||||
|
||||
// TODO: Need to transfer selected prims to new prim count structure.
|
||||
updateMessage.SelectedPrims = landData.SelectedPrims;
|
||||
|
||||
try
|
||||
{
|
||||
IEventQueue eq = Scene.RequestModuleInterface<IEventQueue>();
|
||||
if (eq != null)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -45,8 +45,8 @@ namespace OpenSim.Region.CoreModules.World.Land
|
|||
public int Owner = 0;
|
||||
public int Group = 0;
|
||||
public int Others = 0;
|
||||
public Dictionary <UUID, int> Users =
|
||||
new Dictionary <UUID, int>();
|
||||
public int Selected = 0;
|
||||
public Dictionary <UUID, int> Users = new Dictionary <UUID, int>();
|
||||
}
|
||||
|
||||
public class PrimCountModule : IPrimCountModule, INonSharedRegionModule
|
||||
|
@ -63,7 +63,6 @@ namespace OpenSim.Region.CoreModules.World.Land
|
|||
private Dictionary<UUID, ParcelCounts> m_ParcelCounts =
|
||||
new Dictionary<UUID, ParcelCounts>();
|
||||
|
||||
|
||||
/// <value>
|
||||
/// For now, a simple simwide taint to get this up. Later parcel based
|
||||
/// taint to allow recounting a parcel if only ownership has changed
|
||||
|
@ -95,6 +94,7 @@ namespace OpenSim.Region.CoreModules.World.Land
|
|||
OnObjectBeingRemovedFromScene;
|
||||
m_Scene.EventManager.OnParcelPrimCountTainted +=
|
||||
OnParcelPrimCountTainted;
|
||||
m_Scene.EventManager.OnLandObjectAdded += delegate(ILandObject lo) { OnParcelPrimCountTainted(); };
|
||||
}
|
||||
|
||||
public void RegionLoaded(Scene scene)
|
||||
|
@ -219,6 +219,9 @@ namespace OpenSim.Region.CoreModules.World.Land
|
|||
else
|
||||
parcelCounts.Others += partCount;
|
||||
}
|
||||
|
||||
if (obj.IsSelected)
|
||||
parcelCounts.Selected += partCount;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -327,6 +330,32 @@ namespace OpenSim.Region.CoreModules.World.Land
|
|||
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>
|
||||
/// Get the total count of owner, group and others prims on the parcel.
|
||||
/// 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
|
||||
{
|
||||
get
|
||||
|
|
|
@ -79,6 +79,7 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests
|
|||
Assert.That(pc.Group, Is.EqualTo(0));
|
||||
Assert.That(pc.Others, 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_dummyUserId], 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.Others, Is.EqualTo(0));
|
||||
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_dummyUserId], Is.EqualTo(0));
|
||||
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.Others, Is.EqualTo(0));
|
||||
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_dummyUserId], Is.EqualTo(0));
|
||||
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.Others, Is.EqualTo(0));
|
||||
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_dummyUserId], Is.EqualTo(0));
|
||||
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.Others, Is.EqualTo(0));
|
||||
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_dummyUserId], Is.EqualTo(0));
|
||||
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.Others, Is.EqualTo(0));
|
||||
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_dummyUserId], Is.EqualTo(0));
|
||||
Assert.That(pc.Simulator, Is.EqualTo(3));
|
||||
|
|
Loading…
Reference in New Issue