diff options
fixed/refactored the Get/Set Config console commands.
-rw-r--r-- | OpenSim/Region/Application/OpenSim.cs | 25 |
1 files changed, 15 insertions, 10 deletions
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 | |||
78 | 78 | ||
79 | m_timedScript = startupConfig.GetString("timer_Script", "disabled"); | 79 | m_timedScript = startupConfig.GetString("timer_Script", "disabled"); |
80 | } | 80 | } |
81 | |||
82 | base.ReadConfigSettings(); | 81 | base.ReadConfigSettings(); |
83 | } | 82 | } |
84 | 83 | ||
@@ -373,15 +372,21 @@ namespace OpenSim | |||
373 | } | 372 | } |
374 | else | 373 | else |
375 | { | 374 | { |
376 | IConfig c = DefaultConfig().Configs[cmdparams[1]]; | 375 | // IConfig c = DefaultConfig().Configs[cmdparams[1]]; |
377 | if (c == null) | 376 | // if (c == null) |
378 | c = DefaultConfig().AddConfig(cmdparams[1]); | 377 | // c = DefaultConfig().AddConfig(cmdparams[1]); |
379 | string _value = String.Join(" ", cmdparams, 3, cmdparams.Length - 3); | 378 | IConfig c; |
380 | c.Set(cmdparams[2], _value); | 379 | IConfigSource source = new IniConfigSource(); |
381 | m_config.Source.Merge(c.ConfigSource); | 380 | c = source.AddConfig(cmdparams[1]); |
381 | if (c != null) | ||
382 | { | ||
383 | string _value = String.Join(" ", cmdparams, 3, cmdparams.Length - 3); | ||
384 | c.Set(cmdparams[2], _value); | ||
385 | m_config.Source.Merge(source); | ||
382 | 386 | ||
383 | m_console.Error(n, n + " " + n + " " + cmdparams[1] + " " + cmdparams[2] + " " + | 387 | m_console.Error(n, n + " " + n + " " + cmdparams[1] + " " + cmdparams[2] + " " + |
384 | _value); | 388 | _value); |
389 | } | ||
385 | } | 390 | } |
386 | break; | 391 | break; |
387 | case "get": | 392 | case "get": |
@@ -392,7 +397,7 @@ namespace OpenSim | |||
392 | } | 397 | } |
393 | else | 398 | else |
394 | { | 399 | { |
395 | IConfig c = DefaultConfig().Configs[cmdparams[1]]; | 400 | IConfig c = m_config.Source.Configs[cmdparams[1]]; // DefaultConfig().Configs[cmdparams[1]]; |
396 | if (c == null) | 401 | if (c == null) |
397 | { | 402 | { |
398 | m_console.Notice(n, "Section \"" + cmdparams[1] + "\" does not exist."); | 403 | m_console.Notice(n, "Section \"" + cmdparams[1] + "\" does not exist."); |