From 6e017ca8428d39dc97bd1ed2b326aa5e1e6bbe38 Mon Sep 17 00:00:00 2001 From: MW Date: Wed, 5 Nov 2008 19:47:29 +0000 Subject: fixed/refactored the Get/Set Config console commands. --- OpenSim/Region/Application/OpenSim.cs | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'OpenSim/Region/Application') diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index ded7508..e710ec2 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs @@ -78,7 +78,6 @@ namespace OpenSim m_timedScript = startupConfig.GetString("timer_Script", "disabled"); } - base.ReadConfigSettings(); } @@ -373,15 +372,21 @@ namespace OpenSim } else { - IConfig c = DefaultConfig().Configs[cmdparams[1]]; - if (c == null) - c = DefaultConfig().AddConfig(cmdparams[1]); - string _value = String.Join(" ", cmdparams, 3, cmdparams.Length - 3); - c.Set(cmdparams[2], _value); - m_config.Source.Merge(c.ConfigSource); + // IConfig c = DefaultConfig().Configs[cmdparams[1]]; + // if (c == null) + // c = DefaultConfig().AddConfig(cmdparams[1]); + IConfig c; + IConfigSource source = new IniConfigSource(); + c = source.AddConfig(cmdparams[1]); + if (c != null) + { + string _value = String.Join(" ", cmdparams, 3, cmdparams.Length - 3); + c.Set(cmdparams[2], _value); + m_config.Source.Merge(source); - m_console.Error(n, n + " " + n + " " + cmdparams[1] + " " + cmdparams[2] + " " + - _value); + m_console.Error(n, n + " " + n + " " + cmdparams[1] + " " + cmdparams[2] + " " + + _value); + } } break; case "get": @@ -392,7 +397,7 @@ namespace OpenSim } else { - IConfig c = DefaultConfig().Configs[cmdparams[1]]; + IConfig c = m_config.Source.Configs[cmdparams[1]]; // DefaultConfig().Configs[cmdparams[1]]; if (c == null) { m_console.Notice(n, "Section \"" + cmdparams[1] + "\" does not exist."); -- cgit v1.1