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:
Melanie Thielker
2015-08-17 21:46:30 +02:00
parent ee7debcca6
commit c53f732163
22 changed files with 101 additions and 69 deletions

View File

@@ -2435,5 +2435,30 @@ namespace OpenSim.Region.ScriptEngine.XEngine
running = instance.Running;
return true;
}
public void SleepScript(UUID itemID, int delay)
{
IScriptInstance instance = GetInstance(itemID);
if (instance == null)
return;
instance.ExecutionTimer.Stop();
try
{
if (instance.CoopWaitHandle != null)
{
if (instance.CoopWaitHandle.WaitOne(delay))
throw new ScriptCoopStopException();
}
else
{
Thread.Sleep(delay);
}
}
finally
{
instance.ExecutionTimer.Start();
}
}
}
}