aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/OptionalModules/World
diff options
context:
space:
mode:
authorMelanie2010-01-29 07:20:13 +0000
committerMelanie2010-01-29 07:21:06 +0000
commita87a247f0548d39a8c39b1d28123d7da8db44598 (patch)
tree7f9f77c38a224bc6d4bea7ccced1d4710c8a91b1 /OpenSim/Region/OptionalModules/World
parentMerge branch 'master' of melanie@opensimulator.org:/var/git/opensim (diff)
downloadopensim-SC_OLD-a87a247f0548d39a8c39b1d28123d7da8db44598.zip
opensim-SC_OLD-a87a247f0548d39a8c39b1d28123d7da8db44598.tar.gz
opensim-SC_OLD-a87a247f0548d39a8c39b1d28123d7da8db44598.tar.bz2
opensim-SC_OLD-a87a247f0548d39a8c39b1d28123d7da8db44598.tar.xz
Revert "Updates all IRegionModules to the new style region modules."
This reverts commit ec3c31e61e5e540f822891110df9bc978655bbaf.
Diffstat (limited to 'OpenSim/Region/OptionalModules/World')
-rw-r--r--OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs28
-rw-r--r--OpenSim/Region/OptionalModules/World/TreePopulator/TreePopulatorModule.cs41
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
28using System;
29using System.Collections.Generic; 28using System.Collections.Generic;
30using System.Threading; 29using System.Threading;
31using OpenMetaverse; 30using OpenMetaverse;
32using Mono.Addins;
33using Nini.Config; 31using Nini.Config;
34using OpenSim.Region.Framework.Interfaces; 32using OpenSim.Region.Framework.Interfaces;
35using OpenSim.Region.Framework.Scenes; 33using OpenSim.Region.Framework.Scenes;
@@ -39,8 +37,7 @@ using Timer=System.Timers.Timer;
39 37
40namespace OpenSim.Region.OptionalModules.World.NPC 38namespace 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;
31using System.Timers; 31using System.Timers;
32using OpenMetaverse; 32using OpenMetaverse;
33using log4net; 33using log4net;
34using Mono.Addins;
35using Nini.Config; 34using Nini.Config;
36using OpenSim.Framework; 35using OpenSim.Framework;
37using OpenSim.Region.CoreModules.Framework.InterfaceCommander; 36using 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 //--------------------------------------------------------------