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.0.8.0.3
parent
9c97fb8e12
commit
2a4dd34616
|
@ -267,18 +267,18 @@ namespace OpenSim
|
|||
|
||||
m_console.Commands.AddCommand("Archiving", false, "load oar",
|
||||
"load oar [--merge] [--skip-assets]"
|
||||
+ " [--forceterrain] [--forceparcels]"
|
||||
+ " [--rotation degrees] [--rotationCenter \"<x,y,z>\"]"
|
||||
+ " [--force-terrain] [--force-parcels]"
|
||||
+ " [--rotation degrees] [--rotation-center \"<x,y,z>\"]"
|
||||
+ " [--displacement \"<x,y,z>\"]"
|
||||
+ " [<OAR path>]",
|
||||
"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
|
||||
+ "--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
|
||||
+ "--rotationcenter Location (relative to original OAR) to apply rotation. Default is <128,128,0>" + 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);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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<float>(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<string, object> archiveOptions = new Dictionary<string, object>();
|
||||
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)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue