mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 08:55:56 +08:00
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
This commit is contained in:
@@ -101,8 +101,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
/// Used for script sleeps when we are using co-operative script termination.
|
||||
/// </summary>
|
||||
/// <remarks>null if co-operative script termination is not active</remarks>
|
||||
WaitHandle m_coopSleepHandle;
|
||||
|
||||
/// <summary>
|
||||
/// The item that hosts this script
|
||||
/// </summary>
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Check for co-operative termination.
|
||||
/// </summary>
|
||||
/// <param name='delay'>If called with 0, then just the check is performed with no wait.</param>
|
||||
protected virtual void CheckForCoopTermination(int delay)
|
||||
{
|
||||
if (m_coopSleepHandle.WaitOne(delay))
|
||||
throw new ScriptCoopStopException();
|
||||
}
|
||||
|
||||
public Scene World
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user