aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2013-01-09 00:01:48 +0000
committerJustin Clark-Casey (justincc)2013-01-25 23:48:20 +0000
commit8ee078c86b10eb5a8d87073e62f675379ab84083 (patch)
treec7213f9c79e96a532baaf9e7258cb3694cf8dcaa /OpenSim/Region/ScriptEngine
parentAdd the new UpdateAgentInformation cap to make maturity on more recent viewers (diff)
downloadopensim-SC-8ee078c86b10eb5a8d87073e62f675379ab84083.zip
opensim-SC-8ee078c86b10eb5a8d87073e62f675379ab84083.tar.gz
opensim-SC-8ee078c86b10eb5a8d87073e62f675379ab84083.tar.bz2
opensim-SC-8ee078c86b10eb5a8d87073e62f675379ab84083.tar.xz
minor: Allow "script *" console commands to take multiple script item ids
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
-rw-r--r--OpenSim/Region/ScriptEngine/XEngine/XEngine.cs62
1 files changed, 32 insertions, 30 deletions
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
index 79cec04..ba63bb6 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
@@ -324,40 +324,40 @@ namespace OpenSim.Region.ScriptEngine.XEngine
324 HandleShowStatus); 324 HandleShowStatus);
325 325
326 MainConsole.Instance.Commands.AddCommand( 326 MainConsole.Instance.Commands.AddCommand(
327 "Scripts", false, "scripts show", "scripts show [<script-item-uuid>]", "Show script information", 327 "Scripts", false, "scripts show", "scripts show [<script-item-uuid>+]", "Show script information",
328 "Show information on all scripts known to the script engine.\n" 328 "Show information on all scripts known to the script engine.\n"
329 + "If a <script-item-uuid> is given then only information on that script will be shown.", 329 + "If one or more <script-item-uuid>s are given then only information on that script will be shown.",
330 HandleShowScripts); 330 HandleShowScripts);
331 331
332 MainConsole.Instance.Commands.AddCommand( 332 MainConsole.Instance.Commands.AddCommand(
333 "Scripts", false, "show scripts", "show scripts [<script-item-uuid>]", "Show script information", 333 "Scripts", false, "show scripts", "show scripts [<script-item-uuid>+]", "Show script information",
334 "Synonym for scripts show command", HandleShowScripts); 334 "Synonym for scripts show command", HandleShowScripts);
335 335
336 MainConsole.Instance.Commands.AddCommand( 336 MainConsole.Instance.Commands.AddCommand(
337 "Scripts", false, "scripts suspend", "scripts suspend [<script-item-uuid>]", "Suspends all running scripts", 337 "Scripts", false, "scripts suspend", "scripts suspend [<script-item-uuid>+]", "Suspends all running scripts",
338 "Suspends all currently running scripts. This only suspends event delivery, it will not suspend a" 338 "Suspends all currently running scripts. This only suspends event delivery, it will not suspend a"
339 + " script that is currently processing an event.\n" 339 + " script that is currently processing an event.\n"
340 + "Suspended scripts will continue to accumulate events but won't process them.\n" 340 + "Suspended scripts will continue to accumulate events but won't process them.\n"
341 + "If a <script-item-uuid> is given then only that script will be suspended. Otherwise, all suitable scripts are suspended.", 341 + "If one or more <script-item-uuid>s are given then only that script will be suspended. Otherwise, all suitable scripts are suspended.",
342 (module, cmdparams) => HandleScriptsAction(cmdparams, HandleSuspendScript)); 342 (module, cmdparams) => HandleScriptsAction(cmdparams, HandleSuspendScript));
343 343
344 MainConsole.Instance.Commands.AddCommand( 344 MainConsole.Instance.Commands.AddCommand(
345 "Scripts", false, "scripts resume", "scripts resume [<script-item-uuid>]", "Resumes all suspended scripts", 345 "Scripts", false, "scripts resume", "scripts resume [<script-item-uuid>+]", "Resumes all suspended scripts",
346 "Resumes all currently suspended scripts.\n" 346 "Resumes all currently suspended scripts.\n"
347 + "Resumed scripts will process all events accumulated whilst suspended.\n" 347 + "Resumed scripts will process all events accumulated whilst suspended.\n"
348 + "If a <script-item-uuid> is given then only that script will be resumed. Otherwise, all suitable scripts are resumed.", 348 + "If one or more <script-item-uuid>s are given then only that script will be resumed. Otherwise, all suitable scripts are resumed.",
349 (module, cmdparams) => HandleScriptsAction(cmdparams, HandleResumeScript)); 349 (module, cmdparams) => HandleScriptsAction(cmdparams, HandleResumeScript));
350 350
351 MainConsole.Instance.Commands.AddCommand( 351 MainConsole.Instance.Commands.AddCommand(
352 "Scripts", false, "scripts stop", "scripts stop [<script-item-uuid>]", "Stops all running scripts", 352 "Scripts", false, "scripts stop", "scripts stop [<script-item-uuid>+]", "Stops all running scripts",
353 "Stops all running scripts.\n" 353 "Stops all running scripts.\n"
354 + "If a <script-item-uuid> is given then only that script will be stopped. Otherwise, all suitable scripts are stopped.", 354 + "If one or more <script-item-uuid>s are given then only that script will be stopped. Otherwise, all suitable scripts are stopped.",
355 (module, cmdparams) => HandleScriptsAction(cmdparams, HandleStopScript)); 355 (module, cmdparams) => HandleScriptsAction(cmdparams, HandleStopScript));
356 356
357 MainConsole.Instance.Commands.AddCommand( 357 MainConsole.Instance.Commands.AddCommand(
358 "Scripts", false, "scripts start", "scripts start [<script-item-uuid>]", "Starts all stopped scripts", 358 "Scripts", false, "scripts start", "scripts start [<script-item-uuid>+]", "Starts all stopped scripts",
359 "Starts all stopped scripts.\n" 359 "Starts all stopped scripts.\n"
360 + "If a <script-item-uuid> is given then only that script will be started. Otherwise, all suitable scripts are started.", 360 + "If one or more <script-item-uuid>s are given then only that script will be started. Otherwise, all suitable scripts are started.",
361 (module, cmdparams) => HandleScriptsAction(cmdparams, HandleStartScript)); 361 (module, cmdparams) => HandleScriptsAction(cmdparams, HandleStartScript));
362 362
363 MainConsole.Instance.Commands.AddCommand( 363 MainConsole.Instance.Commands.AddCommand(
@@ -478,29 +478,31 @@ namespace OpenSim.Region.ScriptEngine.XEngine
478 return; 478 return;
479 } 479 }
480 480
481 rawItemId = cmdparams[2]; 481 for (int i = 2; i < cmdparams.Length; i++)
482
483 if (!UUID.TryParse(rawItemId, out itemId))
484 { 482 {
485 MainConsole.Instance.OutputFormat("ERROR: {0} is not a valid UUID", rawItemId); 483 rawItemId = cmdparams[i];
486 return; 484
487 } 485 if (!UUID.TryParse(rawItemId, out itemId))
488
489 if (itemId != UUID.Zero)
490 {
491 IScriptInstance instance = GetInstance(itemId);
492 if (instance == null)
493 { 486 {
494 // Commented out for now since this will cause false reports on simulators with more than 487 MainConsole.Instance.OutputFormat("ERROR: {0} is not a valid UUID", rawItemId);
495 // one scene where the current command line set region is 'root' (which causes commands to 488 continue;
496 // go to both regions... (sigh)
497// MainConsole.Instance.OutputFormat("Error - No item found with id {0}", itemId);
498 return;
499 } 489 }
500 else 490
491 if (itemId != UUID.Zero)
501 { 492 {
502 action(instance); 493 IScriptInstance instance = GetInstance(itemId);
503 return; 494 if (instance == null)
495 {
496 // Commented out for now since this will cause false reports on simulators with more than
497 // one scene where the current command line set region is 'root' (which causes commands to
498 // go to both regions... (sigh)
499 // MainConsole.Instance.OutputFormat("Error - No item found with id {0}", itemId);
500 continue;
501 }
502 else
503 {
504 action(instance);
505 }
504 } 506 }
505 } 507 }
506 } 508 }