From 0a47a75b8894942e43a132c8479b1b17e7d4e8b5 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Fri, 28 Mar 2008 19:35:01 +0000 Subject: * Send full inventory folder skeleton to standalone client logins rather than just the root child folders * This may resolve some current problems with non root child folders on standalone installations. * A fix for the same problem in grid mode will come soon. --- .../Communications/Cache/CachedUserInfo.cs | 5 +++++ .../Cache/UserProfileCacheService.cs | 16 +++++++-------- .../Framework/Communications/IInventoryServices.cs | 8 ++++++++ .../Communications/InventoryServiceBase.cs | 24 ++++++++++++++++++++++ .../Framework/Communications/UserManagerBase.cs | 3 ++- 5 files changed, 46 insertions(+), 10 deletions(-) (limited to 'OpenSim/Framework/Communications') diff --git a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs index 077a61d..59e5b6e 100644 --- a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs +++ b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs @@ -31,6 +31,9 @@ namespace OpenSim.Framework.Communications.Cache { public class CachedUserInfo { + private static readonly log4net.ILog m_log + = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); + private readonly CommunicationsManager m_parentCommsManager; // Fields public InventoryFolderImpl RootFolder = null; @@ -44,6 +47,8 @@ namespace OpenSim.Framework.Communications.Cache // Methods public void FolderReceive(LLUUID userID, InventoryFolderImpl folderInfo) { + //m_log.DebugFormat("[INVENTORY CACHE]: Received folder {0} {1} for user {2}", folderInfo.name, folderInfo.folderID, userID); + if (userID == UserProfile.UUID) { if (RootFolder == null) diff --git a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs index fcfb53a..67022c7 100644 --- a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs +++ b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs @@ -72,7 +72,7 @@ namespace OpenSim.Framework.Communications.Cache } else { - m_log.ErrorFormat("[USERCACHE]: User profile for user {0} not found", userID); + m_log.ErrorFormat("[USER CACHE]: User profile for user {0} not found", userID); } } } @@ -244,15 +244,14 @@ namespace OpenSim.Framework.Communications.Cache } else { - m_log.ErrorFormat("[INVENTORYCACHE]: Could not find root folder for user {0}", remoteClient.Name); + m_log.ErrorFormat("[INVENTORY CACHE]: Could not find root folder for user {0}", remoteClient.Name); return; } } else { - m_log.ErrorFormat("[INVENTORYCACHE]: " + - "Could not find user profile for {0} for folder {1}", + m_log.ErrorFormat("[INVENTORY CACHE]: Could not find user profile for {0} for folder {1}", remoteClient.Name, folderID); return; @@ -260,8 +259,7 @@ namespace OpenSim.Framework.Communications.Cache // 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}", + m_log.ErrorFormat("[INVENTORY CACHE]: Could not find folder {0} for user {1}", folderID, remoteClient.Name); } @@ -303,14 +301,14 @@ namespace OpenSim.Framework.Communications.Cache } else { - m_log.ErrorFormat("[INVENTORYCACHE]: Could not find root folder for user {0}", agentID.ToString()); + m_log.ErrorFormat("[INVENTORY CACHE]: Could not find root folder for user {0}", agentID.ToString()); return new List(); ; } } else { - m_log.ErrorFormat("[INVENTORYCACHE]: " + + m_log.ErrorFormat("[INVENTORY CACHE]: " + "Could not find user profile for {0} for folder {1}", agentID.ToString(), folderID); return new List(); @@ -318,7 +316,7 @@ namespace OpenSim.Framework.Communications.Cache // If we've reached this point then we couldn't find the folder, even though the client thinks // it exists - m_log.ErrorFormat("[INVENTORYCACHE]: " + + m_log.ErrorFormat("[INVENTORY CACHE]: " + "Could not find folder {0} for user {1}", folderID, agentID.ToString()); // } diff --git a/OpenSim/Framework/Communications/IInventoryServices.cs b/OpenSim/Framework/Communications/IInventoryServices.cs index bb46777..d824e9d 100644 --- a/OpenSim/Framework/Communications/IInventoryServices.cs +++ b/OpenSim/Framework/Communications/IInventoryServices.cs @@ -87,6 +87,14 @@ namespace OpenSim.Framework.Communications /// /// List RequestFirstLevelFolders(LLUUID userID); + + /// + /// Returns a list of all the folders in a given user's inventory. + /// + /// + /// A flat list of the user's inventory folder tree. + /// Null if there is no inventory for this user + List GetInventorySkeleton(LLUUID userId); /// /// Returns the named folder in that users inventory, returns null if folder is not found. diff --git a/OpenSim/Framework/Communications/InventoryServiceBase.cs b/OpenSim/Framework/Communications/InventoryServiceBase.cs index 595fa65..d105069 100644 --- a/OpenSim/Framework/Communications/InventoryServiceBase.cs +++ b/OpenSim/Framework/Communications/InventoryServiceBase.cs @@ -108,6 +108,30 @@ namespace OpenSim.Framework.Communications return inventoryList; } + + // See IInventoryServices + public List GetInventorySkeleton(LLUUID userId) + { +// m_log.DebugFormat("[AGENT INVENTORY]: Getting inventory skeleton for {0}", userId); + + List userFolders = new List(); + + InventoryFolderBase rootFolder = RequestRootFolder(userId); + userFolders.Add(rootFolder); + + foreach (KeyValuePair plugin in m_plugins) + { + IList folders = plugin.Value.getFolderHierarchy(rootFolder.folderID); + userFolders.AddRange(folders); + } + +// foreach (InventoryFolderBase folder in userFolders) +// { +// m_log.DebugFormat("[AGENT INVENTORY]: Got folder {0} {1}", folder.name, folder.folderID); +// } + + return userFolders; + } // See IInventoryServices public void MoveInventoryFolder(LLUUID userID, InventoryFolderBase folder) diff --git a/OpenSim/Framework/Communications/UserManagerBase.cs b/OpenSim/Framework/Communications/UserManagerBase.cs index 5ba37e6..332583c 100644 --- a/OpenSim/Framework/Communications/UserManagerBase.cs +++ b/OpenSim/Framework/Communications/UserManagerBase.cs @@ -43,7 +43,8 @@ namespace OpenSim.Framework.UserManagement /// public abstract class UserManagerBase : IUserService { - private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); + private static readonly log4net.ILog m_log + = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); public UserConfig _config; private Dictionary _plugins = new Dictionary(); -- cgit v1.1