diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | 39 |
1 files changed, 11 insertions, 28 deletions
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index 2b5f7a0..adfac05 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | |||
@@ -89,7 +89,6 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
89 | /// </value> | 89 | /// </value> |
90 | private readonly Dictionary<int, ILandObject> m_landList = new Dictionary<int, ILandObject>(); | 90 | private readonly Dictionary<int, ILandObject> m_landList = new Dictionary<int, ILandObject>(); |
91 | 91 | ||
92 | private bool m_landPrimCountTainted; | ||
93 | private int m_lastLandLocalID = LandChannel.START_LAND_LOCAL_ID - 1; | 92 | private int m_lastLandLocalID = LandChannel.START_LAND_LOCAL_ID - 1; |
94 | 93 | ||
95 | private bool m_allowedForcefulBans = true; | 94 | private bool m_allowedForcefulBans = true; |
@@ -122,18 +121,18 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
122 | 121 | ||
123 | m_scene.EventManager.OnParcelPrimCountAdd += EventManagerOnParcelPrimCountAdd; | 122 | m_scene.EventManager.OnParcelPrimCountAdd += EventManagerOnParcelPrimCountAdd; |
124 | m_scene.EventManager.OnParcelPrimCountUpdate += EventManagerOnParcelPrimCountUpdate; | 123 | m_scene.EventManager.OnParcelPrimCountUpdate += EventManagerOnParcelPrimCountUpdate; |
124 | m_scene.EventManager.OnObjectBeingRemovedFromScene += EventManagerOnObjectBeingRemovedFromScene; | ||
125 | m_scene.EventManager.OnRequestParcelPrimCountUpdate += EventManagerOnRequestParcelPrimCountUpdate; | ||
126 | |||
125 | m_scene.EventManager.OnAvatarEnteringNewParcel += EventManagerOnAvatarEnteringNewParcel; | 127 | m_scene.EventManager.OnAvatarEnteringNewParcel += EventManagerOnAvatarEnteringNewParcel; |
126 | m_scene.EventManager.OnClientMovement += EventManagerOnClientMovement; | 128 | m_scene.EventManager.OnClientMovement += EventManagerOnClientMovement; |
127 | m_scene.EventManager.OnValidateLandBuy += EventManagerOnValidateLandBuy; | 129 | m_scene.EventManager.OnValidateLandBuy += EventManagerOnValidateLandBuy; |
128 | m_scene.EventManager.OnLandBuy += EventManagerOnLandBuy; | 130 | m_scene.EventManager.OnLandBuy += EventManagerOnLandBuy; |
129 | m_scene.EventManager.OnNewClient += EventManagerOnNewClient; | 131 | m_scene.EventManager.OnNewClient += EventManagerOnNewClient; |
130 | m_scene.EventManager.OnSignificantClientMovement += EventManagerOnSignificantClientMovement; | 132 | m_scene.EventManager.OnSignificantClientMovement += EventManagerOnSignificantClientMovement; |
131 | m_scene.EventManager.OnObjectBeingRemovedFromScene += EventManagerOnObjectBeingRemovedFromScene; | ||
132 | m_scene.EventManager.OnNoticeNoLandDataFromStorage += EventManagerOnNoLandDataFromStorage; | 133 | m_scene.EventManager.OnNoticeNoLandDataFromStorage += EventManagerOnNoLandDataFromStorage; |
133 | m_scene.EventManager.OnIncomingLandDataFromStorage += EventManagerOnIncomingLandDataFromStorage; | 134 | m_scene.EventManager.OnIncomingLandDataFromStorage += EventManagerOnIncomingLandDataFromStorage; |
134 | m_scene.EventManager.OnSetAllowForcefulBan += EventManagerOnSetAllowedForcefulBan; | 135 | m_scene.EventManager.OnSetAllowForcefulBan += EventManagerOnSetAllowedForcefulBan; |
135 | m_scene.EventManager.OnRequestParcelPrimCountUpdate += EventManagerOnRequestParcelPrimCountUpdate; | ||
136 | m_scene.EventManager.OnParcelPrimCountTainted += EventManagerOnParcelPrimCountTainted; | ||
137 | m_scene.EventManager.OnRegisterCaps += EventManagerOnRegisterCaps; | 136 | m_scene.EventManager.OnRegisterCaps += EventManagerOnRegisterCaps; |
138 | m_scene.EventManager.OnPluginConsole += EventManagerOnPluginConsole; | 137 | m_scene.EventManager.OnPluginConsole += EventManagerOnPluginConsole; |
139 | 138 | ||
@@ -779,34 +778,24 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
779 | 778 | ||
780 | #region Parcel Modification | 779 | #region Parcel Modification |
781 | 780 | ||
782 | public void ResetAllLandPrimCounts() | 781 | public void ResetOverMeRecord() |
783 | { | 782 | { |
784 | lock (m_landList) | 783 | lock (m_landList) |
785 | { | 784 | { |
786 | foreach (LandObject p in m_landList.Values) | 785 | foreach (LandObject p in m_landList.Values) |
787 | { | 786 | { |
788 | p.ResetLandPrimCounts(); | 787 | p.ResetOverMeRecord(); |
789 | } | 788 | } |
790 | } | 789 | } |
791 | } | 790 | } |
792 | 791 | ||
793 | public void EventManagerOnParcelPrimCountTainted() | ||
794 | { | ||
795 | m_landPrimCountTainted = true; | ||
796 | } | ||
797 | |||
798 | public bool IsLandPrimCountTainted() | ||
799 | { | ||
800 | return m_landPrimCountTainted; | ||
801 | } | ||
802 | |||
803 | public void EventManagerOnParcelPrimCountAdd(SceneObjectGroup obj) | 792 | public void EventManagerOnParcelPrimCountAdd(SceneObjectGroup obj) |
804 | { | 793 | { |
805 | Vector3 position = obj.AbsolutePosition; | 794 | Vector3 position = obj.AbsolutePosition; |
806 | ILandObject landUnderPrim = GetLandObject(position.X, position.Y); | 795 | ILandObject landUnderPrim = GetLandObject(position.X, position.Y); |
807 | if (landUnderPrim != null) | 796 | if (landUnderPrim != null) |
808 | { | 797 | { |
809 | ((LandObject)landUnderPrim).AddPrimToCount(obj); | 798 | ((LandObject)landUnderPrim).AddPrimOverMe(obj); |
810 | } | 799 | } |
811 | } | 800 | } |
812 | 801 | ||
@@ -816,7 +805,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
816 | { | 805 | { |
817 | foreach (LandObject p in m_landList.Values) | 806 | foreach (LandObject p in m_landList.Values) |
818 | { | 807 | { |
819 | p.RemovePrimFromCount(obj); | 808 | p.RemovePrimFromOverMe(obj); |
820 | } | 809 | } |
821 | } | 810 | } |
822 | } | 811 | } |
@@ -849,8 +838,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
849 | foreach (LandObject p in landOwnersAndParcels[owner]) | 838 | foreach (LandObject p in landOwnersAndParcels[owner]) |
850 | { | 839 | { |
851 | simArea += p.LandData.Area; | 840 | simArea += p.LandData.Area; |
852 | simPrims += p.LandData.OwnerPrims + p.LandData.OtherPrims + p.LandData.GroupPrims + | 841 | simPrims += p.PrimCounts.Total; |
853 | p.LandData.SelectedPrims; | ||
854 | } | 842 | } |
855 | 843 | ||
856 | foreach (LandObject p in landOwnersAndParcels[owner]) | 844 | foreach (LandObject p in landOwnersAndParcels[owner]) |
@@ -867,7 +855,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
867 | // "[LAND MANAGEMENT MODULE]: Triggered EventManagerOnParcelPrimCountUpdate() for {0}", | 855 | // "[LAND MANAGEMENT MODULE]: Triggered EventManagerOnParcelPrimCountUpdate() for {0}", |
868 | // m_scene.RegionInfo.RegionName); | 856 | // m_scene.RegionInfo.RegionName); |
869 | 857 | ||
870 | ResetAllLandPrimCounts(); | 858 | ResetOverMeRecord(); |
871 | EntityBase[] entities = m_scene.Entities.GetEntities(); | 859 | EntityBase[] entities = m_scene.Entities.GetEntities(); |
872 | foreach (EntityBase obj in entities) | 860 | foreach (EntityBase obj in entities) |
873 | { | 861 | { |
@@ -880,15 +868,13 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
880 | } | 868 | } |
881 | } | 869 | } |
882 | FinalizeLandPrimCountUpdate(); | 870 | FinalizeLandPrimCountUpdate(); |
883 | m_landPrimCountTainted = false; | ||
884 | } | 871 | } |
885 | 872 | ||
886 | public void EventManagerOnRequestParcelPrimCountUpdate() | 873 | public void EventManagerOnRequestParcelPrimCountUpdate() |
887 | { | 874 | { |
888 | ResetAllLandPrimCounts(); | 875 | ResetOverMeRecord(); |
889 | m_scene.EventManager.TriggerParcelPrimCountUpdate(); | 876 | m_scene.EventManager.TriggerParcelPrimCountUpdate(); |
890 | FinalizeLandPrimCountUpdate(); | 877 | FinalizeLandPrimCountUpdate(); |
891 | m_landPrimCountTainted = false; | ||
892 | } | 878 | } |
893 | 879 | ||
894 | /// <summary> | 880 | /// <summary> |
@@ -952,8 +938,6 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
952 | m_landList[startLandObjectIndex].ForceUpdateLandInfo(); | 938 | m_landList[startLandObjectIndex].ForceUpdateLandInfo(); |
953 | } | 939 | } |
954 | 940 | ||
955 | EventManagerOnParcelPrimCountTainted(); | ||
956 | |||
957 | //Now add the new land object | 941 | //Now add the new land object |
958 | ILandObject result = AddLandObject(newLand); | 942 | ILandObject result = AddLandObject(newLand); |
959 | UpdateLandObject(startLandObject.LandData.LocalID, startLandObject.LandData); | 943 | UpdateLandObject(startLandObject.LandData.LocalID, startLandObject.LandData); |
@@ -1020,7 +1004,6 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1020 | performFinalLandJoin(masterLandObject, slaveLandObject); | 1004 | performFinalLandJoin(masterLandObject, slaveLandObject); |
1021 | } | 1005 | } |
1022 | } | 1006 | } |
1023 | EventManagerOnParcelPrimCountTainted(); | ||
1024 | 1007 | ||
1025 | masterLandObject.SendLandUpdateToAvatarsOverMe(); | 1008 | masterLandObject.SendLandUpdateToAvatarsOverMe(); |
1026 | } | 1009 | } |