aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorMelanie Thielker2009-06-25 23:31:55 +0000
committerMelanie Thielker2009-06-25 23:31:55 +0000
commit7cc69ac97fb577807329ad71a8204985862c1757 (patch)
tree8375a3d93981b7d6786d0f517f44dc7f530534a6 /OpenSim/Region
parentFrom this version onwards, all new region files created automatically will (diff)
downloadopensim-SC_OLD-7cc69ac97fb577807329ad71a8204985862c1757.zip
opensim-SC_OLD-7cc69ac97fb577807329ad71a8204985862c1757.tar.gz
opensim-SC_OLD-7cc69ac97fb577807329ad71a8204985862c1757.tar.bz2
opensim-SC_OLD-7cc69ac97fb577807329ad71a8204985862c1757.tar.xz
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.
Diffstat (limited to 'OpenSim/Region')
-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)