diff --git a/OpenSim/Framework/Servers/ServerBase.cs b/OpenSim/Framework/Servers/ServerBase.cs index 9e7aa8be00..1def987169 100755 --- a/OpenSim/Framework/Servers/ServerBase.cs +++ b/OpenSim/Framework/Servers/ServerBase.cs @@ -520,13 +520,10 @@ namespace OpenSim.Framework.Servers public virtual void HandleShow(string module, string[] cmd) { - List args = new List(cmd); + if(cmd.Length < 2) + return; - args.RemoveAt(0); - - string[] showParams = args.ToArray(); - - switch (showParams[0]) + switch (cmd[1]) { case "info": ShowInfo(); @@ -553,18 +550,14 @@ namespace OpenSim.Framework.Servers /// private void HandleConfig(string module, string[] cmd) { - List args = new List(cmd); - args.RemoveAt(0); - string[] cmdparams = args.ToArray(); - - if (cmdparams.Length > 0) + if (cmd.Length > 1) { - string firstParam = cmdparams[0].ToLower(); + string firstParam = cmd[1].ToLower(); switch (firstParam) { case "set": - if (cmdparams.Length < 4) + if (cmd.Length < 5) { Notice("Syntax: config set
"); Notice("Example: config set ScriptEngine.DotNetEngine NumberOfScriptThreads 5"); @@ -573,21 +566,21 @@ namespace OpenSim.Framework.Servers { IConfig c; IConfigSource source = new IniConfigSource(); - c = source.AddConfig(cmdparams[1]); + c = source.AddConfig(cmd[2]); if (c != null) { - string _value = String.Join(" ", cmdparams, 3, cmdparams.Length - 3); - c.Set(cmdparams[2], _value); + string _value = String.Join(" ", cmd, 4, cmd.Length - 4); + c.Set(cmd[3], _value); Config.Merge(source); - Notice("In section [{0}], set {1} = {2}", c.Name, cmdparams[2], _value); + Notice("In section [{0}], set {1} = {2}", c.Name, cmd[3], _value); } } break; case "get": case "show": - if (cmdparams.Length == 1) + if (cmd.Length == 2) { foreach (IConfig config in Config.Configs) { @@ -597,17 +590,17 @@ namespace OpenSim.Framework.Servers Notice(" {0} = {1}", key, config.GetString(key)); } } - else if (cmdparams.Length == 2 || cmdparams.Length == 3) + else if (cmd.Length == 3 || cmd.Length == 4) { - IConfig config = Config.Configs[cmdparams[1]]; + IConfig config = Config.Configs[cmd[2]]; if (config == null) { - Notice("Section \"{0}\" does not exist.",cmdparams[1]); + Notice("Section \"{0}\" does not exist.",cmd[2]); break; } else { - if (cmdparams.Length == 2) + if (cmd.Length == 3) { Notice("[{0}]", config.Name); foreach (string key in config.GetKeys()) @@ -617,7 +610,7 @@ namespace OpenSim.Framework.Servers { Notice( "config get {0} {1} : {2}", - cmdparams[1], cmdparams[2], config.GetString(cmdparams[2])); + cmd[2], cmd[3], config.GetString(cmd[3])); } } } @@ -630,13 +623,13 @@ namespace OpenSim.Framework.Servers break; case "save": - if (cmdparams.Length < 2) + if (cmd.Length < 3) { Notice("Syntax: config save "); return; } - string path = cmdparams[1]; + string path = cmd[2]; Notice("Saving configuration file: {0}", path); if (Config is IniConfigSource)