From c04899b60ab15c7614108ac61fbf1f22fccab5a7 Mon Sep 17 00:00:00 2001 From: MW Date: Sat, 15 Mar 2008 12:53:03 +0000 Subject: Part 2 of fixing inventory for client 1.19.1 (RC), inventory items should now show up. Most likely still some problems and most like needs some more work (and still a couple of things to finish off). --- .../Cache/UserProfileCacheService.cs | 60 ++++++++++++++++++++++ 1 file changed, 60 insertions(+) (limited to 'OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs') diff --git a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs index 455f722..b066fdc 100644 --- a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs +++ b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs @@ -254,6 +254,66 @@ namespace OpenSim.Framework.Communications.Cache folderID, remoteClient.Name); } + public List HandleFetchInventoryDescendentsCAPS(LLUUID agentID, LLUUID folderID, LLUUID ownerID, + bool fetchFolders, bool fetchItems, int sortOrder) + { + // XXX We're not handling sortOrder yet! + // with CAPS we are only return items in the folders at the moment + // need to find the format that sub folder details are sent in + // if (fetchItems) + // { + InventoryFolderImpl fold = null; + if (folderID == libraryRoot.folderID) + { + return libraryRoot.RequestListOfItems(); + } + + if ((fold = libraryRoot.HasSubFolder(folderID)) != null) + { + return fold.RequestListOfItems(); + } + + CachedUserInfo userProfile; + if (m_userProfiles.TryGetValue(agentID, out userProfile)) + { + if (userProfile.RootFolder != null) + { + if (userProfile.RootFolder.folderID == folderID) + { + return userProfile.RootFolder.RequestListOfItems(); + } + else + { + if ((fold = userProfile.RootFolder.HasSubFolder(folderID)) != null) + { + return fold.RequestListOfItems(); + } + } + } + else + { + m_log.ErrorFormat("[INVENTORYCACHE]: Could not find root folder for user {0}", agentID.ToString()); + + return new List(); ; + } + } + else + { + m_log.ErrorFormat("[INVENTORYCACHE]: " + + "Could not find user profile for {0} for folder {1}", + agentID.ToString(), folderID); + return new List(); + } + + // If we've reached this point then we couldn't find the folder, even though the client thinks + // it exists + m_log.ErrorFormat("[INVENTORYCACHE]: " + + "Could not find folder {0} for user {1}", + folderID, agentID.ToString()); + // } + return new List(); + } + public void HandlePurgeInventoryDescendents(IClientAPI remoteClient, LLUUID folderID) { // m_log.InfoFormat("[INVENTORYCACHE]: Purging folder {0} for {1} uuid {2}", -- cgit v1.1