From 859bc717a4fe4cd5810ad9889cfb9b1e7f5c2046 Mon Sep 17 00:00:00 2001 From: Dan Lake Date: Fri, 19 Mar 2010 05:51:16 -0700 Subject: 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). --- OpenSim/Region/Examples/SimpleModule/RegionModule.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region/Examples/SimpleModule') diff --git a/OpenSim/Region/Examples/SimpleModule/RegionModule.cs b/OpenSim/Region/Examples/SimpleModule/RegionModule.cs index e1d5bdc..6da41db 100644 --- a/OpenSim/Region/Examples/SimpleModule/RegionModule.cs +++ b/OpenSim/Region/Examples/SimpleModule/RegionModule.cs @@ -88,12 +88,12 @@ namespace OpenSim.Region.Examples.SimpleModule m_scene.AgentCrossing(m_character.AgentId, Vector3.Zero, false); } - List avatars = m_scene.GetAvatars(); - foreach (ScenePresence avatar in avatars) + m_scene.ForEachScenePresence(delegate(ScenePresence sp) { - avatar.AbsolutePosition = - new Vector3((float)Util.RandomClass.Next(100, 200), (float)Util.RandomClass.Next(30, 200), 2); - } + if (!sp.IsChildAgent) + sp.AbsolutePosition = + new Vector3((float)Util.RandomClass.Next(100, 200), (float)Util.RandomClass.Next(30, 200), 2); + }); } // private void AddComplexObjects(RegionInfo regionInfo, Vector3 pos) -- cgit v1.1