aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/OptionalModules
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/IRCStackModule.cs32
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs72
-rw-r--r--OpenSim/Region/OptionalModules/ContentManagementSystem/ContentManagementModule.cs47
-rw-r--r--OpenSim/Region/OptionalModules/Scripting/Minimodule/MRMModule.cs64
-rw-r--r--OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs6
-rw-r--r--OpenSim/Region/OptionalModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs1
-rw-r--r--OpenSim/Region/OptionalModules/Scripting/XmlRpcRouterModule/XmlRpcGridRouterModule.cs28
-rw-r--r--OpenSim/Region/OptionalModules/Scripting/XmlRpcRouterModule/XmlRpcRouterModule.cs30
-rw-r--r--OpenSim/Region/OptionalModules/ServiceConnectorsIn/Freeswitch/FreeswitchServiceInConnectorModule.cs2
-rw-r--r--OpenSim/Region/OptionalModules/SvnSerialiser/SvnBackupModule.cs28
-rw-r--r--OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs28
-rw-r--r--OpenSim/Region/OptionalModules/World/TreePopulator/TreePopulatorModule.cs41
12 files changed, 254 insertions, 125 deletions
diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/IRCStackModule.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/IRCStackModule.cs
index cfe1278..ec040db 100644
--- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/IRCStackModule.cs
+++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/IRCStackModule.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.Net; 29using System.Net;
29using System.Reflection; 30using System.Reflection;
30using log4net; 31using log4net;
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;
@@ -35,24 +37,23 @@ using OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server;
35 37
36namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView 38namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView
37{ 39{
38 public class IRCStackModule : IRegionModule 40 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
41 public class IRCStackModule : INonSharedRegionModule
39 { 42 {
40 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 43 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
41 44
42 private IRCServer m_server; 45 private IRCServer m_server;
43// private Scene m_scene; 46// private Scene m_scene;
47 private int portNo;
44 48
45 #region Implementation of IRegionModule 49 #region Implementation of ISharedRegionModule
46 50
47 public void Initialise(Scene scene, IConfigSource source) 51 public void Initialise(IConfigSource source)
48 { 52 {
49 if (null != source.Configs["IRCd"] && 53 if (null != source.Configs["IRCd"] &&
50 source.Configs["IRCd"].GetBoolean("Enabled",false)) 54 source.Configs["IRCd"].GetBoolean("Enabled",false))
51 { 55 {
52 int portNo = source.Configs["IRCd"].GetInt("Port",6666); 56 portNo = source.Configs["IRCd"].GetInt("Port",6666);
53// m_scene = scene;
54 m_server = new IRCServer(IPAddress.Parse("0.0.0.0"), portNo, scene);
55 m_server.OnNewIRCClient += m_server_OnNewIRCClient;
56 } 57 }
57 } 58 }
58 59
@@ -68,9 +69,20 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView
68 m_log.Info("[IRCd] Added user to Scene"); 69 m_log.Info("[IRCd] Added user to Scene");
69 } 70 }
70 71
71 public void PostInitialise() 72 public void AddRegion(Scene scene)
73 {
74 if (portNo != null)
75 {
76 m_server = new IRCServer(IPAddress.Parse("0.0.0.0"), portNo, scene);
77 m_server.OnNewIRCClient += m_server_OnNewIRCClient;
78 }
79 }
80 public void RegionLoaded(Scene scene)
72 { 81 {
82 }
73 83
84 public void RemoveRegion(Scene scene)
85 {
74 } 86 }
75 87
76 public void Close() 88 public void Close()
@@ -83,9 +95,9 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView
83 get { return "IRCClientStackModule"; } 95 get { return "IRCClientStackModule"; }
84 } 96 }
85 97
86 public bool IsSharedModule 98 public Type ReplaceableInterface
87 { 99 {
88 get { return false; } 100 get { return null; }
89 } 101 }
90 102
91 #endregion 103 #endregion
diff --git a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs
index b04b076..23ae307 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs
@@ -38,6 +38,7 @@ using System.Collections.Generic;
38using System.Reflection; 38using System.Reflection;
39using OpenMetaverse; 39using OpenMetaverse;
40using log4net; 40using log4net;
41using Mono.Addins;
41using Nini.Config; 42using Nini.Config;
42using Nwc.XmlRpc; 43using Nwc.XmlRpc;
43using OpenSim.Framework; 44using OpenSim.Framework;
@@ -53,7 +54,8 @@ using System.Text.RegularExpressions;
53 54
54namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice 55namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
55{ 56{
56 public class FreeSwitchVoiceModule : IRegionModule, IVoiceModule 57 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
58 public class FreeSwitchVoiceModule : ISharedRegionModule, IVoiceModule
57 { 59 {
58 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 60 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
59 61
@@ -108,9 +110,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
108 110
109 private IConfig m_config; 111 private IConfig m_config;
110 112
111 public void Initialise(Scene scene, IConfigSource config) 113 public void Initialise(IConfigSource config)
112 { 114 {
113 m_scene = scene;
114 m_config = config.Configs["FreeSwitchVoice"]; 115 m_config = config.Configs["FreeSwitchVoice"];
115 116
116 if (null == m_config) 117 if (null == m_config)
@@ -224,17 +225,21 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
224 return; 225 return;
225 } 226 }
226 } 227 }
228 }
227 229
228 if (m_pluginEnabled) 230 public void AddRegion(Scene scene)
231 {
232 m_scene = scene;
233 if (m_pluginEnabled)
229 { 234 {
230 // we need to capture scene in an anonymous method 235 // we need to capture scene in an anonymous method
231 // here as we need it later in the callbacks 236 // here as we need it later in the callbacks
232 scene.EventManager.OnRegisterCaps += delegate(UUID agentID, Caps caps) 237 scene.EventManager.OnRegisterCaps += delegate(UUID agentID, Caps caps)
233 { 238 {
234 OnRegisterCaps(scene, agentID, caps); 239 OnRegisterCaps(scene, agentID, caps);
235 }; 240 };
236 241
237 242
238 243
239 try 244 try
240 { 245 {
@@ -254,33 +259,60 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
254 m_log.Error("[FreeSwitchVoice]: Certificate validation handler change not supported. You may get ssl certificate validation errors teleporting from your region to some SSL regions."); 259 m_log.Error("[FreeSwitchVoice]: Certificate validation handler change not supported. You may get ssl certificate validation errors teleporting from your region to some SSL regions.");
255 } 260 }
256 } 261 }
257 262
258 } 263 }
259 }
260
261 public void PostInitialise()
262 {
263 if (m_pluginEnabled) 264 if (m_pluginEnabled)
264 { 265 {
265 m_log.Info("[FreeSwitchVoice] registering IVoiceModule with the scene"); 266 m_log.Info("[FreeSwitchVoice] registering IVoiceModule with the scene");
266 267
267 // register the voice interface for this module, so the script engine can call us 268 // register the voice interface for this module, so the script engine can call us
268 m_scene.RegisterModuleInterface<IVoiceModule>(this); 269 m_scene.RegisterModuleInterface<IVoiceModule>(this);
269 } 270 }
270 } 271 }
271 272
272 public void Close() 273 public void RegionLoaded(Scene scene)
273 { 274 {
274 } 275 }
275 276
276 public string Name 277 public void RemoveRegion(Scene scene)
278 {
279 if (UseProxy)
280 {
281 MainServer.Instance.RemoveHTTPHandler("", String.Format("{0}/", m_freeSwitchAPIPrefix));
282 }
283 else
284 {
285 MainServer.Instance.RemoveHTTPHandler("", String.Format("{0}/viv_get_prelogin.php", m_freeSwitchAPIPrefix));
286
287 MainServer.Instance.RemoveHTTPHandler("", String.Format("{0}/viv_signin.php", m_freeSwitchAPIPrefix));
288
289 MainServer.Instance.RemoveHTTPHandler("", String.Format("{0}/freeswitch-config", m_freeSwitchAPIPrefix));
290
291 MainServer.Instance.RemoveHTTPHandler("", String.Format("{0}/viv_buddy.php", m_freeSwitchAPIPrefix));
292 }
293 scene.EventManager.OnRegisterCaps -= delegate(UUID agentID, Caps caps)
294 {
295 OnRegisterCaps(scene, agentID, caps);
296 };
297 scene.UnregisterModuleInterface<IVoiceModule>(this);
298 }
299
300 public Type ReplaceableInterface
301 {
302 get { return null; }
303 }
304
305 public void PostInitialise()
277 { 306 {
278 get { return "FreeSwitchVoiceModule"; }
279 } 307 }
280 308
281 public bool IsSharedModule 309 public void Close()
282 { 310 {
283 get { return true; } 311 }
312
313 public string Name
314 {
315 get { return "FreeSwitchVoiceModule"; }
284 } 316 }
285 317
286 // <summary> 318 // <summary>
diff --git a/OpenSim/Region/OptionalModules/ContentManagementSystem/ContentManagementModule.cs b/OpenSim/Region/OptionalModules/ContentManagementSystem/ContentManagementModule.cs
index 3d1c346..6769d59 100644
--- a/OpenSim/Region/OptionalModules/ContentManagementSystem/ContentManagementModule.cs
+++ b/OpenSim/Region/OptionalModules/ContentManagementSystem/ContentManagementModule.cs
@@ -1,4 +1,4 @@
1/* 1/*
2 * Copyright (c) Contributors, http://opensimulator.org/ 2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders. 3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 * 4 *
@@ -38,6 +38,7 @@ using System.Threading;
38 38
39using OpenMetaverse; 39using OpenMetaverse;
40 40
41using Mono.Addins;
41using Nini.Config; 42using Nini.Config;
42 43
43using OpenSim; 44using OpenSim;
@@ -50,7 +51,8 @@ using log4net;
50 51
51namespace OpenSim.Region.OptionalModules.ContentManagement 52namespace OpenSim.Region.OptionalModules.ContentManagement
52{ 53{
53 public class ContentManagementModule : IRegionModule 54 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
55 public class ContentManagementModule : ISharedRegionModule
54 { 56 {
55 #region Static Fields 57 #region Static Fields
56 58
@@ -60,22 +62,20 @@ namespace OpenSim.Region.OptionalModules.ContentManagement
60 62
61 #region Fields 63 #region Fields
62 64
63 bool initialised = false; 65 private bool initialised = false;
64 CMController m_control = null; 66 private CMController m_control = null;
65 bool m_enabled = false; 67 private bool m_enabled = false;
66 CMModel m_model = null; 68 private CMModel m_model = null;
67 bool m_posted = false; 69 private bool m_posted = false;
68 CMView m_view = null; 70 private CMView m_view = null;
71 private string databaseDir = "./";
72 private string database = "FileSystemDatabase";
73 private int channel = 345;
69 74
70 #endregion Fields 75 #endregion Fields
71 76
72 #region Public Properties 77 #region Public Properties
73 78
74 public bool IsSharedModule
75 {
76 get { return true; }
77 }
78
79 public string Name 79 public string Name
80 { 80 {
81 get { return "ContentManagementModule"; } 81 get { return "ContentManagementModule"; }
@@ -89,11 +89,8 @@ namespace OpenSim.Region.OptionalModules.ContentManagement
89 { 89 {
90 } 90 }
91 91
92 public void Initialise(Scene scene, IConfigSource source) 92 public void Initialise(IConfigSource source)
93 { 93 {
94 string databaseDir = "./";
95 string database = "FileSystemDatabase";
96 int channel = 345;
97 try 94 try
98 { 95 {
99 if (source.Configs["CMS"] == null) 96 if (source.Configs["CMS"] == null)
@@ -115,13 +112,15 @@ namespace OpenSim.Region.OptionalModules.ContentManagement
115 m_log.ErrorFormat("[Content Management]: Exception thrown while reading parameters from configuration file. Message: " + e); 112 m_log.ErrorFormat("[Content Management]: Exception thrown while reading parameters from configuration file. Message: " + e);
116 m_enabled = false; 113 m_enabled = false;
117 } 114 }
115 }
118 116
117 public void AddRegion(Scene scene)
118 {
119 if (!m_enabled) 119 if (!m_enabled)
120 { 120 {
121 m_log.Info("[Content Management]: Content Management System is not Enabled."); 121 m_log.Info("[Content Management]: Content Management System is not Enabled.");
122 return; 122 return;
123 } 123 }
124
125 lock (this) 124 lock (this)
126 { 125 {
127 if (!initialised) //only init once 126 if (!initialised) //only init once
@@ -142,6 +141,18 @@ namespace OpenSim.Region.OptionalModules.ContentManagement
142 } 141 }
143 } 142 }
144 } 143 }
144 public void RegionLoaded(Scene scene)
145 {
146 }
147
148 public void RemoveRegion(Scene scene)
149 {
150 }
151
152 public Type ReplaceableInterface
153 {
154 get { return null; }
155 }
145 156
146 public void PostInitialise() 157 public void PostInitialise()
147 { 158 {
diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/MRMModule.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/MRMModule.cs
index 4521f8e..f24bcdc 100644
--- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/MRMModule.cs
+++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/MRMModule.cs
@@ -38,6 +38,7 @@ using System.Security.Policy;
38using System.Text; 38using System.Text;
39using log4net; 39using log4net;
40using Microsoft.CSharp; 40using Microsoft.CSharp;
41using Mono.Addins;
41using Nini.Config; 42using Nini.Config;
42using OpenMetaverse; 43using OpenMetaverse;
43using OpenSim.Framework; 44using OpenSim.Framework;
@@ -46,7 +47,8 @@ using OpenSim.Region.Framework.Scenes;
46 47
47namespace OpenSim.Region.OptionalModules.Scripting.Minimodule 48namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
48{ 49{
49 public class MRMModule : IRegionModule, IMRMModule 50 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
51 public class MRMModule : INonSharedRegionModule, IMRMModule
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 Scene m_scene; 54 private Scene m_scene;
@@ -62,12 +64,14 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
62 64
63 private IConfig m_config; 65 private IConfig m_config;
64 66
67 private bool m_hidden = true;
68
65 public void RegisterExtension<T>(T instance) 69 public void RegisterExtension<T>(T instance)
66 { 70 {
67 m_extensions[typeof (T)] = instance; 71 m_extensions[typeof (T)] = instance;
68 } 72 }
69 73
70 public void Initialise(Scene scene, IConfigSource source) 74 public void Initialise(IConfigSource source)
71 { 75 {
72 if (source.Configs["MRM"] != null) 76 if (source.Configs["MRM"] != null)
73 { 77 {
@@ -76,19 +80,10 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
76 if (source.Configs["MRM"].GetBoolean("Enabled", false)) 80 if (source.Configs["MRM"].GetBoolean("Enabled", false))
77 { 81 {
78 m_log.Info("[MRM] Enabling MRM Module"); 82 m_log.Info("[MRM] Enabling MRM Module");
79 m_scene = scene; 83
80
81 // when hidden, we don't listen for client initiated script events 84 // when hidden, we don't listen for client initiated script events
82 // only making the MRM engine available for region modules 85 // only making the MRM engine available for region modules
83 if (!source.Configs["MRM"].GetBoolean("Hidden", false)) 86 m_hidden = source.Configs["MRM"].GetBoolean("Hidden", false);
84 {
85 scene.EventManager.OnRezScript += EventManager_OnRezScript;
86 scene.EventManager.OnStopScript += EventManager_OnStopScript;
87 }
88
89 scene.EventManager.OnFrame += EventManager_OnFrame;
90
91 scene.RegisterModuleInterface<IMRMModule>(this);
92 } 87 }
93 else 88 else
94 { 89 {
@@ -101,6 +96,39 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
101 } 96 }
102 } 97 }
103 98
99 public Type ReplaceableInterface
100 {
101 get { return null; }
102 }
103
104 public void AddRegion(Scene scene)
105 {
106 m_scene = scene;
107 if (!m_hidden)
108 {
109 scene.EventManager.OnRezScript += EventManager_OnRezScript;
110 scene.EventManager.OnStopScript += EventManager_OnStopScript;
111 }
112 scene.EventManager.OnFrame += EventManager_OnFrame;
113
114 scene.RegisterModuleInterface<IMRMModule>(this);
115 }
116 public void RegionLoaded(Scene scene)
117 {
118 }
119
120 public void RemoveRegion(Scene scene)
121 {
122 if (!m_hidden)
123 {
124 scene.EventManager.OnRezScript -= EventManager_OnRezScript;
125 scene.EventManager.OnStopScript -= EventManager_OnStopScript;
126 }
127 scene.EventManager.OnFrame -= EventManager_OnFrame;
128
129 scene.UnregisterModuleInterface<IMRMModule>(this);
130 }
131
104 void EventManager_OnStopScript(uint localID, UUID itemID) 132 void EventManager_OnStopScript(uint localID, UUID itemID)
105 { 133 {
106 if (m_scripts.ContainsKey(itemID)) 134 if (m_scripts.ContainsKey(itemID))
@@ -302,11 +330,6 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
302 mmb.InitMiniModule(world, host, itemID); 330 mmb.InitMiniModule(world, host, itemID);
303 } 331 }
304 332
305 public void PostInitialise()
306 {
307
308 }
309
310 public void Close() 333 public void Close()
311 { 334 {
312 foreach (KeyValuePair<UUID, MRMBase> pair in m_scripts) 335 foreach (KeyValuePair<UUID, MRMBase> pair in m_scripts)
@@ -320,11 +343,6 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
320 get { return "MiniRegionModule"; } 343 get { return "MiniRegionModule"; }
321 } 344 }
322 345
323 public bool IsSharedModule
324 {
325 get { return false; }
326 }
327
328 /// <summary> 346 /// <summary>
329 /// Stolen from ScriptEngine Common 347 /// Stolen from ScriptEngine Common
330 /// </summary> 348 /// </summary>
diff --git a/OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs b/OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs
index c653e98..999756a 100644
--- a/OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs
+++ b/OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs
@@ -100,10 +100,10 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady
100 if (!m_enabled) 100 if (!m_enabled)
101 return; 101 return;
102 102
103 m_scene.EventManager.OnEmptyScriptCompileQueue -= OnEmptyScriptCompileQueue; 103 scene.EventManager.OnEmptyScriptCompileQueue -= OnEmptyScriptCompileQueue;
104 m_scene.EventManager.OnOarFileLoaded -= OnOarFileLoaded; 104 scene.EventManager.OnOarFileLoaded -= OnOarFileLoaded;
105 105
106 m_scene = null; 106 scene = null;
107 } 107 }
108 108
109 public void Close() 109 public void Close()
diff --git a/OpenSim/Region/OptionalModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs b/OpenSim/Region/OptionalModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs
index 44c9ada..df01938 100644
--- a/OpenSim/Region/OptionalModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs
+++ b/OpenSim/Region/OptionalModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs
@@ -58,6 +58,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.ScriptModuleComms
58 58
59 public void RemoveRegion(Scene scene) 59 public void RemoveRegion(Scene scene)
60 { 60 {
61 scene.UnregisterModuleInterface<IScriptModuleComms>(this);
61 } 62 }
62 63
63 public void RegionLoaded(Scene scene) 64 public void RegionLoaded(Scene scene)
diff --git a/OpenSim/Region/OptionalModules/Scripting/XmlRpcRouterModule/XmlRpcGridRouterModule.cs b/OpenSim/Region/OptionalModules/Scripting/XmlRpcRouterModule/XmlRpcGridRouterModule.cs
index d18ac0a..f2a0e53 100644
--- a/OpenSim/Region/OptionalModules/Scripting/XmlRpcRouterModule/XmlRpcGridRouterModule.cs
+++ b/OpenSim/Region/OptionalModules/Scripting/XmlRpcRouterModule/XmlRpcGridRouterModule.cs
@@ -30,6 +30,7 @@ using System.Collections.Generic;
30using System.Reflection; 30using System.Reflection;
31 31
32using log4net; 32using log4net;
33using Mono.Addins;
33using Nini.Config; 34using Nini.Config;
34using OpenMetaverse; 35using OpenMetaverse;
35 36
@@ -49,7 +50,8 @@ namespace OpenSim.Region.OptionalModules.Scripting.XmlRpcGridRouterModule
49 public string uri; 50 public string uri;
50 } 51 }
51 52
52 public class XmlRpcGridRouter : IRegionModule, IXmlRpcRouter 53 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
54 public class XmlRpcGridRouter : INonSharedRegionModule, IXmlRpcRouter
53 { 55 {
54 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 56 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
55 57
@@ -59,7 +61,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.XmlRpcGridRouterModule
59 private bool m_Enabled = false; 61 private bool m_Enabled = false;
60 private string m_ServerURI = String.Empty; 62 private string m_ServerURI = String.Empty;
61 63
62 public void Initialise(Scene scene, IConfigSource config) 64 public void Initialise(IConfigSource config)
63 { 65 {
64 IConfig startupConfig = config.Configs["Startup"]; 66 IConfig startupConfig = config.Configs["Startup"];
65 if (startupConfig == null) 67 if (startupConfig == null)
@@ -75,27 +77,35 @@ namespace OpenSim.Region.OptionalModules.Scripting.XmlRpcGridRouterModule
75 return; 77 return;
76 } 78 }
77 79
78 scene.RegisterModuleInterface<IXmlRpcRouter>(this);
79 m_Enabled = true; 80 m_Enabled = true;
80 } 81 }
81 } 82 }
82 83
83 public void PostInitialise() 84 public void AddRegion(Scene scene)
85 {
86 scene.RegisterModuleInterface<IXmlRpcRouter>(this);
87 }
88 public void RegionLoaded(Scene scene)
84 { 89 {
85 } 90 }
86 91
87 public void Close() 92 public void RemoveRegion(Scene scene)
88 { 93 {
94 scene.UnregisterModuleInterface<IXmlRpcRouter>(this);
89 } 95 }
90 96
91 public string Name 97 public Type ReplaceableInterface
92 { 98 {
93 get { return "XmlRpcGridRouterModule"; } 99 get { return null; }
94 } 100 }
95 101
96 public bool IsSharedModule 102 public void Close()
97 { 103 {
98 get { return false; } 104 }
105
106 public string Name
107 {
108 get { return "XmlRpcGridRouterModule"; }
99 } 109 }
100 110
101 public void RegisterNewReceiver(IScriptModule scriptEngine, UUID channel, UUID objectID, UUID itemID, string uri) 111 public void RegisterNewReceiver(IScriptModule scriptEngine, UUID channel, UUID objectID, UUID itemID, string uri)
diff --git a/OpenSim/Region/OptionalModules/Scripting/XmlRpcRouterModule/XmlRpcRouterModule.cs b/OpenSim/Region/OptionalModules/Scripting/XmlRpcRouterModule/XmlRpcRouterModule.cs
index 32659c8..4d39345 100644
--- a/OpenSim/Region/OptionalModules/Scripting/XmlRpcRouterModule/XmlRpcRouterModule.cs
+++ b/OpenSim/Region/OptionalModules/Scripting/XmlRpcRouterModule/XmlRpcRouterModule.cs
@@ -29,6 +29,7 @@ using System;
29using System.Reflection; 29using System.Reflection;
30 30
31using log4net; 31using log4net;
32using Mono.Addins;
32using Nini.Config; 33using Nini.Config;
33using OpenMetaverse; 34using OpenMetaverse;
34 35
@@ -39,11 +40,12 @@ using OpenSim.Region.Framework.Scenes;
39 40
40namespace OpenSim.Region.OptionalModules.Scripting.XmlRpcRouterModule 41namespace OpenSim.Region.OptionalModules.Scripting.XmlRpcRouterModule
41{ 42{
42 public class XmlRpcRouter : IRegionModule, IXmlRpcRouter 43 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
44 public class XmlRpcRouter : INonSharedRegionModule, IXmlRpcRouter
43 { 45 {
44 //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 46 //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
45 47 private bool m_enabled = false;
46 public void Initialise(Scene scene, IConfigSource config) 48 public void Initialise(IConfigSource config)
47 { 49 {
48 IConfig startupConfig = config.Configs["Startup"]; 50 IConfig startupConfig = config.Configs["Startup"];
49 if (startupConfig == null) 51 if (startupConfig == null)
@@ -52,26 +54,34 @@ namespace OpenSim.Region.OptionalModules.Scripting.XmlRpcRouterModule
52 if (startupConfig.GetString("XmlRpcRouterModule", 54 if (startupConfig.GetString("XmlRpcRouterModule",
53 "XmlRpcRouterModule") == "XmlRpcRouterModule") 55 "XmlRpcRouterModule") == "XmlRpcRouterModule")
54 { 56 {
55 scene.RegisterModuleInterface<IXmlRpcRouter>(this); 57 m_enabled = true;
56 } 58 }
57 } 59 }
60 public void AddRegion(Scene scene)
61 {
62 scene.RegisterModuleInterface<IXmlRpcRouter>(this);
63 }
64 public void RegionLoaded(Scene scene)
65 {
66 }
58 67
59 public void PostInitialise() 68 public void RemoveRegion(Scene scene)
60 { 69 {
70 scene.UnregisterModuleInterface<IXmlRpcRouter>(this);
61 } 71 }
62 72
63 public void Close() 73 public Type ReplaceableInterface
64 { 74 {
75 get { return null; }
65 } 76 }
66 77
67 public string Name 78 public void Close()
68 { 79 {
69 get { return "XmlRpcRouterModule"; }
70 } 80 }
71 81
72 public bool IsSharedModule 82 public string Name
73 { 83 {
74 get { return false; } 84 get { return "XmlRpcRouterModule"; }
75 } 85 }
76 86
77 public void RegisterNewReceiver(IScriptModule scriptEngine, UUID channel, UUID objectID, UUID itemID, string uri) 87 public void RegisterNewReceiver(IScriptModule scriptEngine, UUID channel, UUID objectID, UUID itemID, string uri)
diff --git a/OpenSim/Region/OptionalModules/ServiceConnectorsIn/Freeswitch/FreeswitchServiceInConnectorModule.cs b/OpenSim/Region/OptionalModules/ServiceConnectorsIn/Freeswitch/FreeswitchServiceInConnectorModule.cs
index 97fa63c..801f1f8 100644
--- a/OpenSim/Region/OptionalModules/ServiceConnectorsIn/Freeswitch/FreeswitchServiceInConnectorModule.cs
+++ b/OpenSim/Region/OptionalModules/ServiceConnectorsIn/Freeswitch/FreeswitchServiceInConnectorModule.cs
@@ -47,7 +47,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Freeswitch
47 private IConfigSource m_Config; 47 private IConfigSource m_Config;
48 bool m_Registered = false; 48 bool m_Registered = false;
49 49
50 #region IRegionModule interface 50 #region ISharedRegionModule interface
51 51
52 public void Initialise(IConfigSource config) 52 public void Initialise(IConfigSource config)
53 { 53 {
diff --git a/OpenSim/Region/OptionalModules/SvnSerialiser/SvnBackupModule.cs b/OpenSim/Region/OptionalModules/SvnSerialiser/SvnBackupModule.cs
index 3490a8b..fa5878d 100644
--- a/OpenSim/Region/OptionalModules/SvnSerialiser/SvnBackupModule.cs
+++ b/OpenSim/Region/OptionalModules/SvnSerialiser/SvnBackupModule.cs
@@ -31,6 +31,7 @@ using System.IO;
31using System.Reflection; 31using System.Reflection;
32using System.Timers; 32using System.Timers;
33using log4net; 33using log4net;
34using Mono.Addins;
34using Nini.Config; 35using Nini.Config;
35using OpenSim.Region.Framework.Interfaces; 36using OpenSim.Region.Framework.Interfaces;
36using OpenSim.Region.CoreModules.World.Serialiser; 37using OpenSim.Region.CoreModules.World.Serialiser;
@@ -42,7 +43,8 @@ using Slash = System.IO.Path;
42 43
43namespace OpenSim.Region.Modules.SvnSerialiser 44namespace OpenSim.Region.Modules.SvnSerialiser
44{ 45{
45 public class SvnBackupModule : IRegionModule 46 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
47 public class SvnBackupModule : ISharedRegionModule
46 { 48 {
47 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 49 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
48 50
@@ -200,9 +202,9 @@ namespace OpenSim.Region.Modules.SvnSerialiser
200 202
201 #endregion 203 #endregion
202 204
203 #region IRegionModule Members 205 #region ISharedRegionModule Members
204 206
205 public void Initialise(Scene scene, IConfigSource source) 207 public void Initialise(IConfigSource source)
206 { 208 {
207 m_scenes = new List<Scene>(); 209 m_scenes = new List<Scene>();
208 m_timer = new Timer(); 210 m_timer = new Timer();
@@ -225,7 +227,10 @@ namespace OpenSim.Region.Modules.SvnSerialiser
225 catch (Exception) 227 catch (Exception)
226 { 228 {
227 } 229 }
230 }
228 231
232 public void AddRegion(Scene scene)
233 {
229 lock (m_scenes) 234 lock (m_scenes)
230 { 235 {
231 m_scenes.Add(scene); 236 m_scenes.Add(scene);
@@ -236,6 +241,18 @@ namespace OpenSim.Region.Modules.SvnSerialiser
236 scene.EventManager.OnPluginConsole += EventManager_OnPluginConsole; 241 scene.EventManager.OnPluginConsole += EventManager_OnPluginConsole;
237 } 242 }
238 } 243 }
244 public void RegionLoaded(Scene scene)
245 {
246 }
247
248 public void RemoveRegion(Scene scene)
249 {
250 }
251
252 public Type ReplaceableInterface
253 {
254 get { return null; }
255 }
239 256
240 public void PostInitialise() 257 public void PostInitialise()
241 { 258 {
@@ -277,11 +294,6 @@ namespace OpenSim.Region.Modules.SvnSerialiser
277 get { return "SvnBackupModule"; } 294 get { return "SvnBackupModule"; }
278 } 295 }
279 296
280 public bool IsSharedModule
281 {
282 get { return true; }
283 }
284
285 #endregion 297 #endregion
286 298
287 private void EventManager_OnPluginConsole(string[] args) 299 private void EventManager_OnPluginConsole(string[] args)
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