From f81e289a1bc28b85d5e05a8549f9796f72d454ac Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 21 Jul 2013 14:34:43 -0700 Subject: Add the Current Outfit folder as an available folder in the SuitcaseInventory. --- .../HypergridService/HGSuitcaseInventoryService.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'OpenSim/Services/HypergridService') diff --git a/OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs b/OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs index 2567c8f..06c5b89 100644 --- a/OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs +++ b/OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs @@ -493,6 +493,18 @@ namespace OpenSim.Services.HypergridService return null; } + private XInventoryFolder GetCurrentOutfitXFolder(UUID userID) + { + XInventoryFolder[] folders = m_Database.GetFolders( + new string[] { "agentID", "type" }, + new string[] { userID.ToString(), ((int)AssetType.CurrentOutfitFolder).ToString() }); + + if (folders.Length == 0) + return null; + + return folders[0]; + } + private XInventoryFolder GetSuitcaseXFolder(UUID principalID) { // Warp! Root folder for travelers @@ -531,6 +543,7 @@ namespace OpenSim.Services.HypergridService if (m_SuitcaseTrees.TryGetValue(principalID, out t)) return t; + // Get the tree of the suitcase folder t = GetFolderTreeRecursive(folder); m_SuitcaseTrees.AddOrUpdate(principalID, t, 5*60); // 5minutes return t; @@ -577,6 +590,9 @@ namespace OpenSim.Services.HypergridService List tree = new List(); tree.Add(suitcase); // Warp! the tree is the real root folder plus the children of the suitcase folder tree.AddRange(GetFolderTree(principalID, suitcase.folderID)); + // Also add the Current Outfit folder to the list of available folders + tree.Add(GetCurrentOutfitXFolder(principalID)); + XInventoryFolder f = tree.Find(delegate(XInventoryFolder fl) { if (fl.folderID == folderID) return true; -- cgit v1.1 From df63bfafefe431faf21ec1c52dbff78977f971e6 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 21 Jul 2013 14:39:50 -0700 Subject: Better version of previous commit --- OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'OpenSim/Services/HypergridService') diff --git a/OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs b/OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs index 06c5b89..0601ece 100644 --- a/OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs +++ b/OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs @@ -495,9 +495,13 @@ namespace OpenSim.Services.HypergridService private XInventoryFolder GetCurrentOutfitXFolder(UUID userID) { + XInventoryFolder root = GetRootXFolder(userID); + if (root == null) + return null; + XInventoryFolder[] folders = m_Database.GetFolders( - new string[] { "agentID", "type" }, - new string[] { userID.ToString(), ((int)AssetType.CurrentOutfitFolder).ToString() }); + new string[] { "agentID", "type", "parentFolderID" }, + new string[] { userID.ToString(), ((int)AssetType.CurrentOutfitFolder).ToString(), root.folderID.ToString() }); if (folders.Length == 0) return null; -- cgit v1.1