diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/XEngine')
-rwxr-xr-x | OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index 62bf803..78d4ee9 100755 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | |||
@@ -2435,5 +2435,30 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
2435 | running = instance.Running; | 2435 | running = instance.Running; |
2436 | return true; | 2436 | return true; |
2437 | } | 2437 | } |
2438 | |||
2439 | public void SleepScript(UUID itemID, int delay) | ||
2440 | { | ||
2441 | IScriptInstance instance = GetInstance(itemID); | ||
2442 | if (instance == null) | ||
2443 | return; | ||
2444 | |||
2445 | instance.ExecutionTimer.Stop(); | ||
2446 | try | ||
2447 | { | ||
2448 | if (instance.CoopWaitHandle != null) | ||
2449 | { | ||
2450 | if (instance.CoopWaitHandle.WaitOne(delay)) | ||
2451 | throw new ScriptCoopStopException(); | ||
2452 | } | ||
2453 | else | ||
2454 | { | ||
2455 | Thread.Sleep(delay); | ||
2456 | } | ||
2457 | } | ||
2458 | finally | ||
2459 | { | ||
2460 | instance.ExecutionTimer.Start(); | ||
2461 | } | ||
2462 | } | ||
2438 | } | 2463 | } |
2439 | } | 2464 | } |