diff options
author | Melanie | 2012-08-01 00:08:02 +0100 |
---|---|---|
committer | Melanie | 2012-08-01 00:08:02 +0100 |
commit | 8114260946be8bbe6754d497f104804d203e00e2 (patch) | |
tree | b87ac81a06f7fffbb39d88e6bc24d4c615b05cee /OpenSim/Region/OptionalModules/Scripting | |
parent | Merge branch 'avination' into careminster (diff) | |
parent | Resolve a deadlock between INPCModule and SensorRepeat by replacing the Senso... (diff) | |
download | opensim-SC-8114260946be8bbe6754d497f104804d203e00e2.zip opensim-SC-8114260946be8bbe6754d497f104804d203e00e2.tar.gz opensim-SC-8114260946be8bbe6754d497f104804d203e00e2.tar.bz2 opensim-SC-8114260946be8bbe6754d497f104804d203e00e2.tar.xz |
Merge branch 'master' into careminster
Diffstat (limited to 'OpenSim/Region/OptionalModules/Scripting')
-rw-r--r-- | OpenSim/Region/OptionalModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/OpenSim/Region/OptionalModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs b/OpenSim/Region/OptionalModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs index 74a85e2..705a847 100644 --- a/OpenSim/Region/OptionalModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs +++ b/OpenSim/Region/OptionalModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs | |||
@@ -46,6 +46,8 @@ namespace OpenSim.Region.OptionalModules.Scripting.ScriptModuleComms | |||
46 | private static readonly ILog m_log = | 46 | private static readonly ILog m_log = |
47 | LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 47 | LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
48 | 48 | ||
49 | private Dictionary<string,object> m_constants = new Dictionary<string,object>(); | ||
50 | |||
49 | #region ScriptInvocation | 51 | #region ScriptInvocation |
50 | protected class ScriptInvocationData | 52 | protected class ScriptInvocationData |
51 | { | 53 | { |
@@ -269,6 +271,37 @@ namespace OpenSim.Region.OptionalModules.Scripting.ScriptModuleComms | |||
269 | Delegate fn = LookupScriptInvocation(fname); | 271 | Delegate fn = LookupScriptInvocation(fname); |
270 | return fn.DynamicInvoke(olist.ToArray()); | 272 | return fn.DynamicInvoke(olist.ToArray()); |
271 | } | 273 | } |
274 | |||
275 | /// <summary> | ||
276 | /// Operation to for a region module to register a constant to be used | ||
277 | /// by the script engine | ||
278 | /// </summary> | ||
279 | public void RegisterConstant(string cname, object value) | ||
280 | { | ||
281 | m_log.DebugFormat("[MODULE COMMANDS] register constant <{0}> with value {1}",cname,value.ToString()); | ||
282 | lock (m_constants) | ||
283 | { | ||
284 | m_constants.Add(cname,value); | ||
285 | } | ||
286 | } | ||
287 | |||
288 | /// <summary> | ||
289 | /// Operation to check for a registered constant | ||
290 | /// </summary> | ||
291 | public object LookupModConstant(string cname) | ||
292 | { | ||
293 | // m_log.DebugFormat("[MODULE COMMANDS] lookup constant <{0}>",cname); | ||
294 | |||
295 | lock (m_constants) | ||
296 | { | ||
297 | object value = null; | ||
298 | if (m_constants.TryGetValue(cname,out value)) | ||
299 | return value; | ||
300 | } | ||
301 | |||
302 | return null; | ||
303 | } | ||
304 | |||
272 | #endregion | 305 | #endregion |
273 | 306 | ||
274 | } | 307 | } |