diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Land/LandObject.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Land/LandObject.cs | 63 |
1 files changed, 55 insertions, 8 deletions
diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs index 5969d45..8ddff99 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)) |
@@ -1185,6 +1206,17 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1185 | 1206 | ||
1186 | #endregion | 1207 | #endregion |
1187 | 1208 | ||
1209 | private void OnFrame() | ||
1210 | { | ||
1211 | m_expiryCounter++; | ||
1212 | |||
1213 | if (m_expiryCounter >= 50) | ||
1214 | { | ||
1215 | ExpireAccessList(); | ||
1216 | m_expiryCounter = 0; | ||
1217 | } | ||
1218 | } | ||
1219 | |||
1188 | private void ExpireAccessList() | 1220 | private void ExpireAccessList() |
1189 | { | 1221 | { |
1190 | List<LandAccessEntry> delete = new List<LandAccessEntry>(); | 1222 | List<LandAccessEntry> delete = new List<LandAccessEntry>(); |
@@ -1195,7 +1227,22 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1195 | delete.Add(entry); | 1227 | delete.Add(entry); |
1196 | } | 1228 | } |
1197 | foreach (LandAccessEntry entry in delete) | 1229 | foreach (LandAccessEntry entry in delete) |
1230 | { | ||
1198 | LandData.ParcelAccessList.Remove(entry); | 1231 | LandData.ParcelAccessList.Remove(entry); |
1232 | ScenePresence presence; | ||
1233 | |||
1234 | if (m_scene.TryGetScenePresence(entry.AgentID, out presence) && (!presence.IsChildAgent)) | ||
1235 | { | ||
1236 | ILandObject land = m_scene.LandChannel.GetLandObject(presence.AbsolutePosition.X, presence.AbsolutePosition.Y); | ||
1237 | if (land.LandData.LocalID == LandData.LocalID) | ||
1238 | { | ||
1239 | Vector3 pos = m_scene.GetNearestAllowedPosition(presence, land); | ||
1240 | presence.TeleportWithMomentum(pos, null); | ||
1241 | presence.ControllingClient.SendAlertMessage("You have been ejected from this land"); | ||
1242 | } | ||
1243 | } | ||
1244 | m_log.DebugFormat("[LAND]: Removing entry {0} because it has expired", entry.AgentID); | ||
1245 | } | ||
1199 | 1246 | ||
1200 | if (delete.Count > 0) | 1247 | if (delete.Count > 0) |
1201 | m_scene.EventManager.TriggerLandObjectUpdated((uint)LandData.LocalID, this); | 1248 | m_scene.EventManager.TriggerLandObjectUpdated((uint)LandData.LocalID, this); |