Add is_megaregion flag into oar control file. Not currently read - for future use. Please do not rely on this remaining here.

An adaptation of part of Garmin's patch from http://opensimulator.org/mantis/view.php?id=5975, thanks!
Flag only written if the SW corner OAR is saved - this is the only one that captures object data presently (though not land or terrain data).
This adds an IRegionCombinerModule interface and the necessary methods on RegionCombinerModule
This commit is contained in:
Justin Clark-Casey (justincc)
2012-05-19 02:45:17 +01:00
parent 9fa0577c7e
commit 2b60a5c5d6
4 changed files with 142 additions and 40 deletions

View File

@@ -43,9 +43,8 @@ using Mono.Addins;
[assembly: AddinDependency("OpenSim", "0.5")]
namespace OpenSim.Region.RegionCombinerModule
{
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
public class RegionCombinerModule : ISharedRegionModule
public class RegionCombinerModule : ISharedRegionModule, IRegionCombinerModule
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
@@ -59,6 +58,15 @@ namespace OpenSim.Region.RegionCombinerModule
get { return null; }
}
public bool IsMegaregion
{
get
{
lock (m_startingScenes)
return m_startingScenes.Count > 1;
}
}
private Dictionary<UUID, RegionConnections> m_regions = new Dictionary<UUID, RegionConnections>();
private bool enabledYN = false;
private Dictionary<UUID, Scene> m_startingScenes = new Dictionary<UUID, Scene>();
@@ -69,9 +77,11 @@ namespace OpenSim.Region.RegionCombinerModule
enabledYN = myConfig.GetBoolean("CombineContiguousRegions", false);
if (enabledYN)
{
MainConsole.Instance.Commands.AddCommand(
"RegionCombinerModule", false, "fix-phantoms", "fix-phantoms",
"Fixes phantom objects after an import to megaregions", FixPhantoms);
}
}
public void Close()
@@ -80,6 +90,8 @@ namespace OpenSim.Region.RegionCombinerModule
public void AddRegion(Scene scene)
{
if (enabledYN)
scene.RegisterModuleInterface<IRegionCombinerModule>(this);
}
public void RemoveRegion(Scene scene)
@@ -96,6 +108,12 @@ namespace OpenSim.Region.RegionCombinerModule
}
}
public bool IsRootRegion(UUID sceneId)
{
lock (m_regions)
return m_regions.ContainsKey(sceneId);
}
private void NewPresence(ScenePresence presence)
{
if (presence.IsChildAgent)