From b2b6fd6aadb76417afcead9920999bf68e77bde4 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sun, 4 Nov 2012 22:01:34 +0100 Subject: [PATCH] Add a method to query all registered script constants to allow non-XEngine script engines to use them. --- .../ScriptModuleComms/ScriptModuleCommsModule.cs | 16 ++++++++++++++++ .../Framework/Interfaces/IScriptModuleComms.cs | 2 ++ 2 files changed, 18 insertions(+) diff --git a/OpenSim/Region/CoreModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs b/OpenSim/Region/CoreModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs index 705a84700d..c5c96a979f 100644 --- a/OpenSim/Region/CoreModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs @@ -302,6 +302,22 @@ namespace OpenSim.Region.OptionalModules.Scripting.ScriptModuleComms return null; } + /// + /// Get all registered constants + /// + public Dictionary GetConstants() + { + Dictionary ret = new Dictionary(); + + lock (m_constants) + { + foreach (KeyValuePair kvp in m_constants) + ret[kvp.Key] = kvp.Value; + } + + return ret; + } + #endregion } diff --git a/OpenSim/Region/Framework/Interfaces/IScriptModuleComms.cs b/OpenSim/Region/Framework/Interfaces/IScriptModuleComms.cs index ff8213ccb3..d3efa6cd5f 100644 --- a/OpenSim/Region/Framework/Interfaces/IScriptModuleComms.cs +++ b/OpenSim/Region/Framework/Interfaces/IScriptModuleComms.cs @@ -27,6 +27,7 @@ using System; using System.Reflection; +using System.Collections.Generic; using OpenMetaverse; namespace OpenSim.Region.Framework.Interfaces @@ -92,6 +93,7 @@ namespace OpenSim.Region.Framework.Interfaces /// For constants void RegisterConstant(string cname, object value); object LookupModConstant(string cname); + Dictionary GetConstants(); // For use ONLY by the script API void RaiseEvent(UUID script, string id, string module, string command, string key);