Misc cleanup

This commit is contained in:
Cinder Biscuits
2019-06-08 17:58:54 -05:00
parent 50542975ab
commit 9e1fa3f882
37 changed files with 112 additions and 178 deletions

View File

@@ -255,39 +255,33 @@ namespace OpenMetaverse.TestClient
// first scan this folder for text
foreach (InventoryNode iNode in folder.Nodes.Values)
{
if (BackupWorker.CancellationPending)
return;
if (iNode.Data is OpenMetaverse.InventoryItem)
if (BackupWorker.CancellationPending) return;
if (!(iNode.Data is InventoryItem ii)) continue;
if (ii.AssetType != AssetType.LSLText && ii.AssetType != AssetType.Notecard) continue;
// check permissions on scripts
if (ii.AssetType == AssetType.LSLText)
{
InventoryItem ii = iNode.Data as InventoryItem;
if (ii.AssetType == AssetType.LSLText || ii.AssetType == AssetType.Notecard)
if ((ii.Permissions.OwnerMask & PermissionMask.Modify) == PermissionMask.None)
{
// check permissions on scripts
if (ii.AssetType == AssetType.LSLText)
{
if ((ii.Permissions.OwnerMask & PermissionMask.Modify) == PermissionMask.None)
{
// skip this one
continue;
}
}
string sExtension = (ii.AssetType == AssetType.LSLText) ? ".lsl" : ".txt";
// make the output file
string sPath = sPathSoFar + @"\" + MakeValid(ii.Name.Trim()) + sExtension;
// create the new qdi
QueuedDownloadInfo qdi = new QueuedDownloadInfo(sPath, ii.AssetUUID, iNode.Data.UUID, UUID.Zero,
Client.Self.AgentID, ii.AssetType);
// add it to the queue
lock (PendingDownloads)
{
TextItemsFound++;
PendingDownloads.Enqueue(qdi);
}
// skip this one
continue;
}
}
string sExtension = (ii.AssetType == AssetType.LSLText) ? ".lsl" : ".txt";
// make the output file
string sPath = sPathSoFar + @"\" + MakeValid(ii.Name.Trim()) + sExtension;
// create the new qdi
QueuedDownloadInfo qdi = new QueuedDownloadInfo(sPath, ii.AssetUUID, ii.UUID, UUID.Zero,
Client.Self.AgentID, ii.AssetType);
// add it to the queue
lock (PendingDownloads)
{
TextItemsFound++;
PendingDownloads.Enqueue(qdi);
}
}
// now run any subfolders