aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/OptionalModules/Scripting/XmlRpcRouterModule/XmlRpcRouterModule.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/OptionalModules/Scripting/XmlRpcRouterModule/XmlRpcRouterModule.cs')
-rw-r--r--OpenSim/Region/OptionalModules/Scripting/XmlRpcRouterModule/XmlRpcRouterModule.cs42
1 files changed, 32 insertions, 10 deletions
diff --git a/OpenSim/Region/OptionalModules/Scripting/XmlRpcRouterModule/XmlRpcRouterModule.cs b/OpenSim/Region/OptionalModules/Scripting/XmlRpcRouterModule/XmlRpcRouterModule.cs
index 32659c8..4783f4c 100644
--- a/OpenSim/Region/OptionalModules/Scripting/XmlRpcRouterModule/XmlRpcRouterModule.cs
+++ b/OpenSim/Region/OptionalModules/Scripting/XmlRpcRouterModule/XmlRpcRouterModule.cs
@@ -31,6 +31,7 @@ using System.Reflection;
31using log4net; 31using log4net;
32using Nini.Config; 32using Nini.Config;
33using OpenMetaverse; 33using OpenMetaverse;
34using Mono.Addins;
34 35
35using OpenSim.Framework; 36using OpenSim.Framework;
36using OpenSim.Region.Framework.Interfaces; 37using OpenSim.Region.Framework.Interfaces;
@@ -39,27 +40,46 @@ 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", Id = "XmlRpcRouter")]
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
46 public void Initialise(Scene scene, IConfigSource config) 48 private bool m_Enabled;
49
50 #region INonSharedRegionModule
51
52 public void Initialise(IConfigSource config)
47 { 53 {
48 IConfig startupConfig = config.Configs["Startup"]; 54 IConfig startupConfig = config.Configs["XMLRPC"];
49 if (startupConfig == null) 55 if (startupConfig == null)
50 return; 56 return;
51 57
52 if (startupConfig.GetString("XmlRpcRouterModule", 58 if (startupConfig.GetString("XmlRpcRouterModule",
53 "XmlRpcRouterModule") == "XmlRpcRouterModule") 59 "XmlRpcRouterModule") == "XmlRpcRouterModule")
54 { 60 m_Enabled = true;
55 scene.RegisterModuleInterface<IXmlRpcRouter>(this); 61 }
56 } 62
63 public void AddRegion(Scene scene)
64 {
65 if (!m_Enabled)
66 return;
67
68 scene.RegisterModuleInterface<IXmlRpcRouter>(this);
57 } 69 }
58 70
59 public void PostInitialise() 71 public void RegionLoaded(Scene scene)
60 { 72 {
61 } 73 }
62 74
75 public void RemoveRegion(Scene scene)
76 {
77 if (!m_Enabled)
78 return;
79
80 scene.UnregisterModuleInterface<IXmlRpcRouter>(this);
81 }
82
63 public void Close() 83 public void Close()
64 { 84 {
65 } 85 }
@@ -69,11 +89,13 @@ namespace OpenSim.Region.OptionalModules.Scripting.XmlRpcRouterModule
69 get { return "XmlRpcRouterModule"; } 89 get { return "XmlRpcRouterModule"; }
70 } 90 }
71 91
72 public bool IsSharedModule 92 public Type ReplaceableInterface
73 { 93 {
74 get { return false; } 94 get { return null; }
75 } 95 }
76 96
97 #endregion
98
77 public void RegisterNewReceiver(IScriptModule scriptEngine, UUID channel, UUID objectID, UUID itemID, string uri) 99 public void RegisterNewReceiver(IScriptModule scriptEngine, UUID channel, UUID objectID, UUID itemID, string uri)
78 { 100 {
79 scriptEngine.PostScriptEvent(itemID, "xmlrpc_uri", new Object[] {uri}); 101 scriptEngine.PostScriptEvent(itemID, "xmlrpc_uri", new Object[] {uri});