Modifications to previous IAR commits to bring them more inline with existing OpenSim code conventions. Also include new IAR save switch in console help print out.

This commit is contained in:
AliciaRaven
2014-09-13 04:25:31 +01:00
committed by Justin Clark-Casey (justincc)
parent 5bc3bbbcf3
commit 1e22091193
4 changed files with 24 additions and 21 deletions

View File

@@ -57,7 +57,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
public bool SaveAssets { get; set; }
/// <summary>
/// Determine whether this archive will filter content based on inventory permissions. Default is false
/// Determines which items will be included in the archive, according to their permissions.
/// Default is null, meaning no permission checks.
/// </summary>
public string FilterContent { get; set; }
@@ -139,7 +140,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
m_assetGatherer = new UuidGatherer(m_scene.AssetService);
SaveAssets = true;
FilterContent = string.Empty;
FilterContent = null;
}
protected void ReceivedAllAssets(ICollection<UUID> assetsFoundUuids, ICollection<UUID> assetsNotFoundUuids, bool timedOut)
@@ -287,7 +288,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
/// <returns>Whether the user is allowed to export the object to an IAR</returns>
private bool CanUserArchiveObject(UUID UserID, InventoryItemBase InvItem)
{
if (FilterContent == string.Empty)
if (FilterContent == null)
return true;// Default To Allow Export
bool permitted = true;
@@ -317,10 +318,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
SaveAssets = false;
// Set Permission filter if flag is set
if (options.ContainsKey("perm"))
if (options.ContainsKey("checkPermissions"))
{
Object temp;
if (options.TryGetValue("perm", out temp))
if (options.TryGetValue("checkPermissions", out temp))
FilterContent = temp.ToString().ToUpper();
}

View File

@@ -141,7 +141,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
+ "-e|--exclude=<name/uuid> don't save the inventory item in archive" + Environment.NewLine
+ "-f|--excludefolder=<folder/uuid> don't save contents of the folder in archive" + Environment.NewLine
+ "-v|--verbose extra debug messages.\n"
+ "--noassets stops assets being saved to the IAR.",
+ "--noassets stops assets being saved to the IAR."
+ "--perm=<permissions> stops items with insufficient permissions from being saved to the IAR.\n"
+ " <permissions> can contain one or more of these characters: \"C\" = Copy, \"T\" = Transfer, \"M\" = Modify.\n",
HandleSaveInvConsoleCommand);
m_aScene = scene;
@@ -455,7 +457,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
options["excludefolders"] = new List<String>();
((List<String>)options["excludefolders"]).Add(v);
});
ops.Add("perm=", delegate(string v) { options["perm"] = v; });
ops.Add("perm=", delegate(string v) { options["checkPermissions"] = v; });
List<string> mainParams = ops.Parse(cmdparams);