aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/World/Land/LandObject.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Land/LandObject.cs')
-rw-r--r--OpenSim/Region/CoreModules/World/Land/LandObject.cs63
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 0536f6e..4f06737 100644
--- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs
+++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs
@@ -50,6 +50,7 @@ namespace OpenSim.Region.CoreModules.World.Land
50 private bool[,] m_landBitmap = new bool[landArrayMax,landArrayMax]; 50 private bool[,] m_landBitmap = new bool[landArrayMax,landArrayMax];
51 51
52 private int m_lastSeqId = 0; 52 private int m_lastSeqId = 0;
53 private int m_expiryCounter = 0;
53 54
54 protected LandData m_landData = new LandData(); 55 protected LandData m_landData = new LandData();
55 protected Scene m_scene; 56 protected Scene m_scene;
@@ -135,6 +136,8 @@ namespace OpenSim.Region.CoreModules.World.Land
135 else 136 else
136 LandData.GroupID = UUID.Zero; 137 LandData.GroupID = UUID.Zero;
137 LandData.IsGroupOwned = is_group_owned; 138 LandData.IsGroupOwned = is_group_owned;
139
140 m_scene.EventManager.OnFrame += OnFrame;
138 } 141 }
139 142
140 #endregion 143 #endregion
@@ -193,10 +196,27 @@ namespace OpenSim.Region.CoreModules.World.Land
193 else 196 else
194 { 197 {
195 // Normal Calculations 198 // Normal Calculations
196 int parcelMax = (int)(((float)LandData.Area / 65536.0f) 199 int parcelMax = (int)((long)LandData.Area
197 * (float)m_scene.RegionInfo.ObjectCapacity 200 * (long)m_scene.RegionInfo.ObjectCapacity
198 * (float)m_scene.RegionInfo.RegionSettings.ObjectBonus); 201 * (long)m_scene.RegionInfo.RegionSettings.ObjectBonus
199 // TODO: The calculation of ObjectBonus should be refactored. It does still not work in the same manner as SL! 202 / 65536L);
203 //m_log.DebugFormat("Area: {0}, Capacity {1}, Bonus {2}, Parcel {3}", LandData.Area, m_scene.RegionInfo.ObjectCapacity, m_scene.RegionInfo.RegionSettings.ObjectBonus, parcelMax);
204 return parcelMax;
205 }
206 }
207
208 private int GetParcelBasePrimCount()
209 {
210 if (overrideParcelMaxPrimCount != null)
211 {
212 return overrideParcelMaxPrimCount(this);
213 }
214 else
215 {
216 // Normal Calculations
217 int parcelMax = (int)((long)LandData.Area
218 * (long)m_scene.RegionInfo.ObjectCapacity
219 / 65536L);
200 return parcelMax; 220 return parcelMax;
201 } 221 }
202 } 222 }
@@ -210,8 +230,9 @@ namespace OpenSim.Region.CoreModules.World.Land
210 else 230 else
211 { 231 {
212 //Normal Calculations 232 //Normal Calculations
213 int simMax = (int)(((float)LandData.SimwideArea / 65536.0f) 233 int simMax = (int)((long)LandData.SimwideArea
214 * (float)m_scene.RegionInfo.ObjectCapacity); 234 * (long)m_scene.RegionInfo.ObjectCapacity / 65536L);
235 // m_log.DebugFormat("Simwide Area: {0}, Capacity {1}, SimMax {2}", LandData.SimwideArea, m_scene.RegionInfo.ObjectCapacity, simMax);
215 return simMax; 236 return simMax;
216 } 237 }
217 } 238 }
@@ -248,7 +269,7 @@ namespace OpenSim.Region.CoreModules.World.Land
248 remote_client.SendLandProperties(seq_id, 269 remote_client.SendLandProperties(seq_id,
249 snap_selection, request_result, this, 270 snap_selection, request_result, this,
250 (float)m_scene.RegionInfo.RegionSettings.ObjectBonus, 271 (float)m_scene.RegionInfo.RegionSettings.ObjectBonus,
251 GetParcelMaxPrimCount(), 272 GetParcelBasePrimCount(),
252 GetSimulatorMaxPrimCount(), regionFlags); 273 GetSimulatorMaxPrimCount(), regionFlags);
253 } 274 }
254 275
@@ -308,7 +329,7 @@ namespace OpenSim.Region.CoreModules.World.Land
308 329
309 allowedDelta |= (uint)(ParcelFlags.ShowDirectory | 330 allowedDelta |= (uint)(ParcelFlags.ShowDirectory |
310 ParcelFlags.AllowPublish | 331 ParcelFlags.AllowPublish |
311 ParcelFlags.MaturePublish); 332 ParcelFlags.MaturePublish) | (uint)(1 << 23);
312 } 333 }
313 334
314 if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId,this, GroupPowers.LandChangeIdentity)) 335 if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId,this, GroupPowers.LandChangeIdentity))
@@ -1181,6 +1202,17 @@ namespace OpenSim.Region.CoreModules.World.Land
1181 1202
1182 #endregion 1203 #endregion
1183 1204
1205 private void OnFrame()
1206 {
1207 m_expiryCounter++;
1208
1209 if (m_expiryCounter >= 50)
1210 {
1211 ExpireAccessList();
1212 m_expiryCounter = 0;
1213 }
1214 }
1215
1184 private void ExpireAccessList() 1216 private void ExpireAccessList()
1185 { 1217 {
1186 List<LandAccessEntry> delete = new List<LandAccessEntry>(); 1218 List<LandAccessEntry> delete = new List<LandAccessEntry>();
@@ -1191,7 +1223,22 @@ namespace OpenSim.Region.CoreModules.World.Land
1191 delete.Add(entry); 1223 delete.Add(entry);
1192 } 1224 }
1193 foreach (LandAccessEntry entry in delete) 1225 foreach (LandAccessEntry entry in delete)
1226 {
1194 LandData.ParcelAccessList.Remove(entry); 1227 LandData.ParcelAccessList.Remove(entry);
1228 ScenePresence presence;
1229
1230 if (m_scene.TryGetScenePresence(entry.AgentID, out presence) && (!presence.IsChildAgent))
1231 {
1232 ILandObject land = m_scene.LandChannel.GetLandObject(presence.AbsolutePosition.X, presence.AbsolutePosition.Y);
1233 if (land.LandData.LocalID == LandData.LocalID)
1234 {
1235 Vector3 pos = m_scene.GetNearestAllowedPosition(presence, land);
1236 presence.TeleportWithMomentum(pos, null);
1237 presence.ControllingClient.SendAlertMessage("You have been ejected from this land");
1238 }
1239 }
1240 m_log.DebugFormat("[LAND]: Removing entry {0} because it has expired", entry.AgentID);
1241 }
1195 1242
1196 if (delete.Count > 0) 1243 if (delete.Count > 0)
1197 m_scene.EventManager.TriggerLandObjectUpdated((uint)LandData.LocalID, this); 1244 m_scene.EventManager.TriggerLandObjectUpdated((uint)LandData.LocalID, this);