From 2a4dd34616bdb0641f841766dfd15c4c784d3549 Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Sun, 2 Feb 2014 12:21:18 -0800 Subject: [PATCH] Change new 'load oar' parameters to be hyphenated to be consistant with existing parameters. ('--forceterrain' becomes '--force-terrain'). The old forms have been kept for downward compatiblity. --- OpenSim/Region/Application/OpenSim.cs | 16 ++++++++-------- .../World/Archiver/ArchiveReadRequest.cs | 6 +++--- .../CoreModules/World/Archiver/ArchiverModule.cs | 14 +++++++------- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index 1e36853d0c..a609b778f9 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs @@ -267,18 +267,18 @@ namespace OpenSim m_console.Commands.AddCommand("Archiving", false, "load oar", "load oar [--merge] [--skip-assets]" - + " [--forceterrain] [--forceparcels]" - + " [--rotation degrees] [--rotationCenter \"\"]" + + " [--force-terrain] [--force-parcels]" + + " [--rotation degrees] [--rotation-center \"\"]" + " [--displacement \"\"]" + " []", "Load a region's data from an OAR archive.", "--merge will merge the OAR with the existing scene (suppresses terrain and parcel info loading)." + Environment.NewLine - + "--skip-assets will load the OAR but ignore the assets it contains." + Environment.NewLine - + "--displacement will add this value to the position of every object loaded" + Environment.NewLine - + "--forceterrain forces the loading of terrain from the oar (undoes suppression done by --merge)" + Environment.NewLine - + "--forceparcels forces the loading of parcels from the oar (undoes suppression done by --merge)" + Environment.NewLine - + "--rotation specified rotation to be applied to the oar. Specified in degrees." + Environment.NewLine - + "--rotationcenter Location (relative to original OAR) to apply rotation. Default is <128,128,0>" + Environment.NewLine + + "--skip-assets will load the OAR but ignore the assets it contains." + Environment.NewLine + + "--displacement will add this value to the position of every object loaded" + Environment.NewLine + + "--force-terrain forces the loading of terrain from the oar (undoes suppression done by --merge)" + Environment.NewLine + + "--force-parcels forces the loading of parcels from the oar (undoes suppression done by --merge)" + Environment.NewLine + + "--rotation specified rotation to be applied to the oar. Specified in degrees." + Environment.NewLine + + "--rotation-center Location (relative to original OAR) to apply rotation. Default is <128,128,0>" + Environment.NewLine + "The path can be either a filesystem location or a URI." + " If this is not given then the command looks for an OAR named region.oar in the current directory.", LoadOar); diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs index 6f6896680b..23008a0d23 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs @@ -177,13 +177,13 @@ namespace OpenSim.Region.CoreModules.World.Archiver m_errorMessage = String.Empty; m_merge = options.ContainsKey("merge"); - m_forceTerrain = options.ContainsKey("forceTerrain"); - m_forceParcels = options.ContainsKey("forceParcels"); + m_forceTerrain = options.ContainsKey("force-terrain"); + m_forceParcels = options.ContainsKey("force-parcels"); m_skipAssets = options.ContainsKey("skipAssets"); m_requestId = requestId; m_displacement = options.ContainsKey("displacement") ? (Vector3)options["displacement"] : Vector3.Zero; m_rotation = options.ContainsKey("rotation") ? (float)options["rotation"] : 0f; - m_rotationCenter = options.ContainsKey("rotationCenter") ? (Vector3)options["rotationCenter"] + m_rotationCenter = options.ContainsKey("rotation-center") ? (Vector3)options["rotation-center"] : new Vector3(scene.RegionInfo.RegionSizeX / 2f, scene.RegionInfo.RegionSizeY / 2f, 0f); // Zero can never be a valid user id diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs index 6fbac4c82a..9fa1fbd4e1 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs @@ -113,8 +113,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver OptionSet options = new OptionSet(); options.Add("m|merge", delegate (string v) { mergeOar = (v != null); }); options.Add("s|skip-assets", delegate (string v) { skipAssets = (v != null); }); - options.Add("forceterrain", delegate (string v) { forceTerrain = (v != null); }); - options.Add("forceparcels", delegate (string v) { forceParcels = (v != null); }); + options.Add("force-terrain", delegate (string v) { forceTerrain = (v != null); }); + options.Add("force-parcels", delegate (string v) { forceParcels = (v != null); }); options.Add("displacement=", delegate (string v) { try { @@ -141,7 +141,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver // Convert to radians for internals rotation = Util.Clamp(rotation, -359f, 359f) / 180f * (float)Math.PI; }); - options.Add("rotationcenter=", delegate (string v) { + options.Add("rotation-center=", delegate (string v) { try { rotationCenter = v == null ? Vector3.Zero : Vector3.Parse(v); @@ -149,7 +149,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver catch { m_log.ErrorFormat("[ARCHIVER MODULE] failure parsing rotation displacement"); - m_log.ErrorFormat("[ARCHIVER MODULE] Must be represented as vector3: --rotationcenter \"<128,128,0>\""); + m_log.ErrorFormat("[ARCHIVER MODULE] Must be represented as vector3: --rotation-center \"<128,128,0>\""); return; } }); @@ -174,11 +174,11 @@ namespace OpenSim.Region.CoreModules.World.Archiver Dictionary archiveOptions = new Dictionary(); if (mergeOar) archiveOptions.Add("merge", null); if (skipAssets) archiveOptions.Add("skipAssets", null); - if (forceTerrain) archiveOptions.Add("forceTerrain", null); - if (forceParcels) archiveOptions.Add("forceParcels", null); + if (forceTerrain) archiveOptions.Add("force-terrain", null); + if (forceParcels) archiveOptions.Add("force-parcels", null); archiveOptions.Add("displacement", displacement); archiveOptions.Add("rotation", rotation); - archiveOptions.Add("rotationCenter", rotationCenter); + archiveOptions.Add("rotation-center", rotationCenter); if (mainParams.Count > 2) {