diff --git a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs index 6e07e7cf8a..9ece58108f 100644 --- a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs +++ b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs @@ -32,16 +32,24 @@ using libsecondlife; namespace OpenSim.Framework.Communications.Cache { + /// + /// Stores user profile and inventory data received from backend services for a particular user. + /// public class CachedUserInfo { private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - private readonly CommunicationsManager m_parentCommsManager; + /// + /// The comms manager holds references to services (user, grid, inventory, etc.) + /// + private readonly CommunicationsManager m_commsManager; + private UserProfileData m_userProfile; + public UserProfileData UserProfile { get { return m_userProfile; } } + // FIXME: These need to be hidden behind accessors public InventoryFolderImpl RootFolder = null; - public UserProfileData UserProfile = null; /// /// Stores received folders for which we have not yet received the parents. @@ -49,9 +57,15 @@ namespace OpenSim.Framework.Communications.Cache private IDictionary> pendingCategorizationFolders = new Dictionary>(); - public CachedUserInfo(CommunicationsManager commsManager) + /// + /// Constructor + /// + /// + /// + public CachedUserInfo(CommunicationsManager commsManager, UserProfileData userProfile) { - m_parentCommsManager = commsManager; + m_commsManager = commsManager; + m_userProfile = userProfile; } /// @@ -197,7 +211,7 @@ namespace OpenSim.Framework.Communications.Cache if ((userID == UserProfile.ID) && (RootFolder != null)) { ItemReceive(userID, itemInfo); - m_parentCommsManager.InventoryService.AddNewInventoryItem(userID, itemInfo); + m_commsManager.InventoryService.AddNewInventoryItem(userID, itemInfo); } } @@ -205,7 +219,7 @@ namespace OpenSim.Framework.Communications.Cache { if ((userID == UserProfile.ID) && (RootFolder != null)) { - m_parentCommsManager.InventoryService.AddNewInventoryItem(userID, itemInfo); + m_commsManager.InventoryService.AddNewInventoryItem(userID, itemInfo); } } @@ -217,7 +231,7 @@ namespace OpenSim.Framework.Communications.Cache result = RootFolder.DeleteItem(item.ID); if (result) { - m_parentCommsManager.InventoryService.DeleteInventoryItem(userID, item); + m_commsManager.InventoryService.DeleteInventoryItem(userID, item); } } return result; diff --git a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs index 7178d2ca0a..586c24eb36 100644 --- a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs +++ b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs @@ -35,12 +35,15 @@ using OpenSim.Framework.Console; namespace OpenSim.Framework.Communications.Cache { + /// + /// Holds user profile information and retrieves it from backend services. + /// public class UserProfileCacheService { private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); /// - /// The comms manager holds the reference to this service + /// The comms manager holds references to services (user, grid, inventory, etc.) /// private readonly CommunicationsManager m_commsManager; @@ -68,12 +71,12 @@ namespace OpenSim.Framework.Communications.Cache { if (!m_userProfiles.ContainsKey(userID)) { - CachedUserInfo userInfo = new CachedUserInfo(m_commsManager); - userInfo.UserProfile = m_commsManager.UserService.GetUserProfile(userID); + UserProfileData userProfile = m_commsManager.UserService.GetUserProfile(userID); + CachedUserInfo userInfo = new CachedUserInfo(m_commsManager, userProfile); if (userInfo.UserProfile != null) { - // The inventory will be populated when the user actually enters the scene + // The inventory for the user will be populated when they actually enter the scene m_userProfiles.Add(userID, userInfo); } else @@ -85,7 +88,7 @@ namespace OpenSim.Framework.Communications.Cache } /// - /// Request the inventory data for the given user. This will occur asynchronous if running on a grid + /// Request the inventory data for the given user. This will occur asynchronously if running on a grid /// /// ///