Create a method to force the script engine to save state from outside

bulletsim
Melanie 2011-05-24 03:17:12 +01:00
parent 178d541dca
commit 61d4291da5
2 changed files with 11 additions and 4 deletions

View File

@ -50,5 +50,7 @@ namespace OpenSim.Region.Framework.Interfaces
void ResumeScript(UUID itemID); void ResumeScript(UUID itemID);
ArrayList GetScriptErrors(UUID itemID); ArrayList GetScriptErrors(UUID itemID);
void SaveAllState();
} }
} }

View File

@ -393,11 +393,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine
return 0; 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) foreach (IScriptInstance inst in m_Scripts.Values)
{ {
if (inst.EventTime() > m_EventLimit) if (inst.EventTime() > m_EventLimit)
@ -407,6 +404,14 @@ namespace OpenSim.Region.ScriptEngine.XEngine
inst.Start(); inst.Start();
} }
} }
}
public object DoMaintenance(object p)
{
object[] parms = (object[])p;
int sleepTime = (int)parms[0];
SaveAllState();
System.Threading.Thread.Sleep(sleepTime); System.Threading.Thread.Sleep(sleepTime);