* Implements MRM's Stop() interface member.

* MRM Scripts should do appropriate cleanup within this event, to allow for clean shutdowns and script updates. This means unbinding from events you are listening to, and releasing any resources.
This commit is contained in:
Adam Frisby
2009-08-07 14:17:51 +10:00
parent e49abf446a
commit 270ae50d70
2 changed files with 10 additions and 0 deletions

View File

@@ -73,6 +73,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
if (!source.Configs["MRM"].GetBoolean("Hidden", false))
{
scene.EventManager.OnRezScript += EventManager_OnRezScript;
scene.EventManager.OnStopScript += EventManager_OnStopScript;
}
scene.EventManager.OnFrame += EventManager_OnFrame;
@@ -90,6 +91,14 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
}
}
void EventManager_OnStopScript(uint localID, UUID itemID)
{
if(m_scripts.ContainsKey(itemID))
{
m_scripts[itemID].Stop();
}
}
void EventManager_OnFrame()
{
m_microthreads.Tick(1000);