From 2b60a5c5d64f38caf243119105416c1101c6eb6c Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 19 May 2012 02:45:17 +0100 Subject: 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 --- .../RegionCombinerModule/RegionCombinerModule.cs | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs') diff --git a/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs b/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs index a142f26..37b3037 100644 --- a/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs +++ b/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs @@ -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 m_regions = new Dictionary(); private bool enabledYN = false; private Dictionary m_startingScenes = new Dictionary(); @@ -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(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) -- cgit v1.1