diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs | 28 | ||||
-rw-r--r-- | OpenSim/Region/OptionalModules/World/TreePopulator/TreePopulatorModule.cs | 41 |
2 files changed, 23 insertions, 46 deletions
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs index 521d01a..ac39a53 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs | |||
@@ -25,11 +25,9 @@ | |||
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 | 27 | ||
28 | using System; | ||
29 | using System.Collections.Generic; | 28 | using System.Collections.Generic; |
30 | using System.Threading; | 29 | using System.Threading; |
31 | using OpenMetaverse; | 30 | using OpenMetaverse; |
32 | using Mono.Addins; | ||
33 | using Nini.Config; | 31 | using Nini.Config; |
34 | using OpenSim.Region.Framework.Interfaces; | 32 | using OpenSim.Region.Framework.Interfaces; |
35 | using OpenSim.Region.Framework.Scenes; | 33 | using OpenSim.Region.Framework.Scenes; |
@@ -39,8 +37,7 @@ using Timer=System.Timers.Timer; | |||
39 | 37 | ||
40 | namespace OpenSim.Region.OptionalModules.World.NPC | 38 | namespace OpenSim.Region.OptionalModules.World.NPC |
41 | { | 39 | { |
42 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] | 40 | public class NPCModule : IRegionModule, INPCModule |
43 | public class NPCModule : ISharedRegionModule, INPCModule | ||
44 | { | 41 | { |
45 | // private const bool m_enabled = false; | 42 | // private const bool m_enabled = false; |
46 | 43 | ||
@@ -137,13 +134,15 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
137 | } | 134 | } |
138 | 135 | ||
139 | 136 | ||
140 | public void Initialise(IConfigSource source) | 137 | public void Initialise(Scene scene, IConfigSource source) |
141 | { | 138 | { |
142 | m_createMutex = new Mutex(false); | 139 | m_createMutex = new Mutex(false); |
143 | 140 | ||
144 | m_timer = new Timer(500); | 141 | m_timer = new Timer(500); |
145 | m_timer.Elapsed += m_timer_Elapsed; | 142 | m_timer.Elapsed += m_timer_Elapsed; |
146 | m_timer.Start(); | 143 | m_timer.Start(); |
144 | |||
145 | scene.RegisterModuleInterface<INPCModule>(this); | ||
147 | } | 146 | } |
148 | 147 | ||
149 | void m_timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e) | 148 | void m_timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e) |
@@ -174,19 +173,6 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
174 | } | 173 | } |
175 | } | 174 | } |
176 | 175 | ||
177 | public void AddRegion(Scene scene) | ||
178 | { | ||
179 | scene.RegisterModuleInterface<INPCModule>(this); | ||
180 | } | ||
181 | public void RegionLoaded(Scene scene) | ||
182 | { | ||
183 | } | ||
184 | |||
185 | public void RemoveRegion(Scene scene) | ||
186 | { | ||
187 | scene.UnregisterModuleInterface<INPCModule>(this); | ||
188 | } | ||
189 | |||
190 | public void PostInitialise() | 176 | public void PostInitialise() |
191 | { | 177 | { |
192 | } | 178 | } |
@@ -200,9 +186,9 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
200 | get { return "NPCModule"; } | 186 | get { return "NPCModule"; } |
201 | } | 187 | } |
202 | 188 | ||
203 | public Type ReplaceableInterface | 189 | public bool IsSharedModule |
204 | { | 190 | { |
205 | get { return null; } | 191 | get { return true; } |
206 | } | 192 | } |
207 | } | 193 | } |
208 | } | 194 | } |
diff --git a/OpenSim/Region/OptionalModules/World/TreePopulator/TreePopulatorModule.cs b/OpenSim/Region/OptionalModules/World/TreePopulator/TreePopulatorModule.cs index b59d07a..e3fbb6e 100644 --- a/OpenSim/Region/OptionalModules/World/TreePopulator/TreePopulatorModule.cs +++ b/OpenSim/Region/OptionalModules/World/TreePopulator/TreePopulatorModule.cs | |||
@@ -31,7 +31,6 @@ 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; | ||
35 | using Nini.Config; | 34 | using Nini.Config; |
36 | using OpenSim.Framework; | 35 | using OpenSim.Framework; |
37 | using OpenSim.Region.CoreModules.Framework.InterfaceCommander; | 36 | using OpenSim.Region.CoreModules.Framework.InterfaceCommander; |
@@ -47,8 +46,7 @@ namespace OpenSim.Region.OptionalModules.World.TreePopulator | |||
47 | /// <summary> | 46 | /// <summary> |
48 | /// Version 2.02 - Still hacky | 47 | /// Version 2.02 - Still hacky |
49 | /// </summary> | 48 | /// </summary> |
50 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] | 49 | public class TreePopulatorModule : IRegionModule, ICommandableModule, IVegetationModule |
51 | public class TreePopulatorModule : INonSharedRegionModule, ICommandableModule, IVegetationModule | ||
52 | { | 50 | { |
53 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 51 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
54 | private readonly Commander m_commander = new Commander("tree"); | 52 | private readonly Commander m_commander = new Commander("tree"); |
@@ -170,10 +168,15 @@ namespace OpenSim.Region.OptionalModules.World.TreePopulator | |||
170 | 168 | ||
171 | #endregion | 169 | #endregion |
172 | 170 | ||
173 | #region ISharedRegionModule Members | 171 | #region IRegionModule Members |
174 | 172 | ||
175 | public void Initialise(IConfigSource config) | 173 | public void Initialise(Scene scene, IConfigSource config) |
176 | { | 174 | { |
175 | |||
176 | m_scene = scene; | ||
177 | m_scene.RegisterModuleInterface<IRegionModule>(this); | ||
178 | m_scene.EventManager.OnPluginConsole += EventManager_OnPluginConsole; | ||
179 | |||
177 | // ini file settings | 180 | // ini file settings |
178 | try | 181 | try |
179 | { | 182 | { |
@@ -193,18 +196,12 @@ namespace OpenSim.Region.OptionalModules.World.TreePopulator | |||
193 | m_log.Debug("[TREES]: ini failure for update_rate - using default"); | 196 | m_log.Debug("[TREES]: ini failure for update_rate - using default"); |
194 | } | 197 | } |
195 | 198 | ||
196 | m_log.Debug("[TREES]: Initialised tree module"); | ||
197 | } | ||
198 | |||
199 | public void AddRegion(Scene scene) | ||
200 | { | ||
201 | m_scene = scene; | ||
202 | m_scene.RegisterModuleInterface<INonSharedRegionModule>(this); | ||
203 | m_scene.EventManager.OnPluginConsole += EventManager_OnPluginConsole; | ||
204 | InstallCommands(); | 199 | InstallCommands(); |
200 | |||
201 | m_log.Debug("[TREES]: Initialised tree module"); | ||
205 | } | 202 | } |
206 | 203 | ||
207 | public void RegionLoaded(Scene scene) | 204 | public void PostInitialise() |
208 | { | 205 | { |
209 | ReloadCopse(); | 206 | ReloadCopse(); |
210 | if (m_copse.Count > 0) | 207 | if (m_copse.Count > 0) |
@@ -214,17 +211,6 @@ namespace OpenSim.Region.OptionalModules.World.TreePopulator | |||
214 | activeizeTreeze(true); | 211 | activeizeTreeze(true); |
215 | } | 212 | } |
216 | 213 | ||
217 | public void RemoveRegion(Scene scene) | ||
218 | { | ||
219 | scene.UnregisterModuleInterface<INonSharedRegionModule>(this); | ||
220 | scene.EventManager.OnPluginConsole -= EventManager_OnPluginConsole; | ||
221 | } | ||
222 | |||
223 | public Type ReplaceableInterface | ||
224 | { | ||
225 | get { return null; } | ||
226 | } | ||
227 | |||
228 | public void Close() | 214 | public void Close() |
229 | { | 215 | { |
230 | } | 216 | } |
@@ -234,6 +220,11 @@ namespace OpenSim.Region.OptionalModules.World.TreePopulator | |||
234 | get { return "TreePopulatorModule"; } | 220 | get { return "TreePopulatorModule"; } |
235 | } | 221 | } |
236 | 222 | ||
223 | public bool IsSharedModule | ||
224 | { | ||
225 | get { return false; } | ||
226 | } | ||
227 | |||
237 | #endregion | 228 | #endregion |
238 | 229 | ||
239 | //-------------------------------------------------------------- | 230 | //-------------------------------------------------------------- |