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.0.6.6-post-fixes
parent
82305b0dea
commit
7cc69ac97f
|
@ -262,10 +262,17 @@ namespace OpenSim.Framework
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
IConfigSource source = new IniConfigSource(filename);
|
IniConfigSource source = new IniConfigSource(filename);
|
||||||
|
|
||||||
|
bool saveFile = false;
|
||||||
|
if (source.Configs[configName] == null)
|
||||||
|
saveFile = true;
|
||||||
|
|
||||||
ReadNiniConfig(source, configName);
|
ReadNiniConfig(source, configName);
|
||||||
|
|
||||||
|
if (configName != String.Empty && saveFile)
|
||||||
|
source.Save(filename);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -406,7 +413,8 @@ namespace OpenSim.Framework
|
||||||
|
|
||||||
if (source.Configs.Count == 0)
|
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)
|
if (name == String.Empty)
|
||||||
throw new Exception("Cannot interactively create region with no name");
|
throw new Exception("Cannot interactively create region with no name");
|
||||||
|
|
||||||
|
|
|
@ -443,20 +443,38 @@ namespace OpenSim
|
||||||
|
|
||||||
private void HandleCreateRegion(string module, string[] cmd)
|
private void HandleCreateRegion(string module, string[] cmd)
|
||||||
{
|
{
|
||||||
if (cmd.Length < 4 || !cmd[3].EndsWith(".xml"))
|
if (cmd.Length < 4)
|
||||||
{
|
{
|
||||||
m_log.Error("Usage: create region <region name> <region_file.xml>");
|
m_log.Error("Usage: create region <region name> <region_file.xml>");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (cmd[3].EndsWith(".xml"))
|
||||||
|
{
|
||||||
|
string regionsDir = ConfigSource.Source.Configs["Startup"].GetString("regionload_regionsdir", "Regions").Trim();
|
||||||
|
string regionFile = String.Format("{0}/{1}", regionsDir, cmd[3]);
|
||||||
|
// Allow absolute and relative specifiers
|
||||||
|
if (cmd[3].StartsWith("/") || cmd[3].StartsWith("\\") || cmd[3].StartsWith(".."))
|
||||||
|
regionFile = cmd[3];
|
||||||
|
|
||||||
string regionsDir = ConfigSource.Source.Configs["Startup"].GetString("regionload_regionsdir", "Regions").Trim();
|
IScene scene;
|
||||||
string regionFile = String.Format("{0}/{1}", regionsDir, cmd[3]);
|
CreateRegion(new RegionInfo(cmd[2], regionFile, false, ConfigSource.Source), true, out scene);
|
||||||
// Allow absolute and relative specifiers
|
}
|
||||||
if (cmd[3].StartsWith("/") || cmd[3].StartsWith("\\") || cmd[3].StartsWith(".."))
|
else if (cmd[3].EndsWith(".ini"))
|
||||||
regionFile = cmd[3];
|
{
|
||||||
|
string regionsDir = ConfigSource.Source.Configs["Startup"].GetString("regionload_regionsdir", "Regions").Trim();
|
||||||
|
string regionFile = String.Format("{0}/{1}", regionsDir, cmd[3]);
|
||||||
|
// Allow absolute and relative specifiers
|
||||||
|
if (cmd[3].StartsWith("/") || cmd[3].StartsWith("\\") || cmd[3].StartsWith(".."))
|
||||||
|
regionFile = cmd[3];
|
||||||
|
|
||||||
IScene scene;
|
IScene scene;
|
||||||
CreateRegion(new RegionInfo(cmd[2], regionFile, false, ConfigSource.Source), true, out scene);
|
CreateRegion(new RegionInfo(cmd[2], regionFile, false, ConfigSource.Source, cmd[2]), true, out scene);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_log.Error("Usage: create region <region name> <region_file.xml>");
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void HandleLoginEnable(string module, string[] cmd)
|
private void HandleLoginEnable(string module, string[] cmd)
|
||||||
|
|
Loading…
Reference in New Issue