From 8a8c89a0f32b528bd588715bdbfc875c852e7187 Mon Sep 17 00:00:00 2001 From: Brian McBee Date: Sat, 15 Dec 2007 04:57:14 +0000 Subject: Grid Inventory feature upgrade: renaming folders should now be correct, subfolders work, moving folders works. Tested only in MYSQL, but may work in MSSQL and sqlite. Probably not working in standalone mode. --- .../Communications/Cache/InventoryFolderImpl.cs | 10 +++++++ .../Cache/UserProfileCacheService.cs | 32 +++++++++++++++++----- 2 files changed, 35 insertions(+), 7 deletions(-) (limited to 'OpenSim/Framework/Communications/Cache') diff --git a/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs b/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs index c07a15b..1d2c920 100644 --- a/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs +++ b/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs @@ -142,5 +142,15 @@ namespace OpenSim.Framework.Communications.Cache } return itemList; } + + public List RequestListOfFolders() + { + List folderList = new List(); + foreach (InventoryFolderBase folder in SubFolders.Values) + { + folderList.Add(folder); + } + return folderList; + } } } diff --git a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs index 32d941c..bf7f5c1 100644 --- a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs +++ b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs @@ -147,6 +147,23 @@ namespace OpenSim.Framework.Communications.Cache } } + public void HandleMoveInventoryFolder(IClientAPI remoteClient, LLUUID folderID, LLUUID parentID) + { + CachedUserInfo userProfile; + + if (m_userProfiles.TryGetValue(remoteClient.AgentId, out userProfile)) + { + if (userProfile.RootFolder != null) + { + InventoryFolderBase baseFolder = new InventoryFolderBase(); + baseFolder.agentID = remoteClient.AgentId; + baseFolder.folderID = folderID; + baseFolder.parentID = parentID; + m_parent.InventoryService.MoveInventoryFolder(remoteClient.AgentId, baseFolder); + } + } + } + /// /// Tell the client about the various child items and folders contained in the requested folder. /// @@ -163,14 +180,15 @@ namespace OpenSim.Framework.Communications.Cache if (folderID == libraryRoot.folderID) { remoteClient.SendInventoryFolderDetails(libraryRoot.agentID, libraryRoot.folderID, - libraryRoot.RequestListOfItems(), libraryRoot.SubFoldersCount); + libraryRoot.RequestListOfItems(), libraryRoot.RequestListOfFolders(), libraryRoot.SubFoldersCount); return; } if ((fold = libraryRoot.HasSubFolder(folderID)) != null) { - remoteClient.SendInventoryFolderDetails(libraryRoot.agentID, folderID, fold.RequestListOfItems(), fold.SubFoldersCount); + System.Console.WriteLine("fetching librarysubfolder"); + remoteClient.SendInventoryFolderDetails(libraryRoot.agentID, folderID, fold.RequestListOfItems(), fold.RequestListOfFolders(), fold.SubFoldersCount); return; } @@ -182,19 +200,19 @@ namespace OpenSim.Framework.Communications.Cache { if (userProfile.RootFolder.folderID == folderID) { + System.Console.Write("fetching root folder"); if (fetchItems) { remoteClient.SendInventoryFolderDetails(remoteClient.AgentId, folderID, - userProfile.RootFolder.RequestListOfItems(), userProfile.RootFolder.SubFoldersCount); + userProfile.RootFolder.RequestListOfItems(), userProfile.RootFolder.RequestListOfFolders(), userProfile.RootFolder.SubFoldersCount); } } else { - InventoryFolderImpl folder = userProfile.RootFolder.HasSubFolder(folderID); - - if (fetchItems && folder != null) + if ((fold = userProfile.RootFolder.HasSubFolder(folderID)) != null) { - remoteClient.SendInventoryFolderDetails(remoteClient.AgentId, folderID, folder.RequestListOfItems(), folder.SubFoldersCount); + remoteClient.SendInventoryFolderDetails(remoteClient.AgentId, folderID, fold.RequestListOfItems(), fold.RequestListOfFolders(), fold.SubFoldersCount); + return; } } } -- cgit v1.1