diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Land/LandObject.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Land/LandObject.cs | 76 |
1 files changed, 68 insertions, 8 deletions
diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs index 8406442..31f8a3f 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs | |||
@@ -51,6 +51,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
51 | private bool[,] m_landBitmap = new bool[landArrayMax,landArrayMax]; | 51 | private bool[,] m_landBitmap = new bool[landArrayMax,landArrayMax]; |
52 | 52 | ||
53 | private int m_lastSeqId = 0; | 53 | private int m_lastSeqId = 0; |
54 | private int m_expiryCounter = 0; | ||
54 | 55 | ||
55 | protected LandData m_landData = new LandData(); | 56 | protected LandData m_landData = new LandData(); |
56 | protected Scene m_scene; | 57 | protected Scene m_scene; |
@@ -136,6 +137,8 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
136 | else | 137 | else |
137 | LandData.GroupID = UUID.Zero; | 138 | LandData.GroupID = UUID.Zero; |
138 | LandData.IsGroupOwned = is_group_owned; | 139 | LandData.IsGroupOwned = is_group_owned; |
140 | |||
141 | m_scene.EventManager.OnFrame += OnFrame; | ||
139 | } | 142 | } |
140 | 143 | ||
141 | #endregion | 144 | #endregion |
@@ -194,10 +197,27 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
194 | else | 197 | else |
195 | { | 198 | { |
196 | // Normal Calculations | 199 | // Normal Calculations |
197 | int parcelMax = (int)(((float)LandData.Area / 65536.0f) | 200 | int parcelMax = (int)((long)LandData.Area |
198 | * (float)m_scene.RegionInfo.ObjectCapacity | 201 | * (long)m_scene.RegionInfo.ObjectCapacity |
199 | * (float)m_scene.RegionInfo.RegionSettings.ObjectBonus); | 202 | * (long)m_scene.RegionInfo.RegionSettings.ObjectBonus |
200 | // TODO: The calculation of ObjectBonus should be refactored. It does still not work in the same manner as SL! | 203 | / 65536L); |
204 | //m_log.DebugFormat("Area: {0}, Capacity {1}, Bonus {2}, Parcel {3}", LandData.Area, m_scene.RegionInfo.ObjectCapacity, m_scene.RegionInfo.RegionSettings.ObjectBonus, parcelMax); | ||
205 | return parcelMax; | ||
206 | } | ||
207 | } | ||
208 | |||
209 | private int GetParcelBasePrimCount() | ||
210 | { | ||
211 | if (overrideParcelMaxPrimCount != null) | ||
212 | { | ||
213 | return overrideParcelMaxPrimCount(this); | ||
214 | } | ||
215 | else | ||
216 | { | ||
217 | // Normal Calculations | ||
218 | int parcelMax = (int)((long)LandData.Area | ||
219 | * (long)m_scene.RegionInfo.ObjectCapacity | ||
220 | / 65536L); | ||
201 | return parcelMax; | 221 | return parcelMax; |
202 | } | 222 | } |
203 | } | 223 | } |
@@ -211,8 +231,9 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
211 | else | 231 | else |
212 | { | 232 | { |
213 | //Normal Calculations | 233 | //Normal Calculations |
214 | int simMax = (int)(((float)LandData.SimwideArea / 65536.0f) | 234 | int simMax = (int)((long)LandData.SimwideArea |
215 | * (float)m_scene.RegionInfo.ObjectCapacity); | 235 | * (long)m_scene.RegionInfo.ObjectCapacity / 65536L); |
236 | // m_log.DebugFormat("Simwide Area: {0}, Capacity {1}, SimMax {2}", LandData.SimwideArea, m_scene.RegionInfo.ObjectCapacity, simMax); | ||
216 | return simMax; | 237 | return simMax; |
217 | } | 238 | } |
218 | } | 239 | } |
@@ -242,7 +263,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
242 | remote_client.SendLandProperties(seq_id, | 263 | remote_client.SendLandProperties(seq_id, |
243 | snap_selection, request_result, this, | 264 | snap_selection, request_result, this, |
244 | (float)m_scene.RegionInfo.RegionSettings.ObjectBonus, | 265 | (float)m_scene.RegionInfo.RegionSettings.ObjectBonus, |
245 | GetParcelMaxPrimCount(), | 266 | GetParcelBasePrimCount(), |
246 | GetSimulatorMaxPrimCount(), regionFlags); | 267 | GetSimulatorMaxPrimCount(), regionFlags); |
247 | } | 268 | } |
248 | 269 | ||
@@ -302,7 +323,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
302 | 323 | ||
303 | allowedDelta |= (uint)(ParcelFlags.ShowDirectory | | 324 | allowedDelta |= (uint)(ParcelFlags.ShowDirectory | |
304 | ParcelFlags.AllowPublish | | 325 | ParcelFlags.AllowPublish | |
305 | ParcelFlags.MaturePublish); | 326 | ParcelFlags.MaturePublish) | (uint)(1 << 23); |
306 | } | 327 | } |
307 | 328 | ||
308 | if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId,this, GroupPowers.LandChangeIdentity)) | 329 | if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId,this, GroupPowers.LandChangeIdentity)) |
@@ -414,6 +435,19 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
414 | return false; | 435 | return false; |
415 | } | 436 | } |
416 | 437 | ||
438 | public bool CanBeOnThisLand(UUID avatar, float posHeight) | ||
439 | { | ||
440 | if (posHeight < LandChannel.BAN_LINE_SAFETY_HIEGHT && IsBannedFromLand(avatar)) | ||
441 | { | ||
442 | return false; | ||
443 | } | ||
444 | else if (IsRestrictedFromLand(avatar)) | ||
445 | { | ||
446 | return false; | ||
447 | } | ||
448 | return true; | ||
449 | } | ||
450 | |||
417 | public bool HasGroupAccess(UUID avatar) | 451 | public bool HasGroupAccess(UUID avatar) |
418 | { | 452 | { |
419 | if (LandData.GroupID != UUID.Zero && (LandData.Flags & (uint)ParcelFlags.UseAccessGroup) == (uint)ParcelFlags.UseAccessGroup) | 453 | if (LandData.GroupID != UUID.Zero && (LandData.Flags & (uint)ParcelFlags.UseAccessGroup) == (uint)ParcelFlags.UseAccessGroup) |
@@ -1178,6 +1212,17 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1178 | 1212 | ||
1179 | #endregion | 1213 | #endregion |
1180 | 1214 | ||
1215 | private void OnFrame() | ||
1216 | { | ||
1217 | m_expiryCounter++; | ||
1218 | |||
1219 | if (m_expiryCounter >= 50) | ||
1220 | { | ||
1221 | ExpireAccessList(); | ||
1222 | m_expiryCounter = 0; | ||
1223 | } | ||
1224 | } | ||
1225 | |||
1181 | private void ExpireAccessList() | 1226 | private void ExpireAccessList() |
1182 | { | 1227 | { |
1183 | List<LandAccessEntry> delete = new List<LandAccessEntry>(); | 1228 | List<LandAccessEntry> delete = new List<LandAccessEntry>(); |
@@ -1188,7 +1233,22 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1188 | delete.Add(entry); | 1233 | delete.Add(entry); |
1189 | } | 1234 | } |
1190 | foreach (LandAccessEntry entry in delete) | 1235 | foreach (LandAccessEntry entry in delete) |
1236 | { | ||
1191 | LandData.ParcelAccessList.Remove(entry); | 1237 | LandData.ParcelAccessList.Remove(entry); |
1238 | ScenePresence presence; | ||
1239 | |||
1240 | if (m_scene.TryGetScenePresence(entry.AgentID, out presence) && (!presence.IsChildAgent)) | ||
1241 | { | ||
1242 | ILandObject land = m_scene.LandChannel.GetLandObject(presence.AbsolutePosition.X, presence.AbsolutePosition.Y); | ||
1243 | if (land.LandData.LocalID == LandData.LocalID) | ||
1244 | { | ||
1245 | Vector3 pos = m_scene.GetNearestAllowedPosition(presence, land); | ||
1246 | presence.TeleportWithMomentum(pos, null); | ||
1247 | presence.ControllingClient.SendAlertMessage("You have been ejected from this land"); | ||
1248 | } | ||
1249 | } | ||
1250 | m_log.DebugFormat("[LAND]: Removing entry {0} because it has expired", entry.AgentID); | ||
1251 | } | ||
1192 | 1252 | ||
1193 | if (delete.Count > 0) | 1253 | if (delete.Count > 0) |
1194 | m_scene.EventManager.TriggerLandObjectUpdated((uint)LandData.LocalID, this); | 1254 | m_scene.EventManager.TriggerLandObjectUpdated((uint)LandData.LocalID, this); |