Adds support for the "Running" checkbox and the "Reset" button, as well as

ResetScripts In Selection, Set Script to [not] Running In Selection from
the tools menu. Allows DNE script reset without a full recompile.
0.6.0-stable
Melanie Thielker 2008-09-26 16:37:29 +00:00
parent 6e9d7484d0
commit e8d1235e91
1 changed files with 44 additions and 0 deletions

View File

@ -31,6 +31,7 @@ using System.Reflection;
using log4net;
using Nini.Config;
using OpenSim.Region.Interfaces;
using OpenSim.Framework;
using OpenSim.Region.Environment.Interfaces;
using OpenSim.Region.Environment.Scenes;
using OpenSim.Region.ScriptEngine.Interfaces;
@ -135,6 +136,11 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
m_EventManager.HookUpEvents();
m_Scene.EventManager.OnScriptReset += OnScriptReset;
m_Scene.EventManager.OnGetScriptRunning += OnGetScriptRunning;
m_Scene.EventManager.OnStartScript += OnStartScript;
m_Scene.EventManager.OnStopScript += OnStopScript;
m_ScriptManager.Start();
}
@ -310,5 +316,43 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
m_ScriptManager.ResetScript(localID, itemID);
}
public void OnScriptReset(uint localID, UUID itemID)
{
ResetScript(itemID);
}
public void OnStartScript(uint localID, UUID itemID)
{
InstanceData id = m_ScriptManager.GetScript(localID, itemID);
if (id == null)
return;
if (!id.Disabled)
id.Running = true;
}
public void OnStopScript(uint localID, UUID itemID)
{
InstanceData id = m_ScriptManager.GetScript(localID, itemID);
if (id == null)
return;
id.Running = false;
}
public void OnGetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID)
{
uint localID = m_ScriptManager.GetLocalID(itemID);
if (localID == 0)
return;
InstanceData id = m_ScriptManager.GetScript(localID, itemID);
if (id == null)
return;
controllingClient.SendScriptRunningReply(objectID, itemID,
id.Running);
}
}
}