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.cs18
1 files changed, 17 insertions, 1 deletions
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs
index 86975c9..fae8be7 100644
--- a/OpenSim/Region/Application/OpenSim.cs
+++ b/OpenSim/Region/Application/OpenSim.cs
@@ -130,7 +130,9 @@ namespace OpenSim
130 //m_log.InfoFormat("[OPENSIM MAIN]: GC Latency Mode: {0}", GCSettings.LatencyMode.ToString()); 130 //m_log.InfoFormat("[OPENSIM MAIN]: GC Latency Mode: {0}", GCSettings.LatencyMode.ToString());
131 131
132 if (m_gui) // Driven by external GUI 132 if (m_gui) // Driven by external GUI
133 {
133 m_console = new CommandConsole("Region"); 134 m_console = new CommandConsole("Region");
135 }
134 else 136 else
135 { 137 {
136 switch (m_consoleType) 138 switch (m_consoleType)
@@ -547,6 +549,7 @@ namespace OpenSim
547 { 549 {
548 string regionName = string.Empty; 550 string regionName = string.Empty;
549 string regionFile = string.Empty; 551 string regionFile = string.Empty;
552
550 if (cmd.Length == 3) 553 if (cmd.Length == 3)
551 { 554 {
552 regionFile = cmd[2]; 555 regionFile = cmd[2];
@@ -556,14 +559,17 @@ namespace OpenSim
556 regionName = cmd[2]; 559 regionName = cmd[2];
557 regionFile = cmd[3]; 560 regionFile = cmd[3];
558 } 561 }
562
559 string extension = Path.GetExtension(regionFile).ToLower(); 563 string extension = Path.GetExtension(regionFile).ToLower();
560 bool isXml = extension.Equals(".xml"); 564 bool isXml = extension.Equals(".xml");
561 bool isIni = extension.Equals(".ini"); 565 bool isIni = extension.Equals(".ini");
566
562 if (!isXml && !isIni) 567 if (!isXml && !isIni)
563 { 568 {
564 MainConsole.Instance.Output("Usage: create region [\"region name\"] <region_file.ini>"); 569 MainConsole.Instance.Output("Usage: create region [\"region name\"] <region_file.ini>");
565 return; 570 return;
566 } 571 }
572
567 if (!Path.IsPathRooted(regionFile)) 573 if (!Path.IsPathRooted(regionFile))
568 { 574 {
569 string regionsDir = ConfigSource.Source.Configs["Startup"].GetString("regionload_regionsdir", "Regions").Trim(); 575 string regionsDir = ConfigSource.Source.Configs["Startup"].GetString("regionload_regionsdir", "Regions").Trim();
@@ -580,8 +586,18 @@ namespace OpenSim
580 regInfo = new RegionInfo(regionName, regionFile, false, ConfigSource.Source, regionName); 586 regInfo = new RegionInfo(regionName, regionFile, false, ConfigSource.Source, regionName);
581 } 587 }
582 588
583 IScene scene; 589 Scene existingScene;
590 if (SceneManager.TryGetScene(regInfo.RegionID, out existingScene))
591 {
592 MainConsole.Instance.OutputFormat(
593 "ERROR: Cannot create region {0} with ID {1}, this ID is already assigned to region {2}",
594 regInfo.RegionName, regInfo.RegionID, existingScene.RegionInfo.RegionName);
595
596 return;
597 }
598
584 PopulateRegionEstateInfo(regInfo); 599 PopulateRegionEstateInfo(regInfo);
600 IScene scene;
585 CreateRegion(regInfo, true, out scene); 601 CreateRegion(regInfo, true, out scene);
586 regInfo.EstateSettings.Save(); 602 regInfo.EstateSettings.Save();
587 } 603 }