From 61d4291da56e18c7777adebbcfce2c092a2d9a69 Mon Sep 17 00:00:00 2001 From: Melanie Date: Tue, 24 May 2011 03:17:12 +0100 Subject: Create a method to force the script engine to save state from outside --- OpenSim/Region/Framework/Interfaces/IScriptModule.cs | 2 ++ OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | 13 +++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Interfaces/IScriptModule.cs b/OpenSim/Region/Framework/Interfaces/IScriptModule.cs index fecdd1b..d9752e6 100644 --- a/OpenSim/Region/Framework/Interfaces/IScriptModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IScriptModule.cs @@ -50,5 +50,7 @@ namespace OpenSim.Region.Framework.Interfaces void ResumeScript(UUID itemID); ArrayList GetScriptErrors(UUID itemID); + + void SaveAllState(); } } diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index 97ab411..d253c6a 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs @@ -393,11 +393,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine return 0; } - public object DoMaintenance(object p) + public void SaveAllState() { - object[] parms = (object[])p; - int sleepTime = (int)parms[0]; - foreach (IScriptInstance inst in m_Scripts.Values) { if (inst.EventTime() > m_EventLimit) @@ -407,6 +404,14 @@ namespace OpenSim.Region.ScriptEngine.XEngine inst.Start(); } } + } + + public object DoMaintenance(object p) + { + object[] parms = (object[])p; + int sleepTime = (int)parms[0]; + + SaveAllState(); System.Threading.Thread.Sleep(sleepTime); -- cgit v1.1