mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 09:16:28 +08:00
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>).
This commit is contained in:
@@ -1321,11 +1321,11 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
if (volume < 0)
|
||||
volume = 0;
|
||||
|
||||
List<ScenePresence> avatarts = m_parentGroup.Scene.GetAvatars();
|
||||
foreach (ScenePresence p in avatarts)
|
||||
m_parentGroup.Scene.ForEachScenePresence(delegate(ScenePresence sp)
|
||||
{
|
||||
p.ControllingClient.SendAttachedSoundGainChange(UUID, (float)volume);
|
||||
}
|
||||
if(!sp.IsChildAgent)
|
||||
sp.ControllingClient.SendAttachedSoundGainChange(UUID, (float)volume);
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -2609,12 +2609,13 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
}
|
||||
|
||||
List<ScenePresence> avatarts = m_parentGroup.Scene.GetAvatars();
|
||||
foreach (ScenePresence p in avatarts)
|
||||
m_parentGroup.Scene.ForEachScenePresence(delegate(ScenePresence sp)
|
||||
{
|
||||
if (!(Util.GetDistanceTo(p.AbsolutePosition, AbsolutePosition) >= 100))
|
||||
p.ControllingClient.SendPreLoadSound(objectID, objectID, soundID);
|
||||
}
|
||||
if (sp.IsChildAgent)
|
||||
return;
|
||||
if (!(Util.GetDistanceTo(sp.AbsolutePosition, AbsolutePosition) >= 100))
|
||||
sp.ControllingClient.SendPreLoadSound(objectID, objectID, soundID);
|
||||
});
|
||||
}
|
||||
|
||||
public void RemFlag(PrimFlags flag)
|
||||
|
||||
Reference in New Issue
Block a user