aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/OptionalModules/Scripting/XmlRpcRouterModule
diff options
context:
space:
mode:
authorDiva Canto2012-11-11 16:44:59 -0800
committerDiva Canto2012-11-11 16:44:59 -0800
commit64fad2f80e1bf7a73b7e92adf4462e1b6f9aa335 (patch)
treec70aa04e5a296139745d10c3f4fd12c0d90cdc87 /OpenSim/Region/OptionalModules/Scripting/XmlRpcRouterModule
parentOne more module converted: MRMModule. (diff)
downloadopensim-SC_OLD-64fad2f80e1bf7a73b7e92adf4462e1b6f9aa335.zip
opensim-SC_OLD-64fad2f80e1bf7a73b7e92adf4462e1b6f9aa335.tar.gz
opensim-SC_OLD-64fad2f80e1bf7a73b7e92adf4462e1b6f9aa335.tar.bz2
opensim-SC_OLD-64fad2f80e1bf7a73b7e92adf4462e1b6f9aa335.tar.xz
Two more modules converted: XmlRpcGridRouterModule and XmlRpcRouterModule.
Diffstat (limited to 'OpenSim/Region/OptionalModules/Scripting/XmlRpcRouterModule')
-rw-r--r--OpenSim/Region/OptionalModules/Scripting/XmlRpcRouterModule/XmlRpcGridRouterModule.cs36
-rw-r--r--OpenSim/Region/OptionalModules/Scripting/XmlRpcRouterModule/XmlRpcRouterModule.cs42
2 files changed, 60 insertions, 18 deletions
diff --git a/OpenSim/Region/OptionalModules/Scripting/XmlRpcRouterModule/XmlRpcGridRouterModule.cs b/OpenSim/Region/OptionalModules/Scripting/XmlRpcRouterModule/XmlRpcGridRouterModule.cs
index 2187449..6120a81 100644
--- a/OpenSim/Region/OptionalModules/Scripting/XmlRpcRouterModule/XmlRpcGridRouterModule.cs
+++ b/OpenSim/Region/OptionalModules/Scripting/XmlRpcRouterModule/XmlRpcGridRouterModule.cs
@@ -32,6 +32,7 @@ using System.Reflection;
32using log4net; 32using log4net;
33using Nini.Config; 33using Nini.Config;
34using OpenMetaverse; 34using OpenMetaverse;
35using Mono.Addins;
35 36
36using OpenSim.Framework; 37using OpenSim.Framework;
37using OpenSim.Framework.Communications; 38using OpenSim.Framework.Communications;
@@ -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", Id = "XmlRpcGridRouter")]
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,9 +61,11 @@ 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 #region INonSharedRegionModule
65
66 public void Initialise(IConfigSource config)
63 { 67 {
64 IConfig startupConfig = config.Configs["Startup"]; 68 IConfig startupConfig = config.Configs["XMLRPC"];
65 if (startupConfig == null) 69 if (startupConfig == null)
66 return; 70 return;
67 71
@@ -74,16 +78,30 @@ namespace OpenSim.Region.OptionalModules.Scripting.XmlRpcGridRouterModule
74 m_log.Error("[XMLRPC GRID ROUTER] Module configured but no URI given. Disabling"); 78 m_log.Error("[XMLRPC GRID ROUTER] Module configured but no URI given. Disabling");
75 return; 79 return;
76 } 80 }
77
78 scene.RegisterModuleInterface<IXmlRpcRouter>(this);
79 m_Enabled = true; 81 m_Enabled = true;
80 } 82 }
81 } 83 }
82 84
83 public void PostInitialise() 85 public void AddRegion(Scene scene)
86 {
87 if (!m_Enabled)
88 return;
89
90 scene.RegisterModuleInterface<IXmlRpcRouter>(this);
91 }
92
93 public void RegionLoaded(Scene scene)
84 { 94 {
85 } 95 }
86 96
97 public void RemoveRegion(Scene scene)
98 {
99 if (!m_Enabled)
100 return;
101
102 scene.UnregisterModuleInterface<IXmlRpcRouter>(this);
103 }
104
87 public void Close() 105 public void Close()
88 { 106 {
89 } 107 }
@@ -93,11 +111,13 @@ namespace OpenSim.Region.OptionalModules.Scripting.XmlRpcGridRouterModule
93 get { return "XmlRpcGridRouterModule"; } 111 get { return "XmlRpcGridRouterModule"; }
94 } 112 }
95 113
96 public bool IsSharedModule 114 public Type ReplaceableInterface
97 { 115 {
98 get { return false; } 116 get { return null; }
99 } 117 }
100 118
119 #endregion
120
101 public void RegisterNewReceiver(IScriptModule scriptEngine, UUID channel, UUID objectID, UUID itemID, string uri) 121 public void RegisterNewReceiver(IScriptModule scriptEngine, UUID channel, UUID objectID, UUID itemID, string uri)
102 { 122 {
103 if (!m_Channels.ContainsKey(itemID)) 123 if (!m_Channels.ContainsKey(itemID))
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});