aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Application/OpenSim.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Application/OpenSim.cs')
-rw-r--r--OpenSim/Region/Application/OpenSim.cs38
1 files changed, 28 insertions, 10 deletions
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs
index aef0b91..3babe72 100644
--- a/OpenSim/Region/Application/OpenSim.cs
+++ b/OpenSim/Region/Application/OpenSim.cs
@@ -443,20 +443,38 @@ namespace OpenSim
443 443
444 private void HandleCreateRegion(string module, string[] cmd) 444 private void HandleCreateRegion(string module, string[] cmd)
445 { 445 {
446 if (cmd.Length < 4 || !cmd[3].EndsWith(".xml")) 446 if (cmd.Length < 4)
447 {
448 m_log.Error("Usage: create region <region name> <region_file.xml>");
449 return;
450 }
451 if (cmd[3].EndsWith(".xml"))
452 {
453 string regionsDir = ConfigSource.Source.Configs["Startup"].GetString("regionload_regionsdir", "Regions").Trim();
454 string regionFile = String.Format("{0}/{1}", regionsDir, cmd[3]);
455 // Allow absolute and relative specifiers
456 if (cmd[3].StartsWith("/") || cmd[3].StartsWith("\\") || cmd[3].StartsWith(".."))
457 regionFile = cmd[3];
458
459 IScene scene;
460 CreateRegion(new RegionInfo(cmd[2], regionFile, false, ConfigSource.Source), true, out scene);
461 }
462 else if (cmd[3].EndsWith(".ini"))
463 {
464 string regionsDir = ConfigSource.Source.Configs["Startup"].GetString("regionload_regionsdir", "Regions").Trim();
465 string regionFile = String.Format("{0}/{1}", regionsDir, cmd[3]);
466 // Allow absolute and relative specifiers
467 if (cmd[3].StartsWith("/") || cmd[3].StartsWith("\\") || cmd[3].StartsWith(".."))
468 regionFile = cmd[3];
469
470 IScene scene;
471 CreateRegion(new RegionInfo(cmd[2], regionFile, false, ConfigSource.Source, cmd[2]), true, out scene);
472 }
473 else
447 { 474 {
448 m_log.Error("Usage: create region <region name> <region_file.xml>"); 475 m_log.Error("Usage: create region <region name> <region_file.xml>");
449 return; 476 return;
450 } 477 }
451
452 string regionsDir = ConfigSource.Source.Configs["Startup"].GetString("regionload_regionsdir", "Regions").Trim();
453 string regionFile = String.Format("{0}/{1}", regionsDir, cmd[3]);
454 // Allow absolute and relative specifiers
455 if (cmd[3].StartsWith("/") || cmd[3].StartsWith("\\") || cmd[3].StartsWith(".."))
456 regionFile = cmd[3];
457
458 IScene scene;
459 CreateRegion(new RegionInfo(cmd[2], regionFile, false, ConfigSource.Source), true, out scene);
460 } 478 }
461 479
462 private void HandleLoginEnable(string module, string[] cmd) 480 private void HandleLoginEnable(string module, string[] cmd)