diff options
Diffstat (limited to 'OpenSim/Region/OptionalModules/World/TreePopulator/TreePopulatorModule.cs')
-rw-r--r-- | OpenSim/Region/OptionalModules/World/TreePopulator/TreePopulatorModule.cs | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/OpenSim/Region/OptionalModules/World/TreePopulator/TreePopulatorModule.cs b/OpenSim/Region/OptionalModules/World/TreePopulator/TreePopulatorModule.cs index 51b0592..8144870 100644 --- a/OpenSim/Region/OptionalModules/World/TreePopulator/TreePopulatorModule.cs +++ b/OpenSim/Region/OptionalModules/World/TreePopulator/TreePopulatorModule.cs | |||
@@ -31,6 +31,7 @@ using System.Reflection; | |||
31 | using System.Timers; | 31 | using System.Timers; |
32 | using OpenMetaverse; | 32 | using OpenMetaverse; |
33 | using log4net; | 33 | using log4net; |
34 | using Mono.Addins; | ||
34 | using Nini.Config; | 35 | using Nini.Config; |
35 | using OpenSim.Framework; | 36 | using OpenSim.Framework; |
36 | using OpenSim.Region.CoreModules.Framework.InterfaceCommander; | 37 | using OpenSim.Region.CoreModules.Framework.InterfaceCommander; |
@@ -46,7 +47,8 @@ namespace OpenSim.Region.OptionalModules.World.TreePopulator | |||
46 | /// <summary> | 47 | /// <summary> |
47 | /// Version 2.02 - Still hacky | 48 | /// Version 2.02 - Still hacky |
48 | /// </summary> | 49 | /// </summary> |
49 | public class TreePopulatorModule : IRegionModule, ICommandableModule, IVegetationModule | 50 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "TreePopulatorModule")] |
51 | public class TreePopulatorModule : INonSharedRegionModule, ICommandableModule, IVegetationModule | ||
50 | { | 52 | { |
51 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 53 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
52 | private readonly Commander m_commander = new Commander("tree"); | 54 | private readonly Commander m_commander = new Commander("tree"); |
@@ -168,15 +170,11 @@ namespace OpenSim.Region.OptionalModules.World.TreePopulator | |||
168 | 170 | ||
169 | #endregion | 171 | #endregion |
170 | 172 | ||
171 | #region IRegionModule Members | 173 | #region Region Module interface |
172 | 174 | ||
173 | public void Initialise(Scene scene, IConfigSource config) | 175 | public void Initialise(IConfigSource config) |
174 | { | 176 | { |
175 | 177 | ||
176 | m_scene = scene; | ||
177 | m_scene.RegisterModuleInterface<IRegionModule>(this); | ||
178 | m_scene.EventManager.OnPluginConsole += EventManager_OnPluginConsole; | ||
179 | |||
180 | // ini file settings | 178 | // ini file settings |
181 | try | 179 | try |
182 | { | 180 | { |
@@ -201,7 +199,19 @@ namespace OpenSim.Region.OptionalModules.World.TreePopulator | |||
201 | m_log.Debug("[TREES]: Initialised tree module"); | 199 | m_log.Debug("[TREES]: Initialised tree module"); |
202 | } | 200 | } |
203 | 201 | ||
204 | public void PostInitialise() | 202 | public void AddRegion(Scene scene) |
203 | { | ||
204 | m_scene = scene; | ||
205 | m_scene.RegisterModuleCommander(m_commander); | ||
206 | m_scene.EventManager.OnPluginConsole += EventManager_OnPluginConsole; | ||
207 | |||
208 | } | ||
209 | |||
210 | public void RemoveRegion(Scene scene) | ||
211 | { | ||
212 | } | ||
213 | |||
214 | public void RegionLoaded(Scene scene) | ||
205 | { | 215 | { |
206 | ReloadCopse(); | 216 | ReloadCopse(); |
207 | if (m_copse.Count > 0) | 217 | if (m_copse.Count > 0) |
@@ -220,11 +230,12 @@ namespace OpenSim.Region.OptionalModules.World.TreePopulator | |||
220 | get { return "TreePopulatorModule"; } | 230 | get { return "TreePopulatorModule"; } |
221 | } | 231 | } |
222 | 232 | ||
223 | public bool IsSharedModule | 233 | public Type ReplaceableInterface |
224 | { | 234 | { |
225 | get { return false; } | 235 | get { return null; } |
226 | } | 236 | } |
227 | 237 | ||
238 | |||
228 | #endregion | 239 | #endregion |
229 | 240 | ||
230 | //-------------------------------------------------------------- | 241 | //-------------------------------------------------------------- |
@@ -448,8 +459,6 @@ namespace OpenSim.Region.OptionalModules.World.TreePopulator | |||
448 | m_commander.RegisterCommand("reload", treeReloadCommand); | 459 | m_commander.RegisterCommand("reload", treeReloadCommand); |
449 | m_commander.RegisterCommand("remove", treeRemoveCommand); | 460 | m_commander.RegisterCommand("remove", treeRemoveCommand); |
450 | m_commander.RegisterCommand("statistics", treeStatisticsCommand); | 461 | m_commander.RegisterCommand("statistics", treeStatisticsCommand); |
451 | |||
452 | m_scene.RegisterModuleCommander(m_commander); | ||
453 | } | 462 | } |
454 | 463 | ||
455 | /// <summary> | 464 | /// <summary> |