From f391d028de3aff0cc49d024d855555253eb8c02c 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 98396ff803..dc54c3f821 100644 --- a/OpenSim/Region/CoreModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs @@ -361,6 +361,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 93930ce43b..70ff9549e8 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 @@ -131,6 +132,7 @@ namespace OpenSim.Region.Framework.Interfaces /// Name of constant /// Value of constant or null if none found. 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);