A little hack to see if this fixes the problems with ~20% of SOG's becoming phantom after an import to megaregions.

0.6.8-post-fixes
Diva Canto 2009-09-29 07:54:56 -07:00
parent 77f5e41631
commit bc892c1d4c
3 changed files with 42 additions and 1 deletions

View File

@ -35,6 +35,7 @@ using OpenSim.Framework;
using OpenSim.Framework.Client; using OpenSim.Framework.Client;
using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes; using OpenSim.Region.Framework.Scenes;
using OpenSim.Framework.Console;
namespace OpenSim.Region.CoreModules.World.Land namespace OpenSim.Region.CoreModules.World.Land
{ {
@ -61,6 +62,9 @@ namespace OpenSim.Region.CoreModules.World.Land
IConfig myConfig = source.Configs["Startup"]; IConfig myConfig = source.Configs["Startup"];
enabledYN = myConfig.GetBoolean("CombineContiguousRegions", false); enabledYN = myConfig.GetBoolean("CombineContiguousRegions", false);
//enabledYN = true; //enabledYN = true;
if (enabledYN)
MainConsole.Instance.Commands.AddCommand("RegionCombinerModule", false, "fix-phantoms",
"Fix phantom objects", "Fixes phantom objects after an import to megaregions", FixPhantoms);
} }
public void Close() public void Close()
@ -910,5 +914,20 @@ namespace OpenSim.Region.CoreModules.World.Land
VirtualRegion.Permissions.OnTeleport += BigRegion.PermissionModule.CanTeleport; //NOT YET IMPLEMENTED VirtualRegion.Permissions.OnTeleport += BigRegion.PermissionModule.CanTeleport; //NOT YET IMPLEMENTED
VirtualRegion.Permissions.OnUseObjectReturn += BigRegion.PermissionModule.CanUseObjectReturn; //NOT YET IMPLEMENTED VirtualRegion.Permissions.OnUseObjectReturn += BigRegion.PermissionModule.CanUseObjectReturn; //NOT YET IMPLEMENTED
} }
#region console commands
public void FixPhantoms(string module, string[] cmdparams)
{
List<Scene> scenes = new List<Scene>(m_startingScenes.Values);
foreach (Scene s in scenes)
{
s.ForEachSOG(delegate(SceneObjectGroup e)
{
e.AbsolutePosition = e.AbsolutePosition;
}
);
}
}
#endregion
} }
} }

View File

@ -4141,6 +4141,11 @@ namespace OpenSim.Region.Framework.Scenes
m_sceneGraph.ForEachClient(action); m_sceneGraph.ForEachClient(action);
} }
public void ForEachSOG(Action<SceneObjectGroup> action)
{
m_sceneGraph.ForEachSOG(action);
}
/// <summary> /// <summary>
/// Returns a list of the entities in the scene. This is a new list so operations perform on the list itself /// 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. /// will not affect the original list of objects in the scene.

View File

@ -1134,6 +1134,23 @@ namespace OpenSim.Region.Framework.Scenes
} }
} }
protected internal void ForEachSOG(Action<SceneObjectGroup> action)
{
List<SceneObjectGroup> objlist = new List<SceneObjectGroup>(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 #endregion
#region Client Event handlers #region Client Event handlers