diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs index 7e57275..c5cffa3 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs | |||
@@ -161,18 +161,26 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
161 | return item; | 161 | return item; |
162 | } | 162 | } |
163 | 163 | ||
164 | public void Execute() | 164 | /// <summary> |
165 | /// Execute the request | ||
166 | /// </summary> | ||
167 | /// <returns> | ||
168 | /// A list of the inventory nodes loaded. If folders were loaded then only the root folders are | ||
169 | /// returned | ||
170 | /// </returns> | ||
171 | public List<InventoryNodeBase> Execute() | ||
165 | { | 172 | { |
166 | string filePath = "ERROR"; | 173 | string filePath = "ERROR"; |
167 | int successfulAssetRestores = 0; | 174 | int successfulAssetRestores = 0; |
168 | int failedAssetRestores = 0; | 175 | int failedAssetRestores = 0; |
169 | int successfulItemRestores = 0; | 176 | int successfulItemRestores = 0; |
177 | List<InventoryNodeBase> nodesLoaded = new List<InventoryNodeBase>(); | ||
170 | 178 | ||
171 | UserProfileData userProfile = commsManager.UserService.GetUserProfile(m_firstName, m_lastName); | 179 | UserProfileData userProfile = commsManager.UserService.GetUserProfile(m_firstName, m_lastName); |
172 | if (null == userProfile) | 180 | if (null == userProfile) |
173 | { | 181 | { |
174 | m_log.ErrorFormat("[INVENTORY ARCHIVER]: Failed to find user {0} {1}", m_firstName, m_lastName); | 182 | m_log.ErrorFormat("[INVENTORY ARCHIVER]: Failed to find user {0} {1}", m_firstName, m_lastName); |
175 | return; | 183 | return nodesLoaded; |
176 | } | 184 | } |
177 | 185 | ||
178 | CachedUserInfo userInfo = commsManager.UserProfileCacheService.GetUserDetails(userProfile.ID); | 186 | CachedUserInfo userInfo = commsManager.UserProfileCacheService.GetUserDetails(userProfile.ID); |
@@ -182,7 +190,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
182 | "[INVENTORY ARCHIVER]: Failed to find user info for {0} {1} {2}", | 190 | "[INVENTORY ARCHIVER]: Failed to find user info for {0} {1} {2}", |
183 | m_firstName, m_lastName, userProfile.ID); | 191 | m_firstName, m_lastName, userProfile.ID); |
184 | 192 | ||
185 | return; | 193 | return nodesLoaded; |
186 | } | 194 | } |
187 | 195 | ||
188 | if (!userInfo.HasReceivedInventory) | 196 | if (!userInfo.HasReceivedInventory) |
@@ -191,7 +199,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
191 | "[INVENTORY ARCHIVER]: Have not yet received inventory info for user {0} {1} {2}", | 199 | "[INVENTORY ARCHIVER]: Have not yet received inventory info for user {0} {1} {2}", |
192 | m_firstName, m_lastName, userProfile.ID); | 200 | m_firstName, m_lastName, userProfile.ID); |
193 | 201 | ||
194 | return; | 202 | return nodesLoaded; |
195 | } | 203 | } |
196 | 204 | ||
197 | InventoryFolderImpl inventoryFolder = userInfo.RootFolder.FindFolderByPath(m_invPath); | 205 | InventoryFolderImpl inventoryFolder = userInfo.RootFolder.FindFolderByPath(m_invPath); |
@@ -201,7 +209,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
201 | // TODO: Later on, automatically create this folder if it does not exist | 209 | // TODO: Later on, automatically create this folder if it does not exist |
202 | m_log.ErrorFormat("[INVENTORY ARCHIVER]: Inventory path {0} does not exist", m_invPath); | 210 | m_log.ErrorFormat("[INVENTORY ARCHIVER]: Inventory path {0} does not exist", m_invPath); |
203 | 211 | ||
204 | return; | 212 | return nodesLoaded; |
205 | } | 213 | } |
206 | 214 | ||
207 | archive = new TarArchiveReader(m_loadStream); | 215 | archive = new TarArchiveReader(m_loadStream); |
@@ -236,6 +244,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
236 | 244 | ||
237 | userInfo.AddItem(item); | 245 | userInfo.AddItem(item); |
238 | successfulItemRestores++; | 246 | successfulItemRestores++; |
247 | nodesLoaded.Add(item); | ||
239 | } | 248 | } |
240 | } | 249 | } |
241 | } | 250 | } |
@@ -244,6 +253,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
244 | 253 | ||
245 | m_log.DebugFormat("[INVENTORY ARCHIVER]: Restored {0} assets", successfulAssetRestores); | 254 | m_log.DebugFormat("[INVENTORY ARCHIVER]: Restored {0} assets", successfulAssetRestores); |
246 | m_log.InfoFormat("[INVENTORY ARCHIVER]: Restored {0} items", successfulItemRestores); | 255 | m_log.InfoFormat("[INVENTORY ARCHIVER]: Restored {0} items", successfulItemRestores); |
256 | |||
257 | return nodesLoaded; | ||
247 | } | 258 | } |
248 | 259 | ||
249 | /// <summary> | 260 | /// <summary> |