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 5969d45..07d00c0 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 | } |
@@ -249,7 +270,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
249 | remote_client.SendLandProperties(seq_id, | 270 | remote_client.SendLandProperties(seq_id, |
250 | snap_selection, request_result, this, | 271 | snap_selection, request_result, this, |
251 | (float)m_scene.RegionInfo.RegionSettings.ObjectBonus, | 272 | (float)m_scene.RegionInfo.RegionSettings.ObjectBonus, |
252 | GetParcelMaxPrimCount(), | 273 | GetParcelBasePrimCount(), |
253 | GetSimulatorMaxPrimCount(), regionFlags); | 274 | GetSimulatorMaxPrimCount(), regionFlags); |
254 | } | 275 | } |
255 | 276 | ||
@@ -309,7 +330,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
309 | 330 | ||
310 | allowedDelta |= (uint)(ParcelFlags.ShowDirectory | | 331 | allowedDelta |= (uint)(ParcelFlags.ShowDirectory | |
311 | ParcelFlags.AllowPublish | | 332 | ParcelFlags.AllowPublish | |
312 | ParcelFlags.MaturePublish); | 333 | ParcelFlags.MaturePublish) | (uint)(1 << 23); |
313 | } | 334 | } |
314 | 335 | ||
315 | if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId,this, GroupPowers.LandChangeIdentity)) | 336 | if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId,this, GroupPowers.LandChangeIdentity)) |
@@ -421,6 +442,19 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
421 | return false; | 442 | return false; |
422 | } | 443 | } |
423 | 444 | ||
445 | public bool CanBeOnThisLand(UUID avatar, float posHeight) | ||
446 | { | ||
447 | if (posHeight < LandChannel.BAN_LINE_SAFETY_HIEGHT && IsBannedFromLand(avatar)) | ||
448 | { | ||
449 | return false; | ||
450 | } | ||
451 | else if (IsRestrictedFromLand(avatar)) | ||
452 | { | ||
453 | return false; | ||
454 | } | ||
455 | return true; | ||
456 | } | ||
457 | |||
424 | public bool HasGroupAccess(UUID avatar) | 458 | public bool HasGroupAccess(UUID avatar) |
425 | { | 459 | { |
426 | if (LandData.GroupID != UUID.Zero && (LandData.Flags & (uint)ParcelFlags.UseAccessGroup) == (uint)ParcelFlags.UseAccessGroup) | 460 | if (LandData.GroupID != UUID.Zero && (LandData.Flags & (uint)ParcelFlags.UseAccessGroup) == (uint)ParcelFlags.UseAccessGroup) |
@@ -1185,6 +1219,17 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1185 | 1219 | ||
1186 | #endregion | 1220 | #endregion |
1187 | 1221 | ||
1222 | private void OnFrame() | ||
1223 | { | ||
1224 | m_expiryCounter++; | ||
1225 | |||
1226 | if (m_expiryCounter >= 50) | ||
1227 | { | ||
1228 | ExpireAccessList(); | ||
1229 | m_expiryCounter = 0; | ||
1230 | } | ||
1231 | } | ||
1232 | |||
1188 | private void ExpireAccessList() | 1233 | private void ExpireAccessList() |
1189 | { | 1234 | { |
1190 | List<LandAccessEntry> delete = new List<LandAccessEntry>(); | 1235 | List<LandAccessEntry> delete = new List<LandAccessEntry>(); |
@@ -1195,7 +1240,22 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1195 | delete.Add(entry); | 1240 | delete.Add(entry); |
1196 | } | 1241 | } |
1197 | foreach (LandAccessEntry entry in delete) | 1242 | foreach (LandAccessEntry entry in delete) |
1243 | { | ||
1198 | LandData.ParcelAccessList.Remove(entry); | 1244 | LandData.ParcelAccessList.Remove(entry); |
1245 | ScenePresence presence; | ||
1246 | |||
1247 | if (m_scene.TryGetScenePresence(entry.AgentID, out presence) && (!presence.IsChildAgent)) | ||
1248 | { | ||
1249 | ILandObject land = m_scene.LandChannel.GetLandObject(presence.AbsolutePosition.X, presence.AbsolutePosition.Y); | ||
1250 | if (land.LandData.LocalID == LandData.LocalID) | ||
1251 | { | ||
1252 | Vector3 pos = m_scene.GetNearestAllowedPosition(presence, land); | ||
1253 | presence.TeleportWithMomentum(pos, null); | ||
1254 | presence.ControllingClient.SendAlertMessage("You have been ejected from this land"); | ||
1255 | } | ||
1256 | } | ||
1257 | m_log.DebugFormat("[LAND]: Removing entry {0} because it has expired", entry.AgentID); | ||
1258 | } | ||
1199 | 1259 | ||
1200 | if (delete.Count > 0) | 1260 | if (delete.Count > 0) |
1201 | m_scene.EventManager.TriggerLandObjectUpdated((uint)LandData.LocalID, this); | 1261 | m_scene.EventManager.TriggerLandObjectUpdated((uint)LandData.LocalID, this); |