diff options
author | UbitUmarov | 2017-01-20 14:26:24 +0000 |
---|---|---|
committer | UbitUmarov | 2017-01-20 14:26:24 +0000 |
commit | dac32c4e5acd76a3b42dede1c573dbef1a98c7e1 (patch) | |
tree | e438948fdf10696c2dc98632c18849a76828fe00 /OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs | |
parent | remove redundant IsGod, rename some GOD as Administrator (both only on permis... (diff) | |
download | opensim-SC-dac32c4e5acd76a3b42dede1c573dbef1a98c7e1.zip opensim-SC-dac32c4e5acd76a3b42dede1c573dbef1a98c7e1.tar.gz opensim-SC-dac32c4e5acd76a3b42dede1c573dbef1a98c7e1.tar.bz2 opensim-SC-dac32c4e5acd76a3b42dede1c573dbef1a98c7e1.tar.xz |
change CanObjectEntry() to use a SOG
Diffstat (limited to 'OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs')
-rw-r--r-- | OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs | 39 |
1 files changed, 15 insertions, 24 deletions
diff --git a/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs b/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs index 4875a61..9c0d801 100644 --- a/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs +++ b/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs | |||
@@ -135,50 +135,41 @@ namespace OpenSim.Region.OptionalModules | |||
135 | return true; | 135 | return true; |
136 | } | 136 | } |
137 | 137 | ||
138 | private bool CanObjectEnter(UUID objectID, bool enteringRegion, Vector3 newPoint, Scene scene) | 138 | private bool CanObjectEnter(SceneObjectGroup sog, bool enteringRegion, Vector3 newPoint, Scene scene) |
139 | { | 139 | { |
140 | if (newPoint.X < -1f || newPoint.X > (scene.RegionInfo.RegionSizeX + 1) || | 140 | float newX = newPoint.X; |
141 | newPoint.Y < -1f || newPoint.Y > (scene.RegionInfo.RegionSizeY) ) | 141 | float newY = newPoint.Y; |
142 | if (newX < -1f || newX > (scene.RegionInfo.RegionSizeX + 1.0f) || | ||
143 | newY < -1f || newY > (scene.RegionInfo.RegionSizeY + 1.0f) ) | ||
142 | return true; | 144 | return true; |
143 | 145 | ||
144 | SceneObjectPart obj = scene.GetSceneObjectPart(objectID); | 146 | if (sog == null) |
145 | |||
146 | if (obj == null) | ||
147 | return false; | 147 | return false; |
148 | 148 | ||
149 | // Prim counts are determined by the location of the root prim. if we're | 149 | ILandObject newParcel = scene.LandChannel.GetLandObject(newX, newY); |
150 | // moving a child prim, just let it pass | ||
151 | if (!obj.IsRoot) | ||
152 | { | ||
153 | return true; | ||
154 | } | ||
155 | |||
156 | ILandObject newParcel = scene.LandChannel.GetLandObject(newPoint.X, newPoint.Y); | ||
157 | 150 | ||
158 | if (newParcel == null) | 151 | if (newParcel == null) |
159 | return true; | 152 | return true; |
160 | 153 | ||
161 | Vector3 oldPoint = obj.GroupPosition; | 154 | if(!enteringRegion) |
162 | ILandObject oldParcel = scene.LandChannel.GetLandObject(oldPoint.X, oldPoint.Y); | ||
163 | |||
164 | // The prim hasn't crossed a region boundry so we don't need to worry | ||
165 | // about prim counts here | ||
166 | if(oldParcel != null && oldParcel.Equals(newParcel)) | ||
167 | { | 155 | { |
168 | return true; | 156 | Vector3 oldPoint = sog.AbsolutePosition; |
157 | ILandObject oldParcel = scene.LandChannel.GetLandObject(oldPoint.X, oldPoint.Y); | ||
158 | if(oldParcel != null && oldParcel.Equals(newParcel)) | ||
159 | return true; | ||
169 | } | 160 | } |
170 | 161 | ||
171 | int objectCount = obj.ParentGroup.PrimCount; | 162 | int objectCount = sog.PrimCount; |
172 | int usedPrims = newParcel.PrimCounts.Total; | 163 | int usedPrims = newParcel.PrimCounts.Total; |
173 | int simulatorCapacity = newParcel.GetSimulatorMaxPrimCount(); | 164 | int simulatorCapacity = newParcel.GetSimulatorMaxPrimCount(); |
174 | 165 | ||
175 | // TODO: Add Special Case here for temporary prims | 166 | // TODO: Add Special Case here for temporary prims |
176 | 167 | ||
177 | string response = DoCommonChecks(objectCount, obj.OwnerID, newParcel, scene); | 168 | string response = DoCommonChecks(objectCount, sog.OwnerID, newParcel, scene); |
178 | 169 | ||
179 | if (response != null) | 170 | if (response != null) |
180 | { | 171 | { |
181 | m_dialogModule.SendAlertToUser(obj.OwnerID, response); | 172 | m_dialogModule.SendAlertToUser(sog.OwnerID, response); |
182 | return false; | 173 | return false; |
183 | } | 174 | } |
184 | return true; | 175 | return true; |