From f9646a0c813545a6ea156e125764ba7aec191b1e Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Wed, 9 Apr 2008 15:33:04 +0000 Subject: [PATCH] From: Michael Osias "This is llDetectedKey for touch_start - it is already implemented for sensor." Thanks Michael --- OpenSim/Region/ClientStack/ClientView.cs | 3 +++ .../Common/LSL_BuiltIn_Commands.cs | 25 ++++++++++++++----- .../Common/ScriptEngineBase/EventManager.cs | 5 +++- 3 files changed, 26 insertions(+), 7 deletions(-) diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs index b68df8e432..25ea3c68db 100644 --- a/OpenSim/Region/ClientStack/ClientView.cs +++ b/OpenSim/Region/ClientStack/ClientView.cs @@ -4442,6 +4442,9 @@ namespace OpenSim.Region.ClientStack // TODO: handle this packet m_log.Warn("[CLIENT]: unhandled InventoryDescent packet"); break; + case PacketType.GetScriptRunning: + m_log.Warn("[CLIENT]: unhandled GetScriptRunning packet"); + break; default: m_log.Warn("[CLIENT]: unhandled packet " + Pack.ToString()); break; diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs index 1968f8e40a..03851b6f82 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs @@ -454,6 +454,19 @@ namespace OpenSim.Region.ScriptEngine.Common return SensedUUID; } } + else + { + ScriptManager sm; + IScript script = null; + + if ((sm = m_ScriptEngine.m_ScriptManager) != null) + if (sm.Scripts.ContainsKey(m_localID)) + if ((script = sm.GetScript(m_localID, m_itemID)) != null) + if (script.llDetectParams._key[0] != null) + return new LLUUID( + script.llDetectParams._key[0] + ); + } return LLUUID.Zero; } @@ -1974,7 +1987,7 @@ namespace OpenSim.Region.ScriptEngine.Common object[] resobj = new object[] { - m_host.LinkNum, num, msg, id + m_host.LinkNum + 1, num, msg, id }; m_ScriptEngine.m_EventQueueManager.AddToScriptQueue( @@ -2001,7 +2014,7 @@ namespace OpenSim.Region.ScriptEngine.Common partItemID = item.ItemID; Object[] resobj = new object[] { - m_host.LinkNum, num, msg, id + m_host.LinkNum + 1, num, msg, id }; m_ScriptEngine.m_EventQueueManager.AddToScriptQueue( @@ -2029,7 +2042,7 @@ namespace OpenSim.Region.ScriptEngine.Common partItemID = item.ItemID; Object[] resobj = new object[] { - m_host.LinkNum, num, msg, id + m_host.LinkNum + 1, num, msg, id }; m_ScriptEngine.m_EventQueueManager.AddToScriptQueue( @@ -2059,7 +2072,7 @@ namespace OpenSim.Region.ScriptEngine.Common partItemID = item.ItemID; Object[] resobj = new object[] { - m_host.LinkNum, num, msg, id + m_host.LinkNum + 1, num, msg, id }; m_ScriptEngine.m_EventQueueManager.AddToScriptQueue( @@ -2077,7 +2090,7 @@ namespace OpenSim.Region.ScriptEngine.Common Object[] respObjThis = new object[] { - m_host.LinkNum, num, msg, id + m_host.LinkNum + 1, num, msg, id }; m_ScriptEngine.m_EventQueueManager.AddToScriptQueue( @@ -2102,7 +2115,7 @@ namespace OpenSim.Region.ScriptEngine.Common partItemID = item.ItemID; Object[] resObjDef = new object[] { - m_host.LinkNum, num, msg, id + m_host.LinkNum + 1, num, msg, id }; m_ScriptEngine.m_EventQueueManager.AddToScriptQueue( diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs index 763cc76534..2f2b38488d 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs @@ -90,7 +90,10 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase public void touch_start(uint localID, LLVector3 offsetPos, IClientAPI remoteClient) { // Add to queue for all scripts in ObjectID object - myScriptEngine.m_EventQueueManager.AddToObjectQueue(localID, "touch_start", EventQueueManager.llDetectNull, new object[] { (int)1 }); + EventQueueManager.Queue_llDetectParams_Struct detstruct = new EventQueueManager.Queue_llDetectParams_Struct(); + detstruct._key = new LSL_Types.key[1]; + detstruct._key[0] = new LSL_Types.key(remoteClient.AgentId.ToString()); + myScriptEngine.m_EventQueueManager.AddToObjectQueue(localID, "touch_start", detstruct, new object[] { (int)1 }); } public void OnRezScript(uint localID, LLUUID itemID, string script)