From bc892c1d4c1f1e818f1dd1d3cf6d03186b19dd0b Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Tue, 29 Sep 2009 07:54:56 -0700 Subject: A little hack to see if this fixes the problems with ~20% of SOG's becoming phantom after an import to megaregions. --- OpenSim/Region/Framework/Scenes/Scene.cs | 5 +++++ OpenSim/Region/Framework/Scenes/SceneGraph.cs | 17 +++++++++++++++++ 2 files changed, 22 insertions(+) (limited to 'OpenSim/Region/Framework/Scenes') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index bb47ff4..39f3007 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -4141,6 +4141,11 @@ namespace OpenSim.Region.Framework.Scenes m_sceneGraph.ForEachClient(action); } + public void ForEachSOG(Action action) + { + m_sceneGraph.ForEachSOG(action); + } + /// /// Returns a list of the entities in the scene. This is a new list so operations perform on the list itself /// will not affect the original list of objects in the scene. diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index 48dea07..0c471aa 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs @@ -1134,6 +1134,23 @@ namespace OpenSim.Region.Framework.Scenes } } + protected internal void ForEachSOG(Action action) + { + List objlist = new List(SceneObjectGroupsByFullID.Values); + foreach (SceneObjectGroup obj in objlist) + { + try + { + action(obj); + } + catch (Exception e) + { + // Catch it and move on. This includes situations where splist has inconsistent info + m_log.WarnFormat("[SCENE]: Problem processing action in ForEachSOG: ", e.Message); + } + } + } + #endregion #region Client Event handlers -- cgit v1.1