diff options
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs index 924d6d9..b5c0d86 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs | |||
@@ -47,7 +47,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
47 | public class InventoryArchiveWriteRequest | 47 | public class InventoryArchiveWriteRequest |
48 | { | 48 | { |
49 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 49 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
50 | 50 | ||
51 | /// <value> | 51 | /// <value> |
52 | /// Used to select all inventory nodes in a folder but not the folder itself | 52 | /// Used to select all inventory nodes in a folder but not the folder itself |
53 | /// </value> | 53 | /// </value> |
@@ -58,12 +58,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
58 | private string m_invPath; | 58 | private string m_invPath; |
59 | protected TarArchiveWriter m_archive; | 59 | protected TarArchiveWriter m_archive; |
60 | protected UuidGatherer m_assetGatherer; | 60 | protected UuidGatherer m_assetGatherer; |
61 | 61 | ||
62 | /// <value> | 62 | /// <value> |
63 | /// Used to collect the uuids of the assets that we need to save into the archive | 63 | /// Used to collect the uuids of the assets that we need to save into the archive |
64 | /// </value> | 64 | /// </value> |
65 | protected Dictionary<UUID, int> m_assetUuids = new Dictionary<UUID, int>(); | 65 | protected Dictionary<UUID, int> m_assetUuids = new Dictionary<UUID, int>(); |
66 | 66 | ||
67 | /// <value> | 67 | /// <value> |
68 | /// Used to collect the uuids of the users that we need to save into the archive | 68 | /// Used to collect the uuids of the users that we need to save into the archive |
69 | /// </value> | 69 | /// </value> |
@@ -125,16 +125,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
125 | protected void SaveInvItem(InventoryItemBase inventoryItem, string path) | 125 | protected void SaveInvItem(InventoryItemBase inventoryItem, string path) |
126 | { | 126 | { |
127 | string filename = string.Format("{0}{1}_{2}.xml", path, inventoryItem.Name, inventoryItem.ID); | 127 | string filename = string.Format("{0}{1}_{2}.xml", path, inventoryItem.Name, inventoryItem.ID); |
128 | 128 | ||
129 | // Record the creator of this item for user record purposes (which might go away soon) | 129 | // Record the creator of this item for user record purposes (which might go away soon) |
130 | m_userUuids[inventoryItem.CreatorIdAsUuid] = 1; | 130 | m_userUuids[inventoryItem.CreatorIdAsUuid] = 1; |
131 | 131 | ||
132 | InventoryItemBase saveItem = (InventoryItemBase)inventoryItem.Clone(); | 132 | InventoryItemBase saveItem = (InventoryItemBase)inventoryItem.Clone(); |
133 | saveItem.CreatorId = OspResolver.MakeOspa(saveItem.CreatorIdAsUuid, m_module.CommsManager); | 133 | saveItem.CreatorId = OspResolver.MakeOspa(saveItem.CreatorIdAsUuid, m_module.CommsManager); |
134 | 134 | ||
135 | string serialization = UserInventoryItemSerializer.Serialize(saveItem); | 135 | string serialization = UserInventoryItemSerializer.Serialize(saveItem); |
136 | m_archive.WriteFile(filename, serialization); | 136 | m_archive.WriteFile(filename, serialization); |
137 | 137 | ||
138 | m_assetGatherer.GatherAssetUuids(saveItem.AssetID, (AssetType)saveItem.AssetType, m_assetUuids); | 138 | m_assetGatherer.GatherAssetUuids(saveItem.AssetID, (AssetType)saveItem.AssetType, m_assetUuids); |
139 | } | 139 | } |
140 | 140 | ||
@@ -154,7 +154,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
154 | inventoryFolder.Name, | 154 | inventoryFolder.Name, |
155 | ArchiveConstants.INVENTORY_NODE_NAME_COMPONENT_SEPARATOR, | 155 | ArchiveConstants.INVENTORY_NODE_NAME_COMPONENT_SEPARATOR, |
156 | inventoryFolder.ID); | 156 | inventoryFolder.ID); |
157 | 157 | ||
158 | // We need to make sure that we record empty folders | 158 | // We need to make sure that we record empty folders |
159 | m_archive.WriteDir(path); | 159 | m_archive.WriteDir(path); |
160 | } | 160 | } |
@@ -225,12 +225,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
225 | } | 225 | } |
226 | 226 | ||
227 | bool foundStar = false; | 227 | bool foundStar = false; |
228 | 228 | ||
229 | // Eliminate double slashes and any leading / on the path. This might be better done within InventoryFolderImpl | 229 | // Eliminate double slashes and any leading / on the path. This might be better done within InventoryFolderImpl |
230 | // itself (possibly at a small loss in efficiency). | 230 | // itself (possibly at a small loss in efficiency). |
231 | string[] components | 231 | string[] components |
232 | = m_invPath.Split(new string[] { InventoryFolderImpl.PATH_DELIMITER }, StringSplitOptions.RemoveEmptyEntries); | 232 | = m_invPath.Split(new string[] { InventoryFolderImpl.PATH_DELIMITER }, StringSplitOptions.RemoveEmptyEntries); |
233 | 233 | ||
234 | int maxComponentIndex = components.Length - 1; | 234 | int maxComponentIndex = components.Length - 1; |
235 | 235 | ||
236 | // If the path terminates with a STAR then later on we want to archive all nodes in the folder but not the | 236 | // If the path terminates with a STAR then later on we want to archive all nodes in the folder but not the |
@@ -240,7 +240,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
240 | foundStar = true; | 240 | foundStar = true; |
241 | maxComponentIndex--; | 241 | maxComponentIndex--; |
242 | } | 242 | } |
243 | 243 | ||
244 | m_invPath = String.Empty; | 244 | m_invPath = String.Empty; |
245 | for (int i = 0; i <= maxComponentIndex; i++) | 245 | for (int i = 0; i <= maxComponentIndex; i++) |
246 | { | 246 | { |
@@ -296,24 +296,24 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
296 | //recurse through all dirs getting dirs and files | 296 | //recurse through all dirs getting dirs and files |
297 | SaveInvFolder(inventoryFolder, ArchiveConstants.INVENTORY_PATH, !foundStar); | 297 | SaveInvFolder(inventoryFolder, ArchiveConstants.INVENTORY_PATH, !foundStar); |
298 | } | 298 | } |
299 | 299 | ||
300 | SaveUsers(); | 300 | SaveUsers(); |
301 | new AssetsRequest(m_assetUuids.Keys, m_module.CommsManager.AssetCache, ReceivedAllAssets).Execute(); | 301 | new AssetsRequest(m_assetUuids.Keys, m_module.CommsManager.AssetCache, ReceivedAllAssets).Execute(); |
302 | } | 302 | } |
303 | 303 | ||
304 | /// <summary> | 304 | /// <summary> |
305 | /// Save information for the users that we've collected. | 305 | /// Save information for the users that we've collected. |
306 | /// </summary> | 306 | /// </summary> |
307 | protected void SaveUsers() | 307 | protected void SaveUsers() |
308 | { | 308 | { |
309 | m_log.InfoFormat("[INVENTORY ARCHIVER]: Saving user information for {0} users", m_userUuids.Count); | 309 | m_log.InfoFormat("[INVENTORY ARCHIVER]: Saving user information for {0} users", m_userUuids.Count); |
310 | 310 | ||
311 | foreach (UUID creatorId in m_userUuids.Keys) | 311 | foreach (UUID creatorId in m_userUuids.Keys) |
312 | { | 312 | { |
313 | // Record the creator of this item | 313 | // Record the creator of this item |
314 | CachedUserInfo creator | 314 | CachedUserInfo creator |
315 | = m_module.CommsManager.UserProfileCacheService.GetUserDetails(creatorId); | 315 | = m_module.CommsManager.UserProfileCacheService.GetUserDetails(creatorId); |
316 | 316 | ||
317 | if (creator != null) | 317 | if (creator != null) |
318 | { | 318 | { |
319 | m_archive.WriteFile( | 319 | m_archive.WriteFile( |