diff options
author | AliciaRaven | 2014-09-06 20:23:40 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2014-09-23 00:04:53 +0100 |
commit | 5bc3bbbcf3e7df23db3e3e0410266ba72a1a1e14 (patch) | |
tree | 810e7e39cb5dfa5ee77f40f3c1ae3eae2a9175fd /OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs | |
parent | Change existing IAR save to use UUID for its callback reference instead of Gu... (diff) | |
download | opensim-SC_OLD-5bc3bbbcf3e7df23db3e3e0410266ba72a1a1e14.zip opensim-SC_OLD-5bc3bbbcf3e7df23db3e3e0410266ba72a1a1e14.tar.gz opensim-SC_OLD-5bc3bbbcf3e7df23db3e3e0410266ba72a1a1e14.tar.bz2 opensim-SC_OLD-5bc3bbbcf3e7df23db3e3e0410266ba72a1a1e14.tar.xz |
Add an event callback for loading IAR files. The callback for creating them already existed but not for loading. This is of interest for use by region modules. Also includes reporting numbers of items saved and items filtered to the completed log printout.
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs index 0605db5..401a238 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs | |||
@@ -61,6 +61,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
61 | /// </summary> | 61 | /// </summary> |
62 | public string FilterContent { get; set; } | 62 | public string FilterContent { get; set; } |
63 | 63 | ||
64 | /// <summary> | ||
65 | /// Counter for inventory items saved to archive for passing to compltion event | ||
66 | /// </summary> | ||
67 | public int CountItems { get; set; } | ||
68 | |||
69 | /// <summary> | ||
70 | /// Counter for inventory items skipped due to permission filter option for passing to compltion event | ||
71 | /// </summary> | ||
72 | public int CountFiltered { get; set; } | ||
73 | |||
64 | /// <value> | 74 | /// <value> |
65 | /// Used to select all inventory nodes in a folder but not the folder itself | 75 | /// Used to select all inventory nodes in a folder but not the folder itself |
66 | /// </value> | 76 | /// </value> |
@@ -158,7 +168,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
158 | } | 168 | } |
159 | 169 | ||
160 | m_module.TriggerInventoryArchiveSaved( | 170 | m_module.TriggerInventoryArchiveSaved( |
161 | m_id, succeeded, m_userInfo, m_invPath, m_saveStream, reportedException); | 171 | m_id, succeeded, m_userInfo, m_invPath, m_saveStream, reportedException, CountItems, CountFiltered); |
162 | } | 172 | } |
163 | 173 | ||
164 | protected void SaveInvItem(InventoryItemBase inventoryItem, string path, Dictionary<string, object> options, IUserAccountService userAccountService) | 174 | protected void SaveInvItem(InventoryItemBase inventoryItem, string path, Dictionary<string, object> options, IUserAccountService userAccountService) |
@@ -174,6 +184,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
174 | "[INVENTORY ARCHIVER]: Skipping inventory item {0} {1} at {2}", | 184 | "[INVENTORY ARCHIVER]: Skipping inventory item {0} {1} at {2}", |
175 | inventoryItem.Name, inventoryItem.ID, path); | 185 | inventoryItem.Name, inventoryItem.ID, path); |
176 | } | 186 | } |
187 | |||
188 | CountFiltered++; | ||
189 | |||
177 | return; | 190 | return; |
178 | } | 191 | } |
179 | } | 192 | } |
@@ -184,6 +197,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
184 | m_log.InfoFormat( | 197 | m_log.InfoFormat( |
185 | "[INVENTORY ARCHIVER]: Insufficient permissions, skipping inventory item {0} {1} at {2}", | 198 | "[INVENTORY ARCHIVER]: Insufficient permissions, skipping inventory item {0} {1} at {2}", |
186 | inventoryItem.Name, inventoryItem.ID, path); | 199 | inventoryItem.Name, inventoryItem.ID, path); |
200 | |||
201 | // Count Items Excluded | ||
202 | CountFiltered++; | ||
203 | |||
187 | return; | 204 | return; |
188 | } | 205 | } |
189 | 206 | ||
@@ -202,6 +219,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
202 | 219 | ||
203 | AssetType itemAssetType = (AssetType)inventoryItem.AssetType; | 220 | AssetType itemAssetType = (AssetType)inventoryItem.AssetType; |
204 | 221 | ||
222 | // Count inventory items (different to asset count) | ||
223 | CountItems++; | ||
224 | |||
205 | // Don't chase down link asset items as they actually point to their target item IDs rather than an asset | 225 | // Don't chase down link asset items as they actually point to their target item IDs rather than an asset |
206 | if (SaveAssets && itemAssetType != AssetType.Link && itemAssetType != AssetType.LinkFolder) | 226 | if (SaveAssets && itemAssetType != AssetType.Link && itemAssetType != AssetType.LinkFolder) |
207 | m_assetGatherer.GatherAssetUuids(inventoryItem.AssetID, (sbyte)inventoryItem.AssetType, m_assetUuids); | 227 | m_assetGatherer.GatherAssetUuids(inventoryItem.AssetID, (sbyte)inventoryItem.AssetType, m_assetUuids); |
@@ -363,7 +383,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
363 | // We couldn't find the path indicated | 383 | // We couldn't find the path indicated |
364 | string errorMessage = string.Format("Aborted save. Could not find inventory path {0}", m_invPath); | 384 | string errorMessage = string.Format("Aborted save. Could not find inventory path {0}", m_invPath); |
365 | Exception e = new InventoryArchiverException(errorMessage); | 385 | Exception e = new InventoryArchiverException(errorMessage); |
366 | m_module.TriggerInventoryArchiveSaved(m_id, false, m_userInfo, m_invPath, m_saveStream, e); | 386 | m_module.TriggerInventoryArchiveSaved(m_id, false, m_userInfo, m_invPath, m_saveStream, e, 0, 0); |
367 | throw e; | 387 | throw e; |
368 | } | 388 | } |
369 | 389 | ||