mirror of
https://github.com/opensim/opensim.git
synced 2026-08-11 20:05:33 +08:00
remove now unused individual LandData prim counts.
However, the calls to the land management module to record prims need to remain, since they were also being used to return owner object lists, etc. This is probably why prim counts were being done there in the first place.
This commit is contained in:
@@ -133,16 +133,6 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
return new List<ILandObject>();
|
||||
}
|
||||
|
||||
public bool IsLandPrimCountTainted()
|
||||
{
|
||||
if (m_landManagementModule != null)
|
||||
{
|
||||
return m_landManagementModule.IsLandPrimCountTainted();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool IsForcefulBansAllowed()
|
||||
{
|
||||
if (m_landManagementModule != null)
|
||||
|
||||
@@ -89,7 +89,6 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
/// </value>
|
||||
private readonly Dictionary<int, ILandObject> m_landList = new Dictionary<int, ILandObject>();
|
||||
|
||||
private bool m_landPrimCountTainted;
|
||||
private int m_lastLandLocalID = LandChannel.START_LAND_LOCAL_ID - 1;
|
||||
|
||||
private bool m_allowedForcefulBans = true;
|
||||
@@ -122,18 +121,18 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
|
||||
m_scene.EventManager.OnParcelPrimCountAdd += EventManagerOnParcelPrimCountAdd;
|
||||
m_scene.EventManager.OnParcelPrimCountUpdate += EventManagerOnParcelPrimCountUpdate;
|
||||
m_scene.EventManager.OnObjectBeingRemovedFromScene += EventManagerOnObjectBeingRemovedFromScene;
|
||||
m_scene.EventManager.OnRequestParcelPrimCountUpdate += EventManagerOnRequestParcelPrimCountUpdate;
|
||||
|
||||
m_scene.EventManager.OnAvatarEnteringNewParcel += EventManagerOnAvatarEnteringNewParcel;
|
||||
m_scene.EventManager.OnClientMovement += EventManagerOnClientMovement;
|
||||
m_scene.EventManager.OnValidateLandBuy += EventManagerOnValidateLandBuy;
|
||||
m_scene.EventManager.OnLandBuy += EventManagerOnLandBuy;
|
||||
m_scene.EventManager.OnNewClient += EventManagerOnNewClient;
|
||||
m_scene.EventManager.OnSignificantClientMovement += EventManagerOnSignificantClientMovement;
|
||||
m_scene.EventManager.OnObjectBeingRemovedFromScene += EventManagerOnObjectBeingRemovedFromScene;
|
||||
m_scene.EventManager.OnNoticeNoLandDataFromStorage += EventManagerOnNoLandDataFromStorage;
|
||||
m_scene.EventManager.OnIncomingLandDataFromStorage += EventManagerOnIncomingLandDataFromStorage;
|
||||
m_scene.EventManager.OnSetAllowForcefulBan += EventManagerOnSetAllowedForcefulBan;
|
||||
m_scene.EventManager.OnRequestParcelPrimCountUpdate += EventManagerOnRequestParcelPrimCountUpdate;
|
||||
m_scene.EventManager.OnParcelPrimCountTainted += EventManagerOnParcelPrimCountTainted;
|
||||
m_scene.EventManager.OnSetAllowForcefulBan += EventManagerOnSetAllowedForcefulBan;
|
||||
m_scene.EventManager.OnRegisterCaps += EventManagerOnRegisterCaps;
|
||||
m_scene.EventManager.OnPluginConsole += EventManagerOnPluginConsole;
|
||||
|
||||
@@ -779,34 +778,24 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
|
||||
#region Parcel Modification
|
||||
|
||||
public void ResetAllLandPrimCounts()
|
||||
public void ResetOverMeRecord()
|
||||
{
|
||||
lock (m_landList)
|
||||
{
|
||||
foreach (LandObject p in m_landList.Values)
|
||||
{
|
||||
p.ResetLandPrimCounts();
|
||||
p.ResetOverMeRecord();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void EventManagerOnParcelPrimCountTainted()
|
||||
{
|
||||
m_landPrimCountTainted = true;
|
||||
}
|
||||
|
||||
public bool IsLandPrimCountTainted()
|
||||
{
|
||||
return m_landPrimCountTainted;
|
||||
}
|
||||
|
||||
public void EventManagerOnParcelPrimCountAdd(SceneObjectGroup obj)
|
||||
{
|
||||
Vector3 position = obj.AbsolutePosition;
|
||||
ILandObject landUnderPrim = GetLandObject(position.X, position.Y);
|
||||
if (landUnderPrim != null)
|
||||
{
|
||||
((LandObject)landUnderPrim).AddPrimToCount(obj);
|
||||
((LandObject)landUnderPrim).AddPrimOverMe(obj);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -816,7 +805,7 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
{
|
||||
foreach (LandObject p in m_landList.Values)
|
||||
{
|
||||
p.RemovePrimFromCount(obj);
|
||||
p.RemovePrimFromOverMe(obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -849,8 +838,7 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
foreach (LandObject p in landOwnersAndParcels[owner])
|
||||
{
|
||||
simArea += p.LandData.Area;
|
||||
simPrims += p.LandData.OwnerPrims + p.LandData.OtherPrims + p.LandData.GroupPrims +
|
||||
p.LandData.SelectedPrims;
|
||||
simPrims += p.PrimCounts.Total;
|
||||
}
|
||||
|
||||
foreach (LandObject p in landOwnersAndParcels[owner])
|
||||
@@ -867,7 +855,7 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
// "[LAND MANAGEMENT MODULE]: Triggered EventManagerOnParcelPrimCountUpdate() for {0}",
|
||||
// m_scene.RegionInfo.RegionName);
|
||||
|
||||
ResetAllLandPrimCounts();
|
||||
ResetOverMeRecord();
|
||||
EntityBase[] entities = m_scene.Entities.GetEntities();
|
||||
foreach (EntityBase obj in entities)
|
||||
{
|
||||
@@ -880,15 +868,13 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
}
|
||||
}
|
||||
FinalizeLandPrimCountUpdate();
|
||||
m_landPrimCountTainted = false;
|
||||
}
|
||||
|
||||
public void EventManagerOnRequestParcelPrimCountUpdate()
|
||||
{
|
||||
ResetAllLandPrimCounts();
|
||||
ResetOverMeRecord();
|
||||
m_scene.EventManager.TriggerParcelPrimCountUpdate();
|
||||
FinalizeLandPrimCountUpdate();
|
||||
m_landPrimCountTainted = false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -952,8 +938,6 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
m_landList[startLandObjectIndex].ForceUpdateLandInfo();
|
||||
}
|
||||
|
||||
EventManagerOnParcelPrimCountTainted();
|
||||
|
||||
//Now add the new land object
|
||||
ILandObject result = AddLandObject(newLand);
|
||||
UpdateLandObject(startLandObject.LandData.LocalID, startLandObject.LandData);
|
||||
@@ -1020,7 +1004,6 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
performFinalLandJoin(masterLandObject, slaveLandObject);
|
||||
}
|
||||
}
|
||||
EventManagerOnParcelPrimCountTainted();
|
||||
|
||||
masterLandObject.SendLandUpdateToAvatarsOverMe();
|
||||
}
|
||||
|
||||
@@ -64,8 +64,6 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
|
||||
#endregion
|
||||
|
||||
#region ILandObject Members
|
||||
|
||||
public int GetPrimsFree()
|
||||
{
|
||||
m_scene.EventManager.TriggerParcelPrimCountUpdate();
|
||||
@@ -213,6 +211,7 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
return simMax;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Packet Request Handling
|
||||
@@ -909,9 +908,12 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
|
||||
lock (primsOverMe)
|
||||
{
|
||||
// m_log.DebugFormat(
|
||||
// "[LAND OBJECT]: Request for SendLandObjectOwners() from {0} with {1} known prims on region",
|
||||
// remote_client.Name, primsOverMe.Count);
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
foreach (SceneObjectGroup obj in primsOverMe)
|
||||
{
|
||||
try
|
||||
@@ -950,6 +952,7 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
public Dictionary<UUID, int> GetLandObjectOwners()
|
||||
{
|
||||
Dictionary<UUID, int> ownersAndCount = new Dictionary<UUID, int>();
|
||||
|
||||
lock (primsOverMe)
|
||||
{
|
||||
try
|
||||
@@ -986,8 +989,10 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
|
||||
public void ReturnLandObjects(uint type, UUID[] owners, UUID[] tasks, IClientAPI remote_client)
|
||||
{
|
||||
Dictionary<UUID,List<SceneObjectGroup>> returns =
|
||||
new Dictionary<UUID,List<SceneObjectGroup>>();
|
||||
// m_log.DebugFormat(
|
||||
// "[LAND OBJECT]: Request to return objects in {0} from {1}", LandData.Name, remote_client.Name);
|
||||
|
||||
Dictionary<UUID,List<SceneObjectGroup>> returns = new Dictionary<UUID,List<SceneObjectGroup>>();
|
||||
|
||||
lock (primsOverMe)
|
||||
{
|
||||
@@ -1060,82 +1065,24 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
|
||||
#region Object Adding/Removing from Parcel
|
||||
|
||||
public void ResetLandPrimCounts()
|
||||
public void ResetOverMeRecord()
|
||||
{
|
||||
LandData.GroupPrims = 0;
|
||||
LandData.OwnerPrims = 0;
|
||||
LandData.OtherPrims = 0;
|
||||
LandData.SelectedPrims = 0;
|
||||
|
||||
|
||||
lock (primsOverMe)
|
||||
primsOverMe.Clear();
|
||||
}
|
||||
|
||||
public void AddPrimToCount(SceneObjectGroup obj)
|
||||
public void AddPrimOverMe(SceneObjectGroup obj)
|
||||
{
|
||||
|
||||
UUID prim_owner = obj.OwnerID;
|
||||
int prim_count = obj.PrimCount;
|
||||
|
||||
if (obj.IsSelected)
|
||||
{
|
||||
LandData.SelectedPrims += prim_count;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (prim_owner == LandData.OwnerID)
|
||||
{
|
||||
LandData.OwnerPrims += prim_count;
|
||||
}
|
||||
else if ((obj.GroupID == LandData.GroupID ||
|
||||
prim_owner == LandData.GroupID) &&
|
||||
LandData.GroupID != UUID.Zero)
|
||||
{
|
||||
LandData.GroupPrims += prim_count;
|
||||
}
|
||||
else
|
||||
{
|
||||
LandData.OtherPrims += prim_count;
|
||||
}
|
||||
}
|
||||
|
||||
lock (primsOverMe)
|
||||
primsOverMe.Add(obj);
|
||||
}
|
||||
|
||||
public void RemovePrimFromCount(SceneObjectGroup obj)
|
||||
public void RemovePrimFromOverMe(SceneObjectGroup obj)
|
||||
{
|
||||
lock (primsOverMe)
|
||||
{
|
||||
if (primsOverMe.Contains(obj))
|
||||
{
|
||||
UUID prim_owner = obj.OwnerID;
|
||||
int prim_count = obj.PrimCount;
|
||||
|
||||
if (prim_owner == LandData.OwnerID)
|
||||
{
|
||||
LandData.OwnerPrims -= prim_count;
|
||||
}
|
||||
else if (obj.GroupID == LandData.GroupID ||
|
||||
prim_owner == LandData.GroupID)
|
||||
{
|
||||
LandData.GroupPrims -= prim_count;
|
||||
}
|
||||
else
|
||||
{
|
||||
LandData.OtherPrims -= prim_count;
|
||||
}
|
||||
|
||||
primsOverMe.Remove(obj);
|
||||
}
|
||||
}
|
||||
primsOverMe.Remove(obj);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
@@ -1157,5 +1104,7 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
LandData.MusicURL = url;
|
||||
SendLandUpdateToAvatarsOverMe();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user