diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/CoreModules/World/WorldMap/MapImageModule.cs | 30 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs | 35 |
2 files changed, 47 insertions, 18 deletions
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/MapImageModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/MapImageModule.cs index 285d36a..6bda1e9 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/MapImageModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/MapImageModule.cs | |||
@@ -30,6 +30,7 @@ using System.Collections.Generic; | |||
30 | using System.Drawing; | 30 | using System.Drawing; |
31 | using System.Reflection; | 31 | using System.Reflection; |
32 | using log4net; | 32 | using log4net; |
33 | using Mono.Addins; | ||
33 | using Nini.Config; | 34 | using Nini.Config; |
34 | using OpenMetaverse; | 35 | using OpenMetaverse; |
35 | using OpenMetaverse.Imaging; | 36 | using OpenMetaverse.Imaging; |
@@ -59,7 +60,8 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
59 | public face[] trns; | 60 | public face[] trns; |
60 | } | 61 | } |
61 | 62 | ||
62 | public class MapImageModule : IMapImageGenerator, IRegionModule | 63 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] |
64 | public class MapImageModule : IMapImageGenerator, INonSharedRegionModule | ||
63 | { | 65 | { |
64 | private static readonly ILog m_log = | 66 | private static readonly ILog m_log = |
65 | LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 67 | LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
@@ -128,37 +130,45 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
128 | 130 | ||
129 | #endregion | 131 | #endregion |
130 | 132 | ||
131 | #region IRegionModule Members | 133 | #region INonSharedRegionModule Members |
132 | 134 | ||
133 | public void Initialise(Scene scene, IConfigSource source) | 135 | public void Initialise(IConfigSource source) |
134 | { | 136 | { |
135 | m_scene = scene; | ||
136 | m_config = source; | 137 | m_config = source; |
137 | 138 | ||
138 | IConfig startupConfig = m_config.Configs["Startup"]; | 139 | IConfig startupConfig = m_config.Configs["Startup"]; |
139 | if (startupConfig.GetString("MapImageModule", "MapImageModule") != | 140 | if (startupConfig.GetString("MapImageModule", "MapImageModule") != |
140 | "MapImageModule") | 141 | "MapImageModule") |
141 | return; | 142 | return; |
143 | } | ||
142 | 144 | ||
145 | public void AddRegion(Scene scene) | ||
146 | { | ||
147 | m_scene = scene; | ||
143 | m_scene.RegisterModuleInterface<IMapImageGenerator>(this); | 148 | m_scene.RegisterModuleInterface<IMapImageGenerator>(this); |
144 | } | 149 | } |
145 | 150 | ||
146 | public void PostInitialise() | 151 | public Type ReplaceableInterface |
147 | { | 152 | { |
153 | get { return null; } | ||
148 | } | 154 | } |
149 | 155 | ||
150 | public void Close() | 156 | public void RegionLoaded(Scene scene) |
151 | { | 157 | { |
152 | } | 158 | } |
153 | 159 | ||
154 | public string Name | 160 | public void RemoveRegion(Scene scene) |
155 | { | 161 | { |
156 | get { return "MapImageModule"; } | 162 | scene.UnregisterModuleInterface<IMapImageGenerator>(this); |
157 | } | 163 | } |
158 | 164 | ||
159 | public bool IsSharedModule | 165 | public void Close() |
166 | { | ||
167 | } | ||
168 | |||
169 | public string Name | ||
160 | { | 170 | { |
161 | get { return false; } | 171 | get { return "MapImageModule"; } |
162 | } | 172 | } |
163 | 173 | ||
164 | #endregion | 174 | #endregion |
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs index be46fa5..dd33673 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs | |||
@@ -24,9 +24,12 @@ | |||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ | 26 | */ |
27 | |||
28 | using System; | ||
27 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
28 | using System.Reflection; | 30 | using System.Reflection; |
29 | using log4net; | 31 | using log4net; |
32 | using Mono.Addins; | ||
30 | using Nini.Config; | 33 | using Nini.Config; |
31 | using OpenMetaverse; | 34 | using OpenMetaverse; |
32 | using OpenSim.Framework; | 35 | using OpenSim.Framework; |
@@ -38,7 +41,8 @@ using GridRegion = OpenSim.Services.Interfaces.GridRegion; | |||
38 | 41 | ||
39 | namespace OpenSim.Region.CoreModules.World.WorldMap | 42 | namespace OpenSim.Region.CoreModules.World.WorldMap |
40 | { | 43 | { |
41 | public class MapSearchModule : IRegionModule | 44 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] |
45 | public class MapSearchModule : ISharedRegionModule | ||
42 | { | 46 | { |
43 | private static readonly ILog m_log = | 47 | private static readonly ILog m_log = |
44 | LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 48 | LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
@@ -46,8 +50,12 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
46 | Scene m_scene = null; // only need one for communication with GridService | 50 | Scene m_scene = null; // only need one for communication with GridService |
47 | List<Scene> m_scenes = new List<Scene>(); | 51 | List<Scene> m_scenes = new List<Scene>(); |
48 | 52 | ||
49 | #region IRegionModule Members | 53 | #region ISharedRegionModule Members |
50 | public void Initialise(Scene scene, IConfigSource source) | 54 | public void Initialise(IConfigSource source) |
55 | { | ||
56 | } | ||
57 | |||
58 | public void AddRegion(Scene scene) | ||
51 | { | 59 | { |
52 | if (m_scene == null) | 60 | if (m_scene == null) |
53 | { | 61 | { |
@@ -58,6 +66,22 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
58 | scene.EventManager.OnNewClient += OnNewClient; | 66 | scene.EventManager.OnNewClient += OnNewClient; |
59 | } | 67 | } |
60 | 68 | ||
69 | public Type ReplaceableInterface | ||
70 | { | ||
71 | get { return null; } | ||
72 | } | ||
73 | |||
74 | public void RegionLoaded(Scene scene) | ||
75 | { | ||
76 | } | ||
77 | |||
78 | public void RemoveRegion(Scene scene) | ||
79 | { | ||
80 | if(m_scenes.Contains(scene)) | ||
81 | m_scenes.Remove(scene); | ||
82 | scene.EventManager.OnNewClient -= OnNewClient; | ||
83 | } | ||
84 | |||
61 | public void PostInitialise() | 85 | public void PostInitialise() |
62 | { | 86 | { |
63 | } | 87 | } |
@@ -73,11 +97,6 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
73 | get { return "MapSearchModule"; } | 97 | get { return "MapSearchModule"; } |
74 | } | 98 | } |
75 | 99 | ||
76 | public bool IsSharedModule | ||
77 | { | ||
78 | get { return true; } | ||
79 | } | ||
80 | |||
81 | #endregion | 100 | #endregion |
82 | 101 | ||
83 | private void OnNewClient(IClientAPI client) | 102 | private void OnNewClient(IClientAPI client) |