From c53f732163b391e4bcd33c8acb917deb7598e0a8 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Mon, 17 Aug 2015 21:46:30 +0200 Subject: Change the IScriptApi back to it's original form, removing XEngine specific additions that should not have been there in the first place. Sleeping and time measurement are now completely internal to XEngine --- .../ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 15 ++------------- .../ScriptEngine/Shared/Api/Implementation/LS_Api.cs | 4 ++-- .../ScriptEngine/Shared/Api/Implementation/MOD_Api.cs | 2 +- .../ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 2 +- 4 files changed, 6 insertions(+), 17 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared/Api') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 946680c..f364032 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -101,8 +101,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// Used for script sleeps when we are using co-operative script termination. /// /// null if co-operative script termination is not active - WaitHandle m_coopSleepHandle; - /// /// The item that hosts this script /// @@ -262,12 +260,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api }; public void Initialize( - IScriptEngine scriptEngine, SceneObjectPart host, TaskInventoryItem item, WaitHandle coopSleepHandle) + IScriptEngine scriptEngine, SceneObjectPart host, TaskInventoryItem item) { m_ScriptEngine = scriptEngine; m_host = host; m_item = item; - m_coopSleepHandle = coopSleepHandle; LoadConfig(); @@ -406,21 +403,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api protected virtual void Sleep(int delay) { - if (m_coopSleepHandle == null) - System.Threading.Thread.Sleep(delay); - else - CheckForCoopTermination(delay); + m_ScriptEngine.SleepScript(m_item.ItemID, delay); } /// /// Check for co-operative termination. /// /// If called with 0, then just the check is performed with no wait. - protected virtual void CheckForCoopTermination(int delay) - { - if (m_coopSleepHandle.WaitOne(delay)) - throw new ScriptCoopStopException(); - } public Scene World { diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs index 3406aea..e5e43f8 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs @@ -63,7 +63,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api internal IScriptModuleComms m_comms = null; public void Initialize( - IScriptEngine scriptEngine, SceneObjectPart host, TaskInventoryItem item, WaitHandle coopSleepHandle) + IScriptEngine scriptEngine, SceneObjectPart host, TaskInventoryItem item) { m_ScriptEngine = scriptEngine; m_host = host; @@ -833,4 +833,4 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return success; } } -} \ No newline at end of file +} diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/MOD_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/MOD_Api.cs index 92dd813..9929dac 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/MOD_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/MOD_Api.cs @@ -66,7 +66,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api internal IScriptModuleComms m_comms = null; public void Initialize( - IScriptEngine scriptEngine, SceneObjectPart host, TaskInventoryItem item, WaitHandle coopSleepHandle) + IScriptEngine scriptEngine, SceneObjectPart host, TaskInventoryItem item) { m_ScriptEngine = scriptEngine; m_host = host; diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 123f8ca..c1f1ed5 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -145,7 +145,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api protected IUrlModule m_UrlModule = null; public void Initialize( - IScriptEngine scriptEngine, SceneObjectPart host, TaskInventoryItem item, WaitHandle coopSleepHandle) + IScriptEngine scriptEngine, SceneObjectPart host, TaskInventoryItem item) { m_ScriptEngine = scriptEngine; m_host = host; -- cgit v1.1