From 82d43db1ccbc2b13e21c88650165f82651b657e1 Mon Sep 17 00:00:00 2001 From: Tedd Hansen Date: Thu, 17 Jan 2008 15:22:35 +0000 Subject: Added data structure to be passed through event execution queue so that events can use llDetect*-commands to find information about event. --- .../Common/ScriptEngineBase/EventQueueManager.cs | 36 +++++++++++++++++----- 1 file changed, 29 insertions(+), 7 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs') diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs index af91027..ced4863 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs @@ -96,10 +96,31 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase public uint localID; public LLUUID itemID; public string functionName; + public Queue_llDetectParams_Struct llDetectParams; public object[] param; } /// + /// Shared empty llDetectNull + /// + public readonly static Queue_llDetectParams_Struct llDetectNull = new Queue_llDetectParams_Struct(); + + /// + /// Structure to hold data for llDetect* commands + /// + public struct Queue_llDetectParams_Struct + { + // More or less just a placeholder for the actual moving of additional data + // should be fixed to something better :) + public LSL_Types.key[] _key; + public LSL_Types.Quaternion[] _Quaternion; + public LSL_Types.Vector3[] _Vector3; + public bool[] _bool; + public int[] _int; + public string [] _string; + } + + /// /// List of localID locks for mutex processing of script events /// private List objectLocks = new List(); @@ -211,7 +232,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase + ", QIS.functionName: " + QIS.functionName); #endif m_ScriptEngine.m_ScriptManager.ExecuteEvent(QIS.localID, QIS.itemID, - QIS.functionName, QIS.param); + QIS.functionName, QIS.llDetectParams, QIS.param); } catch (Exception e) { @@ -311,10 +332,10 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase /// /// Add event to event execution queue /// - /// + /// Region object ID /// Name of the function, will be state + "_event_" + FunctionName /// Array of parameters to match event mask - public void AddToObjectQueue(uint localID, string FunctionName, params object[] param) + public void AddToObjectQueue(uint localID, string FunctionName, Queue_llDetectParams_Struct qParams, params object[] param) { // Determine all scripts in Object and add to their queue //myScriptEngine.m_logger.Verbose("ScriptEngine", "EventQueueManager Adding localID: " + localID + ", FunctionName: " + FunctionName); @@ -334,18 +355,18 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase { // Add to each script in that object // TODO: Some scripts may not subscribe to this event. Should we NOT add it? Does it matter? - AddToScriptQueue(localID, itemID, FunctionName, param); + AddToScriptQueue(localID, itemID, FunctionName, qParams, param); } } /// /// Add event to event execution queue /// - /// - /// + /// Region object ID + /// Region script ID /// Name of the function, will be state + "_event_" + FunctionName /// Array of parameters to match event mask - public void AddToScriptQueue(uint localID, LLUUID itemID, string FunctionName, params object[] param) + public void AddToScriptQueue(uint localID, LLUUID itemID, string FunctionName, Queue_llDetectParams_Struct qParams, params object[] param) { lock (queueLock) { @@ -354,6 +375,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase QIS.localID = localID; QIS.itemID = itemID; QIS.functionName = FunctionName; + QIS.llDetectParams = qParams; QIS.param = param; // Add it to queue -- cgit v1.1