diff options
author | Melanie Thielker | 2009-06-25 23:31:55 +0000 |
---|---|---|
committer | Melanie Thielker | 2009-06-25 23:31:55 +0000 |
commit | 7cc69ac97fb577807329ad71a8204985862c1757 (patch) | |
tree | 8375a3d93981b7d6786d0f517f44dc7f530534a6 /OpenSim/Framework/RegionInfo.cs | |
parent | From this version onwards, all new region files created automatically will (diff) | |
download | opensim-SC-7cc69ac97fb577807329ad71a8204985862c1757.zip opensim-SC-7cc69ac97fb577807329ad71a8204985862c1757.tar.gz opensim-SC-7cc69ac97fb577807329ad71a8204985862c1757.tar.bz2 opensim-SC-7cc69ac97fb577807329ad71a8204985862c1757.tar.xz |
Make create region save the new region to ini file format if the name
specifies an ini file.
If the ini file exists, the region will be added.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/RegionInfo.cs | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs index eee078e..eb10fac 100644 --- a/OpenSim/Framework/RegionInfo.cs +++ b/OpenSim/Framework/RegionInfo.cs | |||
@@ -262,10 +262,17 @@ namespace OpenSim.Framework | |||
262 | return; | 262 | return; |
263 | } | 263 | } |
264 | 264 | ||
265 | IConfigSource source = new IniConfigSource(filename); | 265 | IniConfigSource source = new IniConfigSource(filename); |
266 | |||
267 | bool saveFile = false; | ||
268 | if (source.Configs[configName] == null) | ||
269 | saveFile = true; | ||
266 | 270 | ||
267 | ReadNiniConfig(source, configName); | 271 | ReadNiniConfig(source, configName); |
268 | 272 | ||
273 | if (configName != String.Empty && saveFile) | ||
274 | source.Save(filename); | ||
275 | |||
269 | return; | 276 | return; |
270 | } | 277 | } |
271 | 278 | ||
@@ -406,7 +413,8 @@ namespace OpenSim.Framework | |||
406 | 413 | ||
407 | if (source.Configs.Count == 0) | 414 | if (source.Configs.Count == 0) |
408 | { | 415 | { |
409 | name = MainConsole.Instance.CmdPrompt("New region name", String.Empty); | 416 | if (name == String.Empty) |
417 | name = MainConsole.Instance.CmdPrompt("New region name", name); | ||
410 | if (name == String.Empty) | 418 | if (name == String.Empty) |
411 | throw new Exception("Cannot interactively create region with no name"); | 419 | throw new Exception("Cannot interactively create region with no name"); |
412 | 420 | ||