From 06577d7299f38c342c9b241c691e647e5329837e Mon Sep 17 00:00:00 2001 From: Dan Lake Date: Thu, 27 Oct 2011 01:25:12 -0700 Subject: Continuation of previous checkin. Found more places where ForEachScenePresence can be changed to ForEachRootScenePresence. --- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 9 ++-- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 53 ++++++++++------------ 2 files changed, 26 insertions(+), 36 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index c8ecc9b..3a4f52e 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -1440,10 +1440,9 @@ namespace OpenSim.Region.Framework.Scenes if (volume < 0) volume = 0; - m_parentGroup.Scene.ForEachScenePresence(delegate(ScenePresence sp) + m_parentGroup.Scene.ForEachRootScenePresence(delegate(ScenePresence sp) { - if (!sp.IsChildAgent) - sp.ControllingClient.SendAttachedSoundGainChange(UUID, (float)volume); + sp.ControllingClient.SendAttachedSoundGainChange(UUID, (float)volume); }); } @@ -2676,10 +2675,8 @@ namespace OpenSim.Region.Framework.Scenes } } - m_parentGroup.Scene.ForEachScenePresence(delegate(ScenePresence sp) + m_parentGroup.Scene.ForEachRootScenePresence(delegate(ScenePresence sp) { - if (sp.IsChildAgent) - return; if (!(Util.GetDistanceTo(sp.AbsolutePosition, AbsolutePosition) >= 100)) sp.ControllingClient.SendPreLoadSound(objectID, objectID, soundID); }); diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index ee6c708..3834b79 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -2598,19 +2598,15 @@ namespace OpenSim.Region.Framework.Scenes public void SendOtherAgentsAvatarDataToMe() { int count = 0; - m_scene.ForEachScenePresence(delegate(ScenePresence scenePresence) - { - // only send information about root agents - if (scenePresence.IsChildAgent) - return; - - // only send information about other root agents - if (scenePresence.UUID == UUID) - return; + m_scene.ForEachRootScenePresence(delegate(ScenePresence scenePresence) + { + // only send information about other root agents + if (scenePresence.UUID == UUID) + return; - scenePresence.SendAvatarDataToAgent(this); - count++; - }); + scenePresence.SendAvatarDataToAgent(this); + count++; + }); m_scene.StatsReporter.AddAgentUpdates(count); } @@ -2644,13 +2640,14 @@ namespace OpenSim.Region.Framework.Scenes int count = 0; m_scene.ForEachScenePresence(delegate(ScenePresence scenePresence) - { - if (scenePresence.UUID == UUID) - return; + { + // only send information to other root agents + if (scenePresence.UUID == UUID) + return; - SendAppearanceToAgent(scenePresence); - count++; - }); + SendAppearanceToAgent(scenePresence); + count++; + }); m_scene.StatsReporter.AddAgentUpdates(count); } @@ -2664,19 +2661,15 @@ namespace OpenSim.Region.Framework.Scenes //m_log.DebugFormat("[SCENE PRESENCE] SendOtherAgentsAppearanceToMe: {0} ({1})", Name, UUID); int count = 0; - m_scene.ForEachScenePresence(delegate(ScenePresence scenePresence) - { - // only send information about root agents - if (scenePresence.IsChildAgent) - return; - - // only send information about other root agents - if (scenePresence.UUID == UUID) - return; + m_scene.ForEachRootScenePresence(delegate(ScenePresence scenePresence) + { + // only send information about other root agents + if (scenePresence.UUID == UUID) + return; - scenePresence.SendAppearanceToAgent(this); - count++; - }); + scenePresence.SendAppearanceToAgent(this); + count++; + }); m_scene.StatsReporter.AddAgentUpdates(count); } -- cgit v1.1