diff options
author | Melanie | 2011-05-24 02:40:59 +0200 |
---|---|---|
committer | Melanie | 2011-05-24 02:40:59 +0200 |
commit | d5841e07c2063ea8ac6602f17b8c30ae10a319b8 (patch) | |
tree | a52c70915b30ad1a7b5c2cb2afa3c9832b4e337c /OpenSim/Region | |
parent | Add an event for an orderly region shutdown that fires once per region before (diff) | |
download | opensim-SC-d5841e07c2063ea8ac6602f17b8c30ae10a319b8.zip opensim-SC-d5841e07c2063ea8ac6602f17b8c30ae10a319b8.tar.gz opensim-SC-d5841e07c2063ea8ac6602f17b8c30ae10a319b8.tar.bz2 opensim-SC-d5841e07c2063ea8ac6602f17b8c30ae10a319b8.tar.xz |
Create a method to force the script engine to save state from outside
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/Framework/Interfaces/IScriptModule.cs | 2 | ||||
-rw-r--r-- | OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | 13 |
2 files changed, 11 insertions, 4 deletions
diff --git a/OpenSim/Region/Framework/Interfaces/IScriptModule.cs b/OpenSim/Region/Framework/Interfaces/IScriptModule.cs index 4a3c634..641e226 100644 --- a/OpenSim/Region/Framework/Interfaces/IScriptModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IScriptModule.cs | |||
@@ -52,5 +52,7 @@ namespace OpenSim.Region.Framework.Interfaces | |||
52 | ArrayList GetScriptErrors(UUID itemID); | 52 | ArrayList GetScriptErrors(UUID itemID); |
53 | 53 | ||
54 | bool HasScript(UUID itemID, out bool running); | 54 | bool HasScript(UUID itemID, out bool running); |
55 | |||
56 | void SaveAllState(); | ||
55 | } | 57 | } |
56 | } | 58 | } |
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index 9a78a42..4f3432d 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | |||
@@ -461,11 +461,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
461 | return 0; | 461 | return 0; |
462 | } | 462 | } |
463 | 463 | ||
464 | public object DoMaintenance(object p) | 464 | public void SaveAllState() |
465 | { | 465 | { |
466 | object[] parms = (object[])p; | ||
467 | int sleepTime = (int)parms[0]; | ||
468 | |||
469 | foreach (IScriptInstance inst in m_Scripts.Values) | 466 | foreach (IScriptInstance inst in m_Scripts.Values) |
470 | { | 467 | { |
471 | if (inst.EventTime() > m_EventLimit) | 468 | if (inst.EventTime() > m_EventLimit) |
@@ -475,6 +472,14 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
475 | inst.Start(); | 472 | inst.Start(); |
476 | } | 473 | } |
477 | } | 474 | } |
475 | } | ||
476 | |||
477 | public object DoMaintenance(object p) | ||
478 | { | ||
479 | object[] parms = (object[])p; | ||
480 | int sleepTime = (int)parms[0]; | ||
481 | |||
482 | SaveAllState(); | ||
478 | 483 | ||
479 | System.Threading.Thread.Sleep(sleepTime); | 484 | System.Threading.Thread.Sleep(sleepTime); |
480 | 485 | ||