A little hack to see if this fixes the problems with ~20% of SOG's becoming phantom after an import to megaregions.
parent
77f5e41631
commit
bc892c1d4c
|
@ -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,7 +62,10 @@ 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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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.
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue