From 2c1909a873b7895e725d39d67bae4dac9873b1d2 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 11 Oct 2019 00:01:59 +0100 Subject: add osResetAllScripts(LSL_Integer AllLinkset). use with care --- .../Shared/Api/Implementation/OSSL_Api.cs | 34 ++++++++++++++++++++++ .../ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs | 2 ++ .../Shared/Api/Runtime/LSL_Constants.cs | 2 +- .../ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | 4 +++ 4 files changed, 41 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 4d1ccb7..f0f6781 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -5560,5 +5560,39 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return LSL_Rotation.Slerp(a, b, amount); } + + public void osResetAllScripts(LSL_Integer linkset) + { + UUID me = m_item.ItemID; + List scripts = new List(); + + if(linkset != 0) + { + SceneObjectGroup sog = m_host.ParentGroup; + if(sog.inTransit || sog.IsDeleted) + return; + + SceneObjectPart[] parts = sog.Parts; + for (int i = 0; i < parts.Length; i++) + { + scripts.AddRange(parts[i].Inventory.GetInventoryItems(InventoryType.LSL)); + } + } + else + scripts.AddRange(m_host.Inventory.GetInventoryItems(InventoryType.LSL)); + + foreach(TaskInventoryItem script in scripts) + { + if(script.ItemID == me) + continue; + m_ScriptEngine.ResetScript(script.ItemID); + } + + if (m_UrlModule != null) + m_UrlModule.ScriptRemoved(me); + + m_ScriptEngine.ApiResetScript(me); + + } } } \ No newline at end of file diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index 369b361..afbbe6f 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs @@ -556,5 +556,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces LSL_Key osGetLastChangedEventKey(); LSL_Float osGetPSTWallclock(); LSL_Rotation osSlerp(LSL_Rotation a, LSL_Rotation b, LSL_Float amount); + + void osResetAllScripts(LSL_Integer AllLinkset); } } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs index 7edda58..e1c421f 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs @@ -35,7 +35,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase public partial class ScriptBaseClass { // SCRIPTS CONSTANTS - public static readonly LSLInteger OS_APIVERSION = 8; + public static readonly LSLInteger OS_APIVERSION = 9; public static readonly LSLInteger TRUE = 1; public static readonly LSLInteger FALSE = 0; diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index 866a955..e13b6b0 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs @@ -1412,5 +1412,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase return m_OSSL_Functions.osSlerp(a, b, amount); } + public void osResetAllScripts(LSL_Integer allLinkSet) + { + m_OSSL_Functions.osResetAllScripts(allLinkSet); + } } } -- cgit v1.1