From 7cc69ac97fb577807329ad71a8204985862c1757 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Thu, 25 Jun 2009 23:31:55 +0000 Subject: 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. --- OpenSim/Framework/RegionInfo.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'OpenSim/Framework') 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 return; } - IConfigSource source = new IniConfigSource(filename); + IniConfigSource source = new IniConfigSource(filename); + + bool saveFile = false; + if (source.Configs[configName] == null) + saveFile = true; ReadNiniConfig(source, configName); + if (configName != String.Empty && saveFile) + source.Save(filename); + return; } @@ -406,7 +413,8 @@ namespace OpenSim.Framework if (source.Configs.Count == 0) { - name = MainConsole.Instance.CmdPrompt("New region name", String.Empty); + if (name == String.Empty) + name = MainConsole.Instance.CmdPrompt("New region name", name); if (name == String.Empty) throw new Exception("Cannot interactively create region with no name"); -- cgit v1.1