aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs8
-rw-r--r--OpenSim/Region/ScriptEngine/XEngine/XEngine.cs48
2 files changed, 52 insertions, 4 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
index ab46491..17c06e7 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
@@ -650,11 +650,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
650 { 650 {
651 EventParams data = null; 651 EventParams data = null;
652 652
653 if (Suspended)
654 return 0;
655
653 lock (m_EventQueue) 656 lock (m_EventQueue)
654 { 657 {
655 if (Suspended)
656 return 0;
657
658 lock (m_Script) 658 lock (m_Script)
659 { 659 {
660 data = (EventParams) m_EventQueue.Dequeue(); 660 data = (EventParams) m_EventQueue.Dequeue();
@@ -685,7 +685,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
685 lock(m_Script) 685 lock(m_Script)
686 { 686 {
687 687
688 //m_log.DebugFormat("[XEngine]: Processing event {0} for {1}", data.EventName, this); 688// m_log.DebugFormat("[XEngine]: Processing event {0} for {1}", data.EventName, this);
689 689
690 m_DetectParams = data.DetectParams; 690 m_DetectParams = data.DetectParams;
691 691
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
index 6c3d767..696c216 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
@@ -342,6 +342,16 @@ namespace OpenSim.Region.ScriptEngine.XEngine
342 MainConsole.Instance.Commands.AddCommand( 342 MainConsole.Instance.Commands.AddCommand(
343 "scripts", false, "show scripts", "show scripts", "Show script information", 343 "scripts", false, "show scripts", "show scripts", "Show script information",
344 "Synonym for scripts show command", HandleShowScripts); 344 "Synonym for scripts show command", HandleShowScripts);
345
346 MainConsole.Instance.Commands.AddCommand(
347 "scripts", false, "scripts suspend", "scripts suspend", "Suspend all scripts",
348 "Suspends all currently running scripts. This only suspends event delivery, it will not suspend a"
349 + " script that is currently processing an event.",
350 HandleSuspendScripts);
351
352 MainConsole.Instance.Commands.AddCommand(
353 "scripts", false, "scripts resume", "scripts resume", "Resume all scripts",
354 "Resumes all currently suspended scripts", HandleResumeScripts);
345 } 355 }
346 356
347 public void HandleShowScripts(string module, string[] cmdparams) 357 public void HandleShowScripts(string module, string[] cmdparams)
@@ -381,6 +391,44 @@ namespace OpenSim.Region.ScriptEngine.XEngine
381 } 391 }
382 } 392 }
383 393
394 public void HandleSuspendScripts(string module, string[] cmdparams)
395 {
396 lock (m_Scripts)
397 {
398 foreach (IScriptInstance instance in m_Scripts.Values)
399 {
400 if (!instance.Suspended)
401 {
402 instance.Suspend();
403
404 SceneObjectPart sop = m_Scene.GetSceneObjectPart(instance.ObjectID);
405 MainConsole.Instance.OutputFormat(
406 "Suspended {0}.{1}, item UUID {2}, prim UUID {3} @ {4}",
407 instance.PrimName, instance.ScriptName, instance.ItemID, instance.ObjectID, sop.AbsolutePosition);
408 }
409 }
410 }
411 }
412
413 public void HandleResumeScripts(string module, string[] cmdparams)
414 {
415 lock (m_Scripts)
416 {
417 foreach (IScriptInstance instance in m_Scripts.Values)
418 {
419 if (instance.Suspended)
420 {
421 instance.Resume();
422
423 SceneObjectPart sop = m_Scene.GetSceneObjectPart(instance.ObjectID);
424 MainConsole.Instance.OutputFormat(
425 "Resumed {0}.{1}, item UUID {2}, prim UUID {3} @ {4}",
426 instance.PrimName, instance.ScriptName, instance.ItemID, instance.ObjectID, sop.AbsolutePosition);
427 }
428 }
429 }
430 }
431
384 public void RemoveRegion(Scene scene) 432 public void RemoveRegion(Scene scene)
385 { 433 {
386 if (!m_Enabled) 434 if (!m_Enabled)