aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
diff options
context:
space:
mode:
authorDan Lake2010-03-19 05:51:16 -0700
committerJohn Hurliman2010-03-19 15:16:35 -0700
commit859bc717a4fe4cd5810ad9889cfb9b1e7f5c2046 (patch)
treedcce6c74d201b52c1a04ec9ec2cb90ce068fc020 /OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
parentInconsistent locking of ScenePresence array in SceneGraph. Fixed by eliminati... (diff)
downloadopensim-SC_OLD-859bc717a4fe4cd5810ad9889cfb9b1e7f5c2046.zip
opensim-SC_OLD-859bc717a4fe4cd5810ad9889cfb9b1e7f5c2046.tar.gz
opensim-SC_OLD-859bc717a4fe4cd5810ad9889cfb9b1e7f5c2046.tar.bz2
opensim-SC_OLD-859bc717a4fe4cd5810ad9889cfb9b1e7f5c2046.tar.xz
Cleaned up access to scenepresences in scenegraph. GetScenePresences and GetAvatars have been removed to consolidate locking and iteration within SceneGraph. All callers which used these to then iterate over presences have been refactored to instead pass their delegates to Scene.ForEachScenePresence(Action<ScenePresence>).
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs39
1 files changed, 18 insertions, 21 deletions
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
index 1279ac1..5750aa4 100644
--- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
+++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
@@ -191,9 +191,9 @@ namespace OpenSim.Region.CoreModules.World.Land
191 forcedPosition = null; 191 forcedPosition = null;
192 } 192 }
193 //if we are far away, teleport 193 //if we are far away, teleport
194 else if (Vector3.Distance(clientAvatar.AbsolutePosition,forcedPosition.Value) > 3) 194 else if (Vector3.Distance(clientAvatar.AbsolutePosition, forcedPosition.Value) > 3)
195 { 195 {
196 Debug.WriteLine(string.Format("Teleporting out because {0} is too far from avatar position {1}",forcedPosition.Value,clientAvatar.AbsolutePosition)); 196 Debug.WriteLine(string.Format("Teleporting out because {0} is too far from avatar position {1}", forcedPosition.Value, clientAvatar.AbsolutePosition));
197 clientAvatar.Teleport(forcedPosition.Value); 197 clientAvatar.Teleport(forcedPosition.Value);
198 forcedPosition = null; 198 forcedPosition = null;
199 } 199 }
@@ -374,30 +374,27 @@ namespace OpenSim.Region.CoreModules.World.Land
374 } 374 }
375 } 375 }
376 376
377 public void SendOutNearestBanLine(IClientAPI avatar) 377 public void SendOutNearestBanLine(IClientAPI client)
378 { 378 {
379 List<ScenePresence> avatars = m_scene.GetAvatars(); 379 ScenePresence sp = m_scene.GetScenePresence(client.AgentId);
380 foreach (ScenePresence presence in avatars) 380 if (sp == null || sp.IsChildAgent)
381 return;
382
383 List<ILandObject> checkLandParcels = ParcelsNearPoint(sp.AbsolutePosition);
384 foreach (ILandObject checkBan in checkLandParcels)
381 { 385 {
382 if (presence.UUID == avatar.AgentId) 386 if (checkBan.IsBannedFromLand(client.AgentId))
383 { 387 {
384 List<ILandObject> checkLandParcels = ParcelsNearPoint(presence.AbsolutePosition); 388 checkBan.SendLandProperties((int)ParcelPropertiesStatus.CollisionBanned, false, (int)ParcelResult.Single, client);
385 foreach (ILandObject checkBan in checkLandParcels) 389 return; //Only send one
386 { 390 }
387 if (checkBan.IsBannedFromLand(avatar.AgentId)) 391 if (checkBan.IsRestrictedFromLand(client.AgentId))
388 { 392 {
389 checkBan.SendLandProperties((int)ParcelPropertiesStatus.CollisionBanned, false, (int)ParcelResult.Single, avatar); 393 checkBan.SendLandProperties((int)ParcelPropertiesStatus.CollisionNotOnAccessList, false, (int)ParcelResult.Single, client);
390 return; //Only send one 394 return; //Only send one
391 }
392 if (checkBan.IsRestrictedFromLand(avatar.AgentId))
393 {
394 checkBan.SendLandProperties((int)ParcelPropertiesStatus.CollisionNotOnAccessList, false, (int)ParcelResult.Single, avatar);
395 return; //Only send one
396 }
397 }
398 return;
399 } 395 }
400 } 396 }
397 return;
401 } 398 }
402 399
403 public void SendLandUpdate(ScenePresence avatar, bool force) 400 public void SendLandUpdate(ScenePresence avatar, bool force)