Directory defaults for region xml files when creating a new region got changed/lost with svn 8550 when a check was added for the file name having .xml extension. The extension check has been moved slightly earlier and the original directory logic restored.

Fixes Mantis #3386
0.6.5-rc1
idb 2009-04-05 10:31:18 +00:00
parent cf1e8b1723
commit 4e8723ad3f
1 changed files with 3 additions and 9 deletions

View File

@ -409,7 +409,7 @@ namespace OpenSim
private void HandleCreateRegion(string module, string[] cmd)
{
if (cmd.Length < 4)
if (cmd.Length < 4 || !cmd[3].EndsWith(".xml"))
{
m_console.Error("Usage: create region <region name> <region_file.xml>");
return;
@ -418,14 +418,8 @@ namespace OpenSim
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("..") || cmd[3].EndsWith(".xml"))
{
if (cmd[3].StartsWith("/") || cmd[3].StartsWith("\\") || cmd[3].StartsWith(".."))
regionFile = cmd[3];
}
else
{
m_console.Error("Usage: create region <region name> <region_file.xml>");
}
IScene scene;
CreateRegion(new RegionInfo(cmd[2], regionFile, false, ConfigSource.Source), true, out scene);
@ -1111,4 +1105,4 @@ namespace OpenSim
#endregion
}
}
}