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 ++- OpenSim/Framework/Data.MSSQL/MSSQLInventoryData.cs | 8 ++------ OpenSim/Framework/Data.MySQL/MySQLInventoryData.cs | 8 ++------ .../Framework/Data.SQLite/SQLiteInventoryStore.cs | 8 ++------ OpenSim/Framework/InventoryItemBase.cs | 8 ++++++++ .../Communications/Local/LocalInventoryService.cs | 4 +++- .../Communications/Local/LocalLoginService.cs | 3 ++- .../Communications/OGS1/OGS1InventoryService.cs | 8 ++++++++ 12 files changed, 73 insertions(+), 30 deletions(-) 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(); diff --git a/OpenSim/Framework/Data.MSSQL/MSSQLInventoryData.cs b/OpenSim/Framework/Data.MSSQL/MSSQLInventoryData.cs index 03bde7e..1e99e51 100644 --- a/OpenSim/Framework/Data.MSSQL/MSSQLInventoryData.cs +++ b/OpenSim/Framework/Data.MSSQL/MSSQLInventoryData.cs @@ -652,12 +652,8 @@ namespace OpenSim.Framework.Data.MSSQL folders.Add(f); } - /// - /// Returns all child folders in the hierarchy from the parent folder and down - /// - /// The folder to get subfolders for - /// A list of inventory folders - protected List getFolderHierarchy(LLUUID parentID) + // See IInventoryData + public List getFolderHierarchy(LLUUID parentID) { List folders = new List(); getInventoryFolders(ref folders, parentID); diff --git a/OpenSim/Framework/Data.MySQL/MySQLInventoryData.cs b/OpenSim/Framework/Data.MySQL/MySQLInventoryData.cs index d6dabfe..4165d8f 100644 --- a/OpenSim/Framework/Data.MySQL/MySQLInventoryData.cs +++ b/OpenSim/Framework/Data.MySQL/MySQLInventoryData.cs @@ -573,12 +573,8 @@ namespace OpenSim.Framework.Data.MySQL folders.Add(f); } - /// - /// Returns all child folders in the hierarchy from the parent folder and down - /// - /// The folder to get subfolders for - /// A list of inventory folders - protected List getFolderHierarchy(LLUUID parentID) + // See IInventoryData + public List getFolderHierarchy(LLUUID parentID) { List folders = new List(); getInventoryFolders(ref folders, parentID); diff --git a/OpenSim/Framework/Data.SQLite/SQLiteInventoryStore.cs b/OpenSim/Framework/Data.SQLite/SQLiteInventoryStore.cs index 14a3e1a..d31863f 100644 --- a/OpenSim/Framework/Data.SQLite/SQLiteInventoryStore.cs +++ b/OpenSim/Framework/Data.SQLite/SQLiteInventoryStore.cs @@ -319,12 +319,8 @@ namespace OpenSim.Framework.Data.SQLite return folders; } - /// - /// Returns all child folders in the hierarchy from the parent folder and down - /// - /// The folder to get subfolders for - /// A list of inventory folders - protected List getFolderHierarchy(LLUUID parentID) + // See IInventoryData + public List getFolderHierarchy(LLUUID parentID) { List folders = new List(); getInventoryFolders(ref folders, Util.ToRawUuidString(parentID)); diff --git a/OpenSim/Framework/InventoryItemBase.cs b/OpenSim/Framework/InventoryItemBase.cs index 897af7f..1d0246b 100644 --- a/OpenSim/Framework/InventoryItemBase.cs +++ b/OpenSim/Framework/InventoryItemBase.cs @@ -165,6 +165,14 @@ namespace OpenSim.Framework /// /// A string containing the plugin version string getVersion(); + + /// + /// Returns all child folders in the hierarchy from the parent folder and down. + /// Does not return the parent folder itself. + /// + /// The folder to get subfolders for + /// A list of inventory folders + List getFolderHierarchy(LLUUID parentID); /// /// Returns a list of inventory items contained within the specified folder diff --git a/OpenSim/Region/Communications/Local/LocalInventoryService.cs b/OpenSim/Region/Communications/Local/LocalInventoryService.cs index f154cd8..fc5cc6c 100644 --- a/OpenSim/Region/Communications/Local/LocalInventoryService.cs +++ b/OpenSim/Region/Communications/Local/LocalInventoryService.cs @@ -42,7 +42,9 @@ namespace OpenSim.Region.Communications.Local public override void RequestInventoryForUser(LLUUID userID, InventoryFolderInfo folderCallBack, InventoryItemInfo itemCallBack) { - List folders = RequestFirstLevelFolders(userID); + //List folders = RequestFirstLevelFolders(userID); + List folders = GetInventorySkeleton(userID); + InventoryFolderImpl rootFolder = null; //need to make sure we send root folder first diff --git a/OpenSim/Region/Communications/Local/LocalLoginService.cs b/OpenSim/Region/Communications/Local/LocalLoginService.cs index 5af0077..6bb505d 100644 --- a/OpenSim/Region/Communications/Local/LocalLoginService.cs +++ b/OpenSim/Region/Communications/Local/LocalLoginService.cs @@ -215,7 +215,8 @@ namespace OpenSim.Region.Communications.Local // See LoginService protected override InventoryData GetInventorySkeleton(LLUUID userID) { - List folders = m_Parent.InventoryService.RequestFirstLevelFolders(userID); + List folders = m_Parent.InventoryService.GetInventorySkeleton(userID); + //List folders = m_Parent.InventoryService.RequestFirstLevelFolders(userID); if (folders.Count > 0) { LLUUID rootID = LLUUID.Zero; diff --git a/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs b/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs index 3551172..e78fc1a 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs @@ -216,6 +216,14 @@ namespace OpenSim.Region.Communications.OGS1 public void CreateNewUserInventory(LLUUID user) { } + + // See IInventoryServices + public List GetInventorySkeleton(LLUUID userId) + { + m_log.ErrorFormat("[OGS1 INVENTORY SERVICE]: The GetInventorySkeleton() method here should never be called!"); + + return new List(); + } public List RequestFirstLevelFolders(LLUUID userID) { -- cgit v1.1