mirror of
https://github.com/opensim/opensim.git
synced 2026-08-09 18:55:58 +08:00
Create a method to force the script engine to save state from outside
This commit is contained in:
@@ -52,5 +52,7 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||
ArrayList GetScriptErrors(UUID itemID);
|
||||
|
||||
bool HasScript(UUID itemID, out bool running);
|
||||
|
||||
void SaveAllState();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -461,11 +461,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)
|
||||
@@ -475,6 +472,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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user