diff options
author | Justin Clark-Casey (justincc) | 2012-05-19 02:45:17 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-05-19 02:45:17 +0100 |
commit | 2b60a5c5d64f38caf243119105416c1101c6eb6c (patch) | |
tree | ac4ba64c4ef8aa37ff534e3ec7be80281130dc19 /OpenSim/Region/RegionCombinerModule | |
parent | Enable FetchInventoryDescendents2 and FetchInventory2 caps by default. This ... (diff) | |
download | opensim-SC-2b60a5c5d64f38caf243119105416c1101c6eb6c.zip opensim-SC-2b60a5c5d64f38caf243119105416c1101c6eb6c.tar.gz opensim-SC-2b60a5c5d64f38caf243119105416c1101c6eb6c.tar.bz2 opensim-SC-2b60a5c5d64f38caf243119105416c1101c6eb6c.tar.xz |
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
Diffstat (limited to 'OpenSim/Region/RegionCombinerModule')
-rw-r--r-- | OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs | 22 |
1 files changed, 20 insertions, 2 deletions
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; | |||
43 | [assembly: AddinDependency("OpenSim", "0.5")] | 43 | [assembly: AddinDependency("OpenSim", "0.5")] |
44 | namespace OpenSim.Region.RegionCombinerModule | 44 | namespace OpenSim.Region.RegionCombinerModule |
45 | { | 45 | { |
46 | |||
47 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] | 46 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] |
48 | public class RegionCombinerModule : ISharedRegionModule | 47 | public class RegionCombinerModule : ISharedRegionModule, IRegionCombinerModule |
49 | { | 48 | { |
50 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 49 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
51 | 50 | ||
@@ -59,6 +58,15 @@ namespace OpenSim.Region.RegionCombinerModule | |||
59 | get { return null; } | 58 | get { return null; } |
60 | } | 59 | } |
61 | 60 | ||
61 | public bool IsMegaregion | ||
62 | { | ||
63 | get | ||
64 | { | ||
65 | lock (m_startingScenes) | ||
66 | return m_startingScenes.Count > 1; | ||
67 | } | ||
68 | } | ||
69 | |||
62 | private Dictionary<UUID, RegionConnections> m_regions = new Dictionary<UUID, RegionConnections>(); | 70 | private Dictionary<UUID, RegionConnections> m_regions = new Dictionary<UUID, RegionConnections>(); |
63 | private bool enabledYN = false; | 71 | private bool enabledYN = false; |
64 | private Dictionary<UUID, Scene> m_startingScenes = new Dictionary<UUID, Scene>(); | 72 | private Dictionary<UUID, Scene> m_startingScenes = new Dictionary<UUID, Scene>(); |
@@ -69,9 +77,11 @@ namespace OpenSim.Region.RegionCombinerModule | |||
69 | enabledYN = myConfig.GetBoolean("CombineContiguousRegions", false); | 77 | enabledYN = myConfig.GetBoolean("CombineContiguousRegions", false); |
70 | 78 | ||
71 | if (enabledYN) | 79 | if (enabledYN) |
80 | { | ||
72 | MainConsole.Instance.Commands.AddCommand( | 81 | MainConsole.Instance.Commands.AddCommand( |
73 | "RegionCombinerModule", false, "fix-phantoms", "fix-phantoms", | 82 | "RegionCombinerModule", false, "fix-phantoms", "fix-phantoms", |
74 | "Fixes phantom objects after an import to megaregions", FixPhantoms); | 83 | "Fixes phantom objects after an import to megaregions", FixPhantoms); |
84 | } | ||
75 | } | 85 | } |
76 | 86 | ||
77 | public void Close() | 87 | public void Close() |
@@ -80,6 +90,8 @@ namespace OpenSim.Region.RegionCombinerModule | |||
80 | 90 | ||
81 | public void AddRegion(Scene scene) | 91 | public void AddRegion(Scene scene) |
82 | { | 92 | { |
93 | if (enabledYN) | ||
94 | scene.RegisterModuleInterface<IRegionCombinerModule>(this); | ||
83 | } | 95 | } |
84 | 96 | ||
85 | public void RemoveRegion(Scene scene) | 97 | public void RemoveRegion(Scene scene) |
@@ -96,6 +108,12 @@ namespace OpenSim.Region.RegionCombinerModule | |||
96 | } | 108 | } |
97 | } | 109 | } |
98 | 110 | ||
111 | public bool IsRootRegion(UUID sceneId) | ||
112 | { | ||
113 | lock (m_regions) | ||
114 | return m_regions.ContainsKey(sceneId); | ||
115 | } | ||
116 | |||
99 | private void NewPresence(ScenePresence presence) | 117 | private void NewPresence(ScenePresence presence) |
100 | { | 118 | { |
101 | if (presence.IsChildAgent) | 119 | if (presence.IsChildAgent) |