diff options
Merge branch 'master' into careminster
Conflicts:
OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
Diffstat (limited to 'OpenSim/Region/ScriptEngine/XEngine')
-rw-r--r-- | OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | 87 |
1 files changed, 47 insertions, 40 deletions
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index 65c7416..23531a9 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | |||
@@ -341,11 +341,13 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
341 | } | 341 | } |
342 | 342 | ||
343 | MainConsole.Instance.Commands.AddCommand( | 343 | MainConsole.Instance.Commands.AddCommand( |
344 | "scripts", false, "scripts show", "scripts show", "Show script information", | 344 | "scripts", false, "scripts show", "scripts show [<script-item-uuid>]", "Show script information", |
345 | "Show information on all scripts known to the script engine", HandleShowScripts); | 345 | "Show information on all scripts known to the script engine." |
346 | + "If a <script-item-uuid> is given then only information on that script will be shown.", | ||
347 | HandleShowScripts); | ||
346 | 348 | ||
347 | MainConsole.Instance.Commands.AddCommand( | 349 | MainConsole.Instance.Commands.AddCommand( |
348 | "scripts", false, "show scripts", "show scripts", "Show script information", | 350 | "scripts", false, "show scripts", "show scripts [<script-item-uuid>]", "Show script information", |
349 | "Synonym for scripts show command", HandleShowScripts); | 351 | "Synonym for scripts show command", HandleShowScripts); |
350 | 352 | ||
351 | MainConsole.Instance.Commands.AddCommand( | 353 | MainConsole.Instance.Commands.AddCommand( |
@@ -376,43 +378,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
376 | (module, cmdparams) => HandleScriptsAction(cmdparams, HandleStartScript)); | 378 | (module, cmdparams) => HandleScriptsAction(cmdparams, HandleStartScript)); |
377 | } | 379 | } |
378 | 380 | ||
379 | public void HandleShowScripts(string module, string[] cmdparams) | ||
380 | { | ||
381 | lock (m_Scripts) | ||
382 | { | ||
383 | MainConsole.Instance.OutputFormat( | ||
384 | "Showing {0} scripts in {1}", m_Scripts.Count, m_Scene.RegionInfo.RegionName); | ||
385 | |||
386 | foreach (IScriptInstance instance in m_Scripts.Values) | ||
387 | { | ||
388 | SceneObjectPart sop = m_Scene.GetSceneObjectPart(instance.ObjectID); | ||
389 | string status; | ||
390 | |||
391 | if (instance.ShuttingDown) | ||
392 | { | ||
393 | status = "shutting down"; | ||
394 | } | ||
395 | else if (instance.Suspended) | ||
396 | { | ||
397 | status = "suspended"; | ||
398 | } | ||
399 | else if (!instance.Running) | ||
400 | { | ||
401 | status = "stopped"; | ||
402 | } | ||
403 | else | ||
404 | { | ||
405 | status = "running"; | ||
406 | } | ||
407 | |||
408 | MainConsole.Instance.OutputFormat( | ||
409 | "{0}.{1}, item UUID {2}, prim UUID {3} @ {4} ({5})", | ||
410 | instance.PrimName, instance.ScriptName, instance.ItemID, instance.ObjectID, | ||
411 | sop.AbsolutePosition, status); | ||
412 | } | ||
413 | } | ||
414 | } | ||
415 | |||
416 | /// <summary> | 381 | /// <summary> |
417 | /// Parse the raw item id into a script instance from the command params if it's present. | 382 | /// Parse the raw item id into a script instance from the command params if it's present. |
418 | /// </summary> | 383 | /// </summary> |
@@ -462,6 +427,48 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
462 | } | 427 | } |
463 | } | 428 | } |
464 | 429 | ||
430 | public void HandleShowScripts(string module, string[] cmdparams) | ||
431 | { | ||
432 | if (cmdparams.Length == 2) | ||
433 | { | ||
434 | lock (m_Scripts) | ||
435 | { | ||
436 | MainConsole.Instance.OutputFormat( | ||
437 | "Showing {0} scripts in {1}", m_Scripts.Count, m_Scene.RegionInfo.RegionName); | ||
438 | } | ||
439 | } | ||
440 | |||
441 | HandleScriptsAction(cmdparams, HandleShowScript); | ||
442 | } | ||
443 | |||
444 | private void HandleShowScript(IScriptInstance instance) | ||
445 | { | ||
446 | SceneObjectPart sop = m_Scene.GetSceneObjectPart(instance.ObjectID); | ||
447 | string status; | ||
448 | |||
449 | if (instance.ShuttingDown) | ||
450 | { | ||
451 | status = "shutting down"; | ||
452 | } | ||
453 | else if (instance.Suspended) | ||
454 | { | ||
455 | status = "suspended"; | ||
456 | } | ||
457 | else if (!instance.Running) | ||
458 | { | ||
459 | status = "stopped"; | ||
460 | } | ||
461 | else | ||
462 | { | ||
463 | status = "running"; | ||
464 | } | ||
465 | |||
466 | MainConsole.Instance.OutputFormat( | ||
467 | "{0}.{1}, item UUID {2}, prim UUID {3} @ {4} ({5})", | ||
468 | instance.PrimName, instance.ScriptName, instance.ItemID, instance.ObjectID, | ||
469 | sop.AbsolutePosition, status); | ||
470 | } | ||
471 | |||
465 | private void HandleSuspendScript(IScriptInstance instance) | 472 | private void HandleSuspendScript(IScriptInstance instance) |
466 | { | 473 | { |
467 | if (!instance.Suspended) | 474 | if (!instance.Suspended) |