diff options
Diffstat (limited to 'OpenSim/Region/Application/OpenSim.cs')
-rw-r--r-- | OpenSim/Region/Application/OpenSim.cs | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index 86975c9..92ccb06 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) |
@@ -267,13 +269,15 @@ namespace OpenSim | |||
267 | 269 | ||
268 | m_console.Commands.AddCommand("region", false, "save oar", | 270 | m_console.Commands.AddCommand("region", false, "save oar", |
269 | //"save oar [-v|--version=<N>] [-p|--profile=<url>] [<OAR path>]", | 271 | //"save oar [-v|--version=<N>] [-p|--profile=<url>] [<OAR path>]", |
270 | "save oar [-p|--profile=<url>] [--noassets] [<OAR path>]", | 272 | "save oar [-p|--profile=<url>] [--noassets] [--perm=<permissions>] [<OAR path>]", |
271 | "Save a region's data to an OAR archive.", | 273 | "Save a region's data to an OAR archive.", |
272 | // "-v|--version=<N> generates scene objects as per older versions of the serialization (e.g. -v=0)" + Environment.NewLine | 274 | // "-v|--version=<N> generates scene objects as per older versions of the serialization (e.g. -v=0)" + Environment.NewLine |
273 | "-p|--profile=<url> adds the url of the profile service to the saved user information." + Environment.NewLine | 275 | "-p|--profile=<url> adds the url of the profile service to the saved user information." + Environment.NewLine |
274 | + " The OAR path must be a filesystem path." | 276 | + "--noassets stops assets being saved to the OAR." + Environment.NewLine |
275 | + " If this is not given then the oar is saved to region.oar in the current directory." + Environment.NewLine | 277 | + "--perm stops objects with insufficient permissions from being saved to the OAR." + Environment.NewLine |
276 | + "--noassets stops assets being saved to the OAR.", | 278 | + " <permissions> can contain one or more of these characters: \"C\" = Copy, \"T\" = Transfer" + Environment.NewLine |
279 | + "The OAR path must be a filesystem path." | ||
280 | + " If this is not given then the oar is saved to region.oar in the current directory.", | ||
277 | SaveOar); | 281 | SaveOar); |
278 | 282 | ||
279 | m_console.Commands.AddCommand("region", false, "edit scale", | 283 | m_console.Commands.AddCommand("region", false, "edit scale", |
@@ -547,6 +551,7 @@ namespace OpenSim | |||
547 | { | 551 | { |
548 | string regionName = string.Empty; | 552 | string regionName = string.Empty; |
549 | string regionFile = string.Empty; | 553 | string regionFile = string.Empty; |
554 | |||
550 | if (cmd.Length == 3) | 555 | if (cmd.Length == 3) |
551 | { | 556 | { |
552 | regionFile = cmd[2]; | 557 | regionFile = cmd[2]; |
@@ -556,14 +561,17 @@ namespace OpenSim | |||
556 | regionName = cmd[2]; | 561 | regionName = cmd[2]; |
557 | regionFile = cmd[3]; | 562 | regionFile = cmd[3]; |
558 | } | 563 | } |
564 | |||
559 | string extension = Path.GetExtension(regionFile).ToLower(); | 565 | string extension = Path.GetExtension(regionFile).ToLower(); |
560 | bool isXml = extension.Equals(".xml"); | 566 | bool isXml = extension.Equals(".xml"); |
561 | bool isIni = extension.Equals(".ini"); | 567 | bool isIni = extension.Equals(".ini"); |
568 | |||
562 | if (!isXml && !isIni) | 569 | if (!isXml && !isIni) |
563 | { | 570 | { |
564 | MainConsole.Instance.Output("Usage: create region [\"region name\"] <region_file.ini>"); | 571 | MainConsole.Instance.Output("Usage: create region [\"region name\"] <region_file.ini>"); |
565 | return; | 572 | return; |
566 | } | 573 | } |
574 | |||
567 | if (!Path.IsPathRooted(regionFile)) | 575 | if (!Path.IsPathRooted(regionFile)) |
568 | { | 576 | { |
569 | string regionsDir = ConfigSource.Source.Configs["Startup"].GetString("regionload_regionsdir", "Regions").Trim(); | 577 | string regionsDir = ConfigSource.Source.Configs["Startup"].GetString("regionload_regionsdir", "Regions").Trim(); |
@@ -580,8 +588,18 @@ namespace OpenSim | |||
580 | regInfo = new RegionInfo(regionName, regionFile, false, ConfigSource.Source, regionName); | 588 | regInfo = new RegionInfo(regionName, regionFile, false, ConfigSource.Source, regionName); |
581 | } | 589 | } |
582 | 590 | ||
583 | IScene scene; | 591 | Scene existingScene; |
592 | if (SceneManager.TryGetScene(regInfo.RegionID, out existingScene)) | ||
593 | { | ||
594 | MainConsole.Instance.OutputFormat( | ||
595 | "ERROR: Cannot create region {0} with ID {1}, this ID is already assigned to region {2}", | ||
596 | regInfo.RegionName, regInfo.RegionID, existingScene.RegionInfo.RegionName); | ||
597 | |||
598 | return; | ||
599 | } | ||
600 | |||
584 | PopulateRegionEstateInfo(regInfo); | 601 | PopulateRegionEstateInfo(regInfo); |
602 | IScene scene; | ||
585 | CreateRegion(regInfo, true, out scene); | 603 | CreateRegion(regInfo, true, out scene); |
586 | regInfo.EstateSettings.Save(); | 604 | regInfo.EstateSettings.Save(); |
587 | } | 605 | } |