diff options
author | Justin Clarke Casey | 2009-02-12 19:54:19 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2009-02-12 19:54:19 +0000 |
commit | 9177f2871086ba211c9c84490f322cfe8ad74494 (patch) | |
tree | 27771a64d3642832cf48b8ff27ed62c79fd2c408 /OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs | |
parent | large scale fix for svn props after "the great refactor" (diff) | |
download | opensim-SC_OLD-9177f2871086ba211c9c84490f322cfe8ad74494.zip opensim-SC_OLD-9177f2871086ba211c9c84490f322cfe8ad74494.tar.gz opensim-SC_OLD-9177f2871086ba211c9c84490f322cfe8ad74494.tar.bz2 opensim-SC_OLD-9177f2871086ba211c9c84490f322cfe8ad74494.tar.xz |
* Make it possible to load and save inventory archives while a user is not logged in on standalone mode but not on grid mode
* No user functionality yet
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs | 64 |
1 files changed, 38 insertions, 26 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs index c00c80f..d916eba 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs | |||
@@ -183,42 +183,54 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
183 | InventoryFolderImpl inventoryFolder = null; | 183 | InventoryFolderImpl inventoryFolder = null; |
184 | InventoryItemBase inventoryItem = null; | 184 | InventoryItemBase inventoryItem = null; |
185 | 185 | ||
186 | if (m_userInfo.HasReceivedInventory) | 186 | if (!m_userInfo.HasReceivedInventory) |
187 | { | 187 | { |
188 | // Eliminate double slashes and any leading / on the path. This might be better done within InventoryFolderImpl | 188 | // If the region server has access to the user admin service (by which users are created), |
189 | // itself (possibly at a small loss in efficiency). | 189 | // then we'll assume that it's okay to fiddle with the user's inventory even if they are not on the |
190 | string[] components | 190 | // server. |
191 | = m_invPath.Split(new string[] { InventoryFolderImpl.PATH_DELIMITER }, StringSplitOptions.RemoveEmptyEntries); | 191 | // |
192 | m_invPath = String.Empty; | 192 | // FIXME: FetchInventory should probably be assumed to by async anyway, since even standalones might |
193 | foreach (string c in components) | 193 | // use a remote inventory service, though this is vanishingly rare at the moment. |
194 | if (null == commsManager.UserAdminService) | ||
194 | { | 195 | { |
195 | m_invPath += c + InventoryFolderImpl.PATH_DELIMITER; | 196 | m_log.ErrorFormat( |
196 | } | 197 | "[INVENTORY ARCHIVER]: Have not yet received inventory info for user {0} {1}", |
198 | m_userInfo.UserProfile.Name, m_userInfo.UserProfile.ID); | ||
197 | 199 | ||
198 | // Annoyingly Split actually returns the original string if the input string consists only of delimiters | 200 | return; |
199 | // Therefore if we still start with a / after the split, then we need the root folder | ||
200 | if (m_invPath.Length == 0) | ||
201 | { | ||
202 | inventoryFolder = m_userInfo.RootFolder; | ||
203 | } | 201 | } |
204 | else | 202 | else |
205 | { | 203 | { |
206 | m_invPath = m_invPath.Remove(m_invPath.LastIndexOf(InventoryFolderImpl.PATH_DELIMITER)); | 204 | m_userInfo.FetchInventory(); |
207 | inventoryFolder = m_userInfo.RootFolder.FindFolderByPath(m_invPath); | ||
208 | } | 205 | } |
206 | } | ||
207 | |||
208 | // Eliminate double slashes and any leading / on the path. This might be better done within InventoryFolderImpl | ||
209 | // itself (possibly at a small loss in efficiency). | ||
210 | string[] components | ||
211 | = m_invPath.Split(new string[] { InventoryFolderImpl.PATH_DELIMITER }, StringSplitOptions.RemoveEmptyEntries); | ||
212 | m_invPath = String.Empty; | ||
213 | foreach (string c in components) | ||
214 | { | ||
215 | m_invPath += c + InventoryFolderImpl.PATH_DELIMITER; | ||
216 | } | ||
209 | 217 | ||
210 | // The path may point to an item instead | 218 | // Annoyingly Split actually returns the original string if the input string consists only of delimiters |
211 | if (inventoryFolder == null) | 219 | // Therefore if we still start with a / after the split, then we need the root folder |
212 | { | 220 | if (m_invPath.Length == 0) |
213 | inventoryItem = m_userInfo.RootFolder.FindItemByPath(m_invPath); | 221 | { |
214 | } | 222 | inventoryFolder = m_userInfo.RootFolder; |
215 | } | 223 | } |
216 | else | 224 | else |
217 | { | 225 | { |
218 | m_log.ErrorFormat( | 226 | m_invPath = m_invPath.Remove(m_invPath.LastIndexOf(InventoryFolderImpl.PATH_DELIMITER)); |
219 | "[INVENTORY ARCHIVER]: Have not yet received inventory info for user {0} {1}", | 227 | inventoryFolder = m_userInfo.RootFolder.FindFolderByPath(m_invPath); |
220 | m_userInfo.UserProfile.Name, m_userInfo.UserProfile.ID); | 228 | } |
221 | return; | 229 | |
230 | // The path may point to an item instead | ||
231 | if (inventoryFolder == null) | ||
232 | { | ||
233 | inventoryItem = m_userInfo.RootFolder.FindItemByPath(m_invPath); | ||
222 | } | 234 | } |
223 | 235 | ||
224 | if (null == inventoryFolder) | 236 | if (null == inventoryFolder) |