diff options
author | Dan Lake | 2010-03-19 05:51:16 -0700 |
---|---|---|
committer | John Hurliman | 2010-03-19 15:16:35 -0700 |
commit | 859bc717a4fe4cd5810ad9889cfb9b1e7f5c2046 (patch) | |
tree | dcce6c74d201b52c1a04ec9ec2cb90ce068fc020 /OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |
parent | Inconsistent locking of ScenePresence array in SceneGraph. Fixed by eliminati... (diff) | |
download | opensim-SC-859bc717a4fe4cd5810ad9889cfb9b1e7f5c2046.zip opensim-SC-859bc717a4fe4cd5810ad9889cfb9b1e7f5c2046.tar.gz opensim-SC-859bc717a4fe4cd5810ad9889cfb9b1e7f5c2046.tar.bz2 opensim-SC-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/Framework/Scenes/SceneObjectPart.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 0e21487..88bdf31 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -1321,11 +1321,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
1321 | if (volume < 0) | 1321 | if (volume < 0) |
1322 | volume = 0; | 1322 | volume = 0; |
1323 | 1323 | ||
1324 | List<ScenePresence> avatarts = m_parentGroup.Scene.GetAvatars(); | 1324 | m_parentGroup.Scene.ForEachScenePresence(delegate(ScenePresence sp) |
1325 | foreach (ScenePresence p in avatarts) | ||
1326 | { | 1325 | { |
1327 | p.ControllingClient.SendAttachedSoundGainChange(UUID, (float)volume); | 1326 | if(!sp.IsChildAgent) |
1328 | } | 1327 | sp.ControllingClient.SendAttachedSoundGainChange(UUID, (float)volume); |
1328 | }); | ||
1329 | } | 1329 | } |
1330 | 1330 | ||
1331 | /// <summary> | 1331 | /// <summary> |
@@ -2609,12 +2609,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
2609 | } | 2609 | } |
2610 | } | 2610 | } |
2611 | 2611 | ||
2612 | List<ScenePresence> avatarts = m_parentGroup.Scene.GetAvatars(); | 2612 | m_parentGroup.Scene.ForEachScenePresence(delegate(ScenePresence sp) |
2613 | foreach (ScenePresence p in avatarts) | ||
2614 | { | 2613 | { |
2615 | if (!(Util.GetDistanceTo(p.AbsolutePosition, AbsolutePosition) >= 100)) | 2614 | if (sp.IsChildAgent) |
2616 | p.ControllingClient.SendPreLoadSound(objectID, objectID, soundID); | 2615 | return; |
2617 | } | 2616 | if (!(Util.GetDistanceTo(sp.AbsolutePosition, AbsolutePosition) >= 100)) |
2617 | sp.ControllingClient.SendPreLoadSound(objectID, objectID, soundID); | ||
2618 | }); | ||
2618 | } | 2619 | } |
2619 | 2620 | ||
2620 | public void RemFlag(PrimFlags flag) | 2621 | public void RemFlag(PrimFlags flag) |