From 4ebb4e371f44e8e8e9612d8e5eaab274263a2f89 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sun, 13 Nov 2016 19:25:32 +0000 Subject: prevent self call to llSetScriptState(ownname,FALSE) from blocking entire engine --- OpenSim/Region/ScriptEngine/Interfaces/IScriptEngine.cs | 2 +- .../ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 2 +- OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | 14 +++++++++++--- 3 files changed, 13 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ScriptEngine/Interfaces/IScriptEngine.cs b/OpenSim/Region/ScriptEngine/Interfaces/IScriptEngine.cs index 6355669..361a0b9 100644 --- a/OpenSim/Region/ScriptEngine/Interfaces/IScriptEngine.cs +++ b/OpenSim/Region/ScriptEngine/Interfaces/IScriptEngine.cs @@ -68,7 +68,7 @@ namespace OpenSim.Region.ScriptEngine.Interfaces void SetMinEventDelay(UUID itemID, double delay); int GetStartParameter(UUID itemID); - void SetScriptState(UUID itemID, bool state); + void SetScriptState(UUID itemID, bool state, bool self); bool GetScriptState(UUID itemID); void SetState(UUID itemID, string newState); void ApiResetScript(UUID itemID); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index bafee28..af04951 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -521,7 +521,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if ((item = GetScriptByName(name)) != UUID.Zero) { - m_ScriptEngine.SetScriptState(item, run == 0 ? false : true); + m_ScriptEngine.SetScriptState(item, run == 0 ? false : true, item == m_item.ItemID); } else { diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index e12f850..7822df9 100755 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs @@ -1854,15 +1854,23 @@ namespace OpenSim.Region.ScriptEngine.XEngine return instance; } - public void SetScriptState(UUID itemID, bool running) + public void SetScriptState(UUID itemID, bool running, bool self) { IScriptInstance instance = GetInstance(itemID); if (instance != null) { if (running) - instance.Start(); + instance.Start(); else - instance.Stop(100); + { + if(self) + { + instance.Running = false; + throw new EventAbortException(); + } + else + instance.Stop(100); + } } } -- cgit v1.1