aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/World/Wind/WindModule.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/Wind/WindModule.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 'OpenSim/Region/CoreModules/World/Wind/WindModule.cs')
-rw-r--r--OpenSim/Region/CoreModules/World/Wind/WindModule.cs12
1 files changed, 5 insertions, 7 deletions
diff --git a/OpenSim/Region/CoreModules/World/Wind/WindModule.cs b/OpenSim/Region/CoreModules/World/Wind/WindModule.cs
index 3283c1f..9736b73 100644
--- a/OpenSim/Region/CoreModules/World/Wind/WindModule.cs
+++ b/OpenSim/Region/CoreModules/World/Wind/WindModule.cs
@@ -425,9 +425,7 @@ namespace OpenSim.Region.CoreModules
425 { 425 {
426 if (m_ready) 426 if (m_ready)
427 { 427 {
428 List<ScenePresence> avatars = m_scene.GetAvatars(); 428 if(m_scene.GetRootAgentCount() > 0)
429
430 if (avatars.Count > 0)
431 { 429 {
432 // Ask wind plugin to generate a LL wind array to be cached locally 430 // Ask wind plugin to generate a LL wind array to be cached locally
433 // Try not to update this too often, as it may involve array copies 431 // Try not to update this too often, as it may involve array copies
@@ -437,11 +435,11 @@ namespace OpenSim.Region.CoreModules
437 m_frameLastUpdateClientArray = m_frame; 435 m_frameLastUpdateClientArray = m_frame;
438 } 436 }
439 437
440 foreach (ScenePresence avatar in avatars) 438 m_scene.ForEachScenePresence(delegate(ScenePresence sp)
441 { 439 {
442 if (!avatar.IsChildAgent) 440 if (!sp.IsChildAgent)
443 avatar.ControllingClient.SendWindData(windSpeeds); 441 sp.ControllingClient.SendWindData(windSpeeds);
444 } 442 });
445 } 443 }
446 } 444 }
447 } 445 }