aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/OptionalModules/World
diff options
context:
space:
mode:
authorRevolution2010-01-22 18:09:33 -0600
committerMelanie2010-01-23 15:18:52 +0000
commitec3c31e61e5e540f822891110df9bc978655bbaf (patch)
treeb0b34a239eab48e163a3ca064edcd7567948423c /OpenSim/Region/OptionalModules/World
parentadd a target position to agent updates to ScenePresence to support alternativ... (diff)
downloadopensim-SC_OLD-ec3c31e61e5e540f822891110df9bc978655bbaf.zip
opensim-SC_OLD-ec3c31e61e5e540f822891110df9bc978655bbaf.tar.gz
opensim-SC_OLD-ec3c31e61e5e540f822891110df9bc978655bbaf.tar.bz2
opensim-SC_OLD-ec3c31e61e5e540f822891110df9bc978655bbaf.tar.xz
Updates all IRegionModules to the new style region modules.
Signed-off-by: Melanie <melanie@t-data.com>
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, 46 insertions, 23 deletions
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
index ac39a53..521d01a 100644
--- a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
+++ b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
@@ -25,9 +25,11 @@
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;
28using System.Collections.Generic; 29using System.Collections.Generic;
29using System.Threading; 30using System.Threading;
30using OpenMetaverse; 31using OpenMetaverse;
32using Mono.Addins;
31using Nini.Config; 33using Nini.Config;
32using OpenSim.Region.Framework.Interfaces; 34using OpenSim.Region.Framework.Interfaces;
33using OpenSim.Region.Framework.Scenes; 35using OpenSim.Region.Framework.Scenes;
@@ -37,7 +39,8 @@ using Timer=System.Timers.Timer;
37 39
38namespace OpenSim.Region.OptionalModules.World.NPC 40namespace OpenSim.Region.OptionalModules.World.NPC
39{ 41{
40 public class NPCModule : IRegionModule, INPCModule 42 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
43 public class NPCModule : ISharedRegionModule, INPCModule
41 { 44 {
42 // private const bool m_enabled = false; 45 // private const bool m_enabled = false;
43 46
@@ -134,15 +137,13 @@ namespace OpenSim.Region.OptionalModules.World.NPC
134 } 137 }
135 138
136 139
137 public void Initialise(Scene scene, IConfigSource source) 140 public void Initialise(IConfigSource source)
138 { 141 {
139 m_createMutex = new Mutex(false); 142 m_createMutex = new Mutex(false);
140 143
141 m_timer = new Timer(500); 144 m_timer = new Timer(500);
142 m_timer.Elapsed += m_timer_Elapsed; 145 m_timer.Elapsed += m_timer_Elapsed;
143 m_timer.Start(); 146 m_timer.Start();
144
145 scene.RegisterModuleInterface<INPCModule>(this);
146 } 147 }
147 148
148 void m_timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e) 149 void m_timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
@@ -173,6 +174,19 @@ namespace OpenSim.Region.OptionalModules.World.NPC
173 } 174 }
174 } 175 }
175 176
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
176 public void PostInitialise() 190 public void PostInitialise()
177 { 191 {
178 } 192 }
@@ -186,9 +200,9 @@ namespace OpenSim.Region.OptionalModules.World.NPC
186 get { return "NPCModule"; } 200 get { return "NPCModule"; }
187 } 201 }
188 202
189 public bool IsSharedModule 203 public Type ReplaceableInterface
190 { 204 {
191 get { return true; } 205 get { return null; }
192 } 206 }
193 } 207 }
194} 208}
diff --git a/OpenSim/Region/OptionalModules/World/TreePopulator/TreePopulatorModule.cs b/OpenSim/Region/OptionalModules/World/TreePopulator/TreePopulatorModule.cs
index e3fbb6e..b59d07a 100644
--- a/OpenSim/Region/OptionalModules/World/TreePopulator/TreePopulatorModule.cs
+++ b/OpenSim/Region/OptionalModules/World/TreePopulator/TreePopulatorModule.cs
@@ -31,6 +31,7 @@ using System.Reflection;
31using System.Timers; 31using System.Timers;
32using OpenMetaverse; 32using OpenMetaverse;
33using log4net; 33using log4net;
34using Mono.Addins;
34using Nini.Config; 35using Nini.Config;
35using OpenSim.Framework; 36using OpenSim.Framework;
36using OpenSim.Region.CoreModules.Framework.InterfaceCommander; 37using 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")]
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,10 @@ namespace OpenSim.Region.OptionalModules.World.TreePopulator
168 170
169 #endregion 171 #endregion
170 172
171 #region IRegionModule Members 173 #region ISharedRegionModule Members
172 174
173 public void Initialise(Scene scene, IConfigSource config) 175 public void Initialise(IConfigSource config)
174 { 176 {
175
176 m_scene = scene;
177 m_scene.RegisterModuleInterface<IRegionModule>(this);
178 m_scene.EventManager.OnPluginConsole += EventManager_OnPluginConsole;
179
180 // ini file settings 177 // ini file settings
181 try 178 try
182 { 179 {
@@ -196,12 +193,18 @@ namespace OpenSim.Region.OptionalModules.World.TreePopulator
196 m_log.Debug("[TREES]: ini failure for update_rate - using default"); 193 m_log.Debug("[TREES]: ini failure for update_rate - using default");
197 } 194 }
198 195
199 InstallCommands();
200
201 m_log.Debug("[TREES]: Initialised tree module"); 196 m_log.Debug("[TREES]: Initialised tree module");
202 } 197 }
203 198
204 public void PostInitialise() 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();
205 }
206
207 public void RegionLoaded(Scene scene)
205 { 208 {
206 ReloadCopse(); 209 ReloadCopse();
207 if (m_copse.Count > 0) 210 if (m_copse.Count > 0)
@@ -211,18 +214,24 @@ namespace OpenSim.Region.OptionalModules.World.TreePopulator
211 activeizeTreeze(true); 214 activeizeTreeze(true);
212 } 215 }
213 216
214 public void Close() 217 public void RemoveRegion(Scene scene)
215 { 218 {
219 scene.UnregisterModuleInterface<INonSharedRegionModule>(this);
220 scene.EventManager.OnPluginConsole -= EventManager_OnPluginConsole;
216 } 221 }
217 222
218 public string Name 223 public Type ReplaceableInterface
224 {
225 get { return null; }
226 }
227
228 public void Close()
219 { 229 {
220 get { return "TreePopulatorModule"; }
221 } 230 }
222 231
223 public bool IsSharedModule 232 public string Name
224 { 233 {
225 get { return false; } 234 get { return "TreePopulatorModule"; }
226 } 235 }
227 236
228 #endregion 237 #endregion