From 763dc8bb76396aeea515b2c7c745cc2eb3a510a9 Mon Sep 17 00:00:00 2001 From: Tom Date: Sun, 1 Aug 2010 10:24:17 -0700 Subject: Add an m_enabled flag to XmlRpcRouterModule so it won't try to bind the xmlrpc_uri event if it's not mentioned in the ini. --- .../Scripting/XmlRpcRouterModule/XmlRpcRouterModule.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/OptionalModules/Scripting/XmlRpcRouterModule/XmlRpcRouterModule.cs') diff --git a/OpenSim/Region/OptionalModules/Scripting/XmlRpcRouterModule/XmlRpcRouterModule.cs b/OpenSim/Region/OptionalModules/Scripting/XmlRpcRouterModule/XmlRpcRouterModule.cs index 32659c8..dcac4a9 100644 --- a/OpenSim/Region/OptionalModules/Scripting/XmlRpcRouterModule/XmlRpcRouterModule.cs +++ b/OpenSim/Region/OptionalModules/Scripting/XmlRpcRouterModule/XmlRpcRouterModule.cs @@ -42,7 +42,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.XmlRpcRouterModule public class XmlRpcRouter : IRegionModule, IXmlRpcRouter { //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - + private bool m_enabled = false; public void Initialise(Scene scene, IConfigSource config) { IConfig startupConfig = config.Configs["Startup"]; @@ -53,6 +53,11 @@ namespace OpenSim.Region.OptionalModules.Scripting.XmlRpcRouterModule "XmlRpcRouterModule") == "XmlRpcRouterModule") { scene.RegisterModuleInterface(this); + m_enabled = true; + } + else + { + m_enabled = false; } } @@ -76,7 +81,10 @@ namespace OpenSim.Region.OptionalModules.Scripting.XmlRpcRouterModule public void RegisterNewReceiver(IScriptModule scriptEngine, UUID channel, UUID objectID, UUID itemID, string uri) { - scriptEngine.PostScriptEvent(itemID, "xmlrpc_uri", new Object[] {uri}); + if (m_enabled) + { + scriptEngine.PostScriptEvent(itemID, "xmlrpc_uri", new Object[] { uri }); + } } public void ScriptRemoved(UUID itemID) -- cgit v1.1