diff options
Diffstat (limited to 'OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs')
-rw-r--r-- | OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs | 62 |
1 files changed, 4 insertions, 58 deletions
diff --git a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs index b167682..7f911dc 100644 --- a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs +++ b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs | |||
@@ -247,7 +247,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
247 | public void HandleFetchInventoryDescendents(IClientAPI remoteClient, LLUUID folderID, LLUUID ownerID, | 247 | public void HandleFetchInventoryDescendents(IClientAPI remoteClient, LLUUID folderID, LLUUID ownerID, |
248 | bool fetchFolders, bool fetchItems, int sortOrder) | 248 | bool fetchFolders, bool fetchItems, int sortOrder) |
249 | { | 249 | { |
250 | // XXX We're not handling sortOrder yet! | 250 | // FIXME MAYBE: We're not handling sortOrder! |
251 | 251 | ||
252 | InventoryFolderImpl fold = null; | 252 | InventoryFolderImpl fold = null; |
253 | if ((fold = libraryRoot.FindFolder(folderID)) != null) | 253 | if ((fold = libraryRoot.FindFolder(folderID)) != null) |
@@ -262,68 +262,14 @@ namespace OpenSim.Framework.Communications.Cache | |||
262 | CachedUserInfo userProfile; | 262 | CachedUserInfo userProfile; |
263 | if (m_userProfiles.TryGetValue(remoteClient.AgentId, out userProfile)) | 263 | if (m_userProfiles.TryGetValue(remoteClient.AgentId, out userProfile)) |
264 | { | 264 | { |
265 | // XXX: When a client crosses into a scene, their entire inventory is fetched | 265 | userProfile.SendInventoryDecendents(remoteClient, folderID, fetchFolders, fetchItems); |
266 | // asynchronously. However, if the client is logging on and does not have a cached root | ||
267 | // folder, then the root folder request usually comes in *before* the async completes, leading to | ||
268 | // inventory failure. | ||
269 | // | ||
270 | // This is a crude way of dealing with that by retrying the lookup. | ||
271 | //BUG: This should be replaced with a async event. | ||
272 | if (!userProfile.HasInventory) | ||
273 | { | ||
274 | int attempts = 5; | ||
275 | while (attempts-- > 0) | ||
276 | { | ||
277 | Thread.Sleep(2000); | ||
278 | |||
279 | if (userProfile.HasInventory) | ||
280 | { | ||
281 | break; | ||
282 | } | ||
283 | } | ||
284 | } | ||
285 | |||
286 | if (userProfile.HasInventory) | ||
287 | { | ||
288 | if ((fold = userProfile.RootFolder.FindFolder(folderID)) != null) | ||
289 | { | ||
290 | // m_log.DebugFormat( | ||
291 | // "[AGENT INVENTORY]: Found folder {0} for client {1}", | ||
292 | // folderID, remoteClient.AgentId); | ||
293 | |||
294 | remoteClient.SendInventoryFolderDetails( | ||
295 | remoteClient.AgentId, folderID, fold.RequestListOfItems(), | ||
296 | fold.RequestListOfFolders(), fetchFolders, fetchItems); | ||
297 | |||
298 | return; | ||
299 | } | ||
300 | else | ||
301 | { | ||
302 | m_log.WarnFormat( | ||
303 | "[AGENT INVENTORY]: Could not find folder {0} requested by user {1} {2}", | ||
304 | folderID, remoteClient.Name, remoteClient.AgentId); | ||
305 | } | ||
306 | } | ||
307 | else | ||
308 | { | ||
309 | m_log.ErrorFormat("[AGENT INVENTORY]: Could not find root folder for user {0}", remoteClient.Name); | ||
310 | |||
311 | return; | ||
312 | } | ||
313 | } | 266 | } |
314 | else | 267 | else |
315 | { | 268 | { |
316 | m_log.ErrorFormat( | 269 | m_log.ErrorFormat( |
317 | "[AGENT INVENTORY]: Could not find user profile for {0} {1}", | 270 | "[AGENT INVENTORY]: Could not find user profile for {0} {1}", |
318 | remoteClient.Name, remoteClient.AgentId); | 271 | remoteClient.Name, remoteClient.AgentId); |
319 | 272 | } | |
320 | return; | ||
321 | } | ||
322 | |||
323 | // If we've reached this point then we couldn't find the folder, even though the client thinks | ||
324 | // it exists | ||
325 | m_log.ErrorFormat("[AGENT INVENTORY]: Could not find folder {0} for user {1}", | ||
326 | folderID, remoteClient.Name); | ||
327 | } | 273 | } |
328 | 274 | ||
329 | /// <summary> | 275 | /// <summary> |
@@ -345,7 +291,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
345 | // "[INVENTORY CACHE]: Fetching folders ({0}), items ({1}) from {2} for agent {3}", | 291 | // "[INVENTORY CACHE]: Fetching folders ({0}), items ({1}) from {2} for agent {3}", |
346 | // fetchFolders, fetchItems, folderID, agentID); | 292 | // fetchFolders, fetchItems, folderID, agentID); |
347 | 293 | ||
348 | // XXX We're not handling sortOrder yet! | 294 | // FIXME MAYBE: We're not handling sortOrder! |
349 | 295 | ||
350 | InventoryFolderImpl fold; | 296 | InventoryFolderImpl fold; |
351 | if ((fold = libraryRoot.FindFolder(folderID)) != null) | 297 | if ((fold = libraryRoot.FindFolder(folderID)) != null) |