Applying patches from [LIBOMV-288] to completely redo the InventoryManager system, hopefully for great justice
git-svn-id: http://libopenmetaverse.googlecode.com/svn/trunk@2021 52acb1d6-8a22-11de-b505-999d5b087335
This commit is contained in:
@@ -240,7 +240,7 @@ namespace OpenMetaverse.TestClient
|
||||
DirectoryInfo di = new DirectoryInfo(args[1]);
|
||||
|
||||
// recurse on the root folder into the entire inventory
|
||||
BackupFolder(Client.Inventory.Store.RootNode, di.FullName);
|
||||
BackupFolder(Client.InventoryStore.RootFolder, di.FullName);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -248,41 +248,42 @@ namespace OpenMetaverse.TestClient
|
||||
/// </summary>
|
||||
/// <param name="folder">The current leaf in the inventory tree</param>
|
||||
/// <param name="sPathSoFar">path so far, in the form @"c:\here" -- this needs to be "clean" for the current filesystem</param>
|
||||
private void BackupFolder(InventoryNode folder, string sPathSoFar)
|
||||
private void BackupFolder(InventoryFolder folder, string sPathSoFar)
|
||||
{
|
||||
StringBuilder sbRequests = new StringBuilder();
|
||||
|
||||
// FIXME:
|
||||
//Client.Inventory.RequestFolderContents(folder.Data.UUID, Client.Self.AgentID, true, true, false,
|
||||
// InventorySortOrder.ByName);
|
||||
|
||||
if (folder.IsStale)
|
||||
folder.DownloadContents(TimeSpan.FromSeconds(10));
|
||||
|
||||
// first scan this folder for text
|
||||
foreach (InventoryNode iNode in folder.Nodes.Values)
|
||||
|
||||
foreach (InventoryBase ib in folder)
|
||||
{
|
||||
if (BackupWorker.CancellationPending)
|
||||
return;
|
||||
if (iNode.Data is OpenMetaverse.InventoryItem)
|
||||
if (ib is InventoryItem)
|
||||
{
|
||||
InventoryItem ii = iNode.Data as InventoryItem;
|
||||
if (ii.AssetType == AssetType.LSLText || ii.AssetType == AssetType.Notecard)
|
||||
InventoryItem ii = ib as InventoryItem;
|
||||
if (ii.Data.AssetType == AssetType.LSLText || ii.Data.AssetType == AssetType.Notecard)
|
||||
{
|
||||
// check permissions on scripts
|
||||
if (ii.AssetType == AssetType.LSLText)
|
||||
if (ii.Data.AssetType == AssetType.LSLText)
|
||||
{
|
||||
if ((ii.Permissions.OwnerMask & PermissionMask.Modify) == PermissionMask.None)
|
||||
if ((ii.Data.Permissions.OwnerMask & PermissionMask.Modify) == PermissionMask.None)
|
||||
{
|
||||
// skip this one
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
string sExtension = (ii.AssetType == AssetType.LSLText) ? ".lsl" : ".txt";
|
||||
string sExtension = (ii.Data.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);
|
||||
QueuedDownloadInfo qdi = new QueuedDownloadInfo(sPath, ii.Data.AssetUUID, ii.UUID, UUID.Zero,
|
||||
Client.Self.AgentID, ii.Data.AssetType);
|
||||
|
||||
// add it to the queue
|
||||
lock (PendingDownloads)
|
||||
@@ -295,12 +296,12 @@ namespace OpenMetaverse.TestClient
|
||||
}
|
||||
|
||||
// now run any subfolders
|
||||
foreach (InventoryNode i in folder.Nodes.Values)
|
||||
foreach (InventoryBase ib in folder)
|
||||
{
|
||||
if (BackupWorker.CancellationPending)
|
||||
return;
|
||||
else if (i.Data is OpenMetaverse.InventoryFolder)
|
||||
BackupFolder(i, sPathSoFar + @"\" + MakeValid(i.Data.Name.Trim()));
|
||||
else if (ib is InventoryFolder)
|
||||
BackupFolder(ib as InventoryFolder, sPathSoFar + @"\" + MakeValid(ib.Name.Trim()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user