Merge commit '3cf7fb4eca2ad57835311e8098868f2571709392' into bigmerge

Conflicts:
	OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
	OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
avinationmerge
Melanie 2011-10-25 03:10:54 +01:00
commit df430d572d
2 changed files with 52 additions and 4 deletions

View File

@ -650,11 +650,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
{ {
EventParams data = null; EventParams data = null;
lock (m_EventQueue)
{
if (Suspended) if (Suspended)
return 0; return 0;
lock (m_EventQueue)
{
lock (m_Script) lock (m_Script)
{ {
data = (EventParams) m_EventQueue.Dequeue(); data = (EventParams) m_EventQueue.Dequeue();

View File

@ -342,6 +342,16 @@ namespace OpenSim.Region.ScriptEngine.XEngine
MainConsole.Instance.Commands.AddCommand( MainConsole.Instance.Commands.AddCommand(
"scripts", false, "show scripts", "show scripts", "Show script information", "scripts", false, "show scripts", "show scripts", "Show script information",
"Synonym for scripts show command", HandleShowScripts); "Synonym for scripts show command", HandleShowScripts);
MainConsole.Instance.Commands.AddCommand(
"scripts", false, "scripts suspend", "scripts suspend", "Suspend all scripts",
"Suspends all currently running scripts. This only suspends event delivery, it will not suspend a"
+ " script that is currently processing an event.",
HandleSuspendScripts);
MainConsole.Instance.Commands.AddCommand(
"scripts", false, "scripts resume", "scripts resume", "Resume all scripts",
"Resumes all currently suspended scripts", HandleResumeScripts);
} }
public void HandleShowScripts(string module, string[] cmdparams) public void HandleShowScripts(string module, string[] cmdparams)
@ -381,6 +391,44 @@ namespace OpenSim.Region.ScriptEngine.XEngine
} }
} }
public void HandleSuspendScripts(string module, string[] cmdparams)
{
lock (m_Scripts)
{
foreach (IScriptInstance instance in m_Scripts.Values)
{
if (!instance.Suspended)
{
instance.Suspend();
SceneObjectPart sop = m_Scene.GetSceneObjectPart(instance.ObjectID);
MainConsole.Instance.OutputFormat(
"Suspended {0}.{1}, item UUID {2}, prim UUID {3} @ {4}",
instance.PrimName, instance.ScriptName, instance.ItemID, instance.ObjectID, sop.AbsolutePosition);
}
}
}
}
public void HandleResumeScripts(string module, string[] cmdparams)
{
lock (m_Scripts)
{
foreach (IScriptInstance instance in m_Scripts.Values)
{
if (instance.Suspended)
{
instance.Resume();
SceneObjectPart sop = m_Scene.GetSceneObjectPart(instance.ObjectID);
MainConsole.Instance.OutputFormat(
"Resumed {0}.{1}, item UUID {2}, prim UUID {3} @ {4}",
instance.PrimName, instance.ScriptName, instance.ItemID, instance.ObjectID, sop.AbsolutePosition);
}
}
}
}
public void RemoveRegion(Scene scene) public void RemoveRegion(Scene scene)
{ {
if (!m_Enabled) if (!m_Enabled)