diff options
author | Justin Clark-Casey (justincc) | 2012-11-22 05:57:20 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-11-22 05:57:20 +0000 |
commit | 3ce00e97cc6a7801738e72af8b8033fd81d09d12 (patch) | |
tree | b4b65c59375af3b4e2bbedb83153bb6bda2558e3 /OpenSim/Region/Application | |
parent | Make "config show/set/get/save" console commands available on all servers (diff) | |
download | opensim-SC-3ce00e97cc6a7801738e72af8b8033fd81d09d12.zip opensim-SC-3ce00e97cc6a7801738e72af8b8033fd81d09d12.tar.gz opensim-SC-3ce00e97cc6a7801738e72af8b8033fd81d09d12.tar.bz2 opensim-SC-3ce00e97cc6a7801738e72af8b8033fd81d09d12.tar.xz |
Factor out command script code.
This also allows comments in command scripts (lines starting with ;, # or //) to be used across all servers
Diffstat (limited to 'OpenSim/Region/Application')
-rw-r--r-- | OpenSim/Region/Application/OpenSim.cs | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index e654cf7..17b2167 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs | |||
@@ -467,35 +467,6 @@ namespace OpenSim | |||
467 | } | 467 | } |
468 | 468 | ||
469 | /// <summary> | 469 | /// <summary> |
470 | /// Run an optional startup list of commands | ||
471 | /// </summary> | ||
472 | /// <param name="fileName"></param> | ||
473 | private void RunCommandScript(string fileName) | ||
474 | { | ||
475 | if (File.Exists(fileName)) | ||
476 | { | ||
477 | m_log.Info("[COMMANDFILE]: Running " + fileName); | ||
478 | |||
479 | using (StreamReader readFile = File.OpenText(fileName)) | ||
480 | { | ||
481 | string currentCommand; | ||
482 | while ((currentCommand = readFile.ReadLine()) != null) | ||
483 | { | ||
484 | currentCommand = currentCommand.Trim(); | ||
485 | if (!(currentCommand == "" | ||
486 | || currentCommand.StartsWith(";") | ||
487 | || currentCommand.StartsWith("//") | ||
488 | || currentCommand.StartsWith("#"))) | ||
489 | { | ||
490 | m_log.Info("[COMMANDFILE]: Running '" + currentCommand + "'"); | ||
491 | m_console.RunCommand(currentCommand); | ||
492 | } | ||
493 | } | ||
494 | } | ||
495 | } | ||
496 | } | ||
497 | |||
498 | /// <summary> | ||
499 | /// Opens a file and uses it as input to the console command parser. | 470 | /// Opens a file and uses it as input to the console command parser. |
500 | /// </summary> | 471 | /// </summary> |
501 | /// <param name="fileName">name of file to use as input to the console</param> | 472 | /// <param name="fileName">name of file to use as input to the console</param> |
@@ -650,13 +621,6 @@ namespace OpenSim | |||
650 | 621 | ||
651 | switch (command) | 622 | switch (command) |
652 | { | 623 | { |
653 | case "command-script": | ||
654 | if (cmdparams.Length > 0) | ||
655 | { | ||
656 | RunCommandScript(cmdparams[0]); | ||
657 | } | ||
658 | break; | ||
659 | |||
660 | case "backup": | 624 | case "backup": |
661 | MainConsole.Instance.Output("Triggering save of pending object updates to persistent store"); | 625 | MainConsole.Instance.Output("Triggering save of pending object updates to persistent store"); |
662 | SceneManager.BackupCurrentScene(); | 626 | SceneManager.BackupCurrentScene(); |