From 4e8723ad3fd52e24af3a4b0fb848e62d4c3a2519 Mon Sep 17 00:00:00 2001 From: idb Date: Sun, 5 Apr 2009 10:31:18 +0000 Subject: [PATCH] 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 --- OpenSim/Region/Application/OpenSim.cs | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index 5e7420b4a5..8ebf144c2a 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs @@ -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 "); 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 "); - } IScene scene; CreateRegion(new RegionInfo(cmd[2], regionFile, false, ConfigSource.Source), true, out scene); @@ -1111,4 +1105,4 @@ namespace OpenSim #endregion } -} \ No newline at end of file +}