From a3c7c04ead1b1388d2093edf66d37edecdeccc61 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Sat, 12 Mar 2011 00:28:23 +0000 Subject: [PATCH] refactor: make boolean load indicators on load iars instance fields --- .../Archiver/InventoryArchiveReadRequest.cs | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs index 4d97c0aed4..367960c9da 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs @@ -82,6 +82,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver /// after OSP resolution (since OSP creators are only stored in the item /// protected Dictionary m_creatorIdForAssetId = new Dictionary(); + + protected bool m_controlFileLoaded; + protected bool m_assetsLoaded; + protected bool m_inventoryNodesLoaded; public InventoryArchiveReadRequest( Scene scene, UserAccount userInfo, string invPath, string loadPath, bool merge) @@ -144,24 +148,23 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver byte[] data; TarArchiveReader.TarEntryType entryType; - bool controlFileLoaded = false, assetsLoaded = false, inventoryNodesLoaded = false; while ((data = archive.ReadEntry(out filePath, out entryType)) != null) { if (filePath == ArchiveConstants.CONTROL_FILE_PATH) { LoadControlFile(filePath, data); - controlFileLoaded = true; + m_controlFileLoaded = true; } else if (filePath.StartsWith(ArchiveConstants.ASSETS_PATH)) { - if (!controlFileLoaded) + if (!m_controlFileLoaded) throw new Exception( string.Format( "The IAR you are trying to load does not list {0} before {1}. Aborting load", ArchiveConstants.CONTROL_FILE_PATH, ArchiveConstants.ASSETS_PATH)); - if (!inventoryNodesLoaded) + if (!m_inventoryNodesLoaded) throw new Exception( string.Format( "The IAR you are trying to load does not list all {0} before {1}. Aborting load", @@ -177,17 +180,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver "[INVENTORY ARCHIVER]: Loaded {0} assets...", successfulAssetRestores); - assetsLoaded = true; + m_assetsLoaded = true; } else if (filePath.StartsWith(ArchiveConstants.INVENTORY_PATH)) { - if (!controlFileLoaded) + if (!m_controlFileLoaded) throw new Exception( string.Format( "The IAR you are trying to load does not list {0} before {1}. Aborting load", ArchiveConstants.CONTROL_FILE_PATH, ArchiveConstants.INVENTORY_PATH)); - if (assetsLoaded) + if (m_assetsLoaded) throw new Exception( string.Format( "The IAR you are trying to load does not list all {0} before {1}. Aborting load", @@ -218,7 +221,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver } } - inventoryNodesLoaded = true; + m_inventoryNodesLoaded = true; } }