diff options
-rw-r--r-- | OpenSim/Framework/Communications/Cache/CachedUserInfo.cs | 28 | ||||
-rw-r--r-- | OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs | 13 |
2 files changed, 29 insertions, 12 deletions
diff --git a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs index 6e07e7c..9ece581 100644 --- a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs +++ b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs | |||
@@ -32,16 +32,24 @@ using libsecondlife; | |||
32 | 32 | ||
33 | namespace OpenSim.Framework.Communications.Cache | 33 | namespace OpenSim.Framework.Communications.Cache |
34 | { | 34 | { |
35 | /// <summary> | ||
36 | /// Stores user profile and inventory data received from backend services for a particular user. | ||
37 | /// </summary> | ||
35 | public class CachedUserInfo | 38 | public class CachedUserInfo |
36 | { | 39 | { |
37 | private static readonly log4net.ILog m_log | 40 | private static readonly log4net.ILog m_log |
38 | = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | 41 | = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); |
39 | 42 | ||
40 | private readonly CommunicationsManager m_parentCommsManager; | 43 | /// <summary> |
44 | /// The comms manager holds references to services (user, grid, inventory, etc.) | ||
45 | /// </summary> | ||
46 | private readonly CommunicationsManager m_commsManager; | ||
41 | 47 | ||
48 | private UserProfileData m_userProfile; | ||
49 | public UserProfileData UserProfile { get { return m_userProfile; } } | ||
50 | |||
42 | // FIXME: These need to be hidden behind accessors | 51 | // FIXME: These need to be hidden behind accessors |
43 | public InventoryFolderImpl RootFolder = null; | 52 | public InventoryFolderImpl RootFolder = null; |
44 | public UserProfileData UserProfile = null; | ||
45 | 53 | ||
46 | /// <summary> | 54 | /// <summary> |
47 | /// Stores received folders for which we have not yet received the parents. | 55 | /// Stores received folders for which we have not yet received the parents. |
@@ -49,9 +57,15 @@ namespace OpenSim.Framework.Communications.Cache | |||
49 | private IDictionary<LLUUID, IList<InventoryFolderImpl>> pendingCategorizationFolders | 57 | private IDictionary<LLUUID, IList<InventoryFolderImpl>> pendingCategorizationFolders |
50 | = new Dictionary<LLUUID, IList<InventoryFolderImpl>>(); | 58 | = new Dictionary<LLUUID, IList<InventoryFolderImpl>>(); |
51 | 59 | ||
52 | public CachedUserInfo(CommunicationsManager commsManager) | 60 | /// <summary> |
61 | /// Constructor | ||
62 | /// </summary> | ||
63 | /// <param name="commsManager"></param> | ||
64 | /// <param name="userProfile"></param> | ||
65 | public CachedUserInfo(CommunicationsManager commsManager, UserProfileData userProfile) | ||
53 | { | 66 | { |
54 | m_parentCommsManager = commsManager; | 67 | m_commsManager = commsManager; |
68 | m_userProfile = userProfile; | ||
55 | } | 69 | } |
56 | 70 | ||
57 | /// <summary> | 71 | /// <summary> |
@@ -197,7 +211,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
197 | if ((userID == UserProfile.ID) && (RootFolder != null)) | 211 | if ((userID == UserProfile.ID) && (RootFolder != null)) |
198 | { | 212 | { |
199 | ItemReceive(userID, itemInfo); | 213 | ItemReceive(userID, itemInfo); |
200 | m_parentCommsManager.InventoryService.AddNewInventoryItem(userID, itemInfo); | 214 | m_commsManager.InventoryService.AddNewInventoryItem(userID, itemInfo); |
201 | } | 215 | } |
202 | } | 216 | } |
203 | 217 | ||
@@ -205,7 +219,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
205 | { | 219 | { |
206 | if ((userID == UserProfile.ID) && (RootFolder != null)) | 220 | if ((userID == UserProfile.ID) && (RootFolder != null)) |
207 | { | 221 | { |
208 | m_parentCommsManager.InventoryService.AddNewInventoryItem(userID, itemInfo); | 222 | m_commsManager.InventoryService.AddNewInventoryItem(userID, itemInfo); |
209 | } | 223 | } |
210 | } | 224 | } |
211 | 225 | ||
@@ -217,7 +231,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
217 | result = RootFolder.DeleteItem(item.ID); | 231 | result = RootFolder.DeleteItem(item.ID); |
218 | if (result) | 232 | if (result) |
219 | { | 233 | { |
220 | m_parentCommsManager.InventoryService.DeleteInventoryItem(userID, item); | 234 | m_commsManager.InventoryService.DeleteInventoryItem(userID, item); |
221 | } | 235 | } |
222 | } | 236 | } |
223 | return result; | 237 | return result; |
diff --git a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs index 7178d2c..586c24e 100644 --- a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs +++ b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs | |||
@@ -35,12 +35,15 @@ using OpenSim.Framework.Console; | |||
35 | 35 | ||
36 | namespace OpenSim.Framework.Communications.Cache | 36 | namespace OpenSim.Framework.Communications.Cache |
37 | { | 37 | { |
38 | /// <summary> | ||
39 | /// Holds user profile information and retrieves it from backend services. | ||
40 | /// </summary> | ||
38 | public class UserProfileCacheService | 41 | public class UserProfileCacheService |
39 | { | 42 | { |
40 | private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | 43 | private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); |
41 | 44 | ||
42 | /// <summary> | 45 | /// <summary> |
43 | /// The comms manager holds the reference to this service | 46 | /// The comms manager holds references to services (user, grid, inventory, etc.) |
44 | /// </summary> | 47 | /// </summary> |
45 | private readonly CommunicationsManager m_commsManager; | 48 | private readonly CommunicationsManager m_commsManager; |
46 | 49 | ||
@@ -68,12 +71,12 @@ namespace OpenSim.Framework.Communications.Cache | |||
68 | { | 71 | { |
69 | if (!m_userProfiles.ContainsKey(userID)) | 72 | if (!m_userProfiles.ContainsKey(userID)) |
70 | { | 73 | { |
71 | CachedUserInfo userInfo = new CachedUserInfo(m_commsManager); | 74 | UserProfileData userProfile = m_commsManager.UserService.GetUserProfile(userID); |
72 | userInfo.UserProfile = m_commsManager.UserService.GetUserProfile(userID); | 75 | CachedUserInfo userInfo = new CachedUserInfo(m_commsManager, userProfile); |
73 | 76 | ||
74 | if (userInfo.UserProfile != null) | 77 | if (userInfo.UserProfile != null) |
75 | { | 78 | { |
76 | // The inventory will be populated when the user actually enters the scene | 79 | // The inventory for the user will be populated when they actually enter the scene |
77 | m_userProfiles.Add(userID, userInfo); | 80 | m_userProfiles.Add(userID, userInfo); |
78 | } | 81 | } |
79 | else | 82 | else |
@@ -85,7 +88,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
85 | } | 88 | } |
86 | 89 | ||
87 | /// <summary> | 90 | /// <summary> |
88 | /// Request the inventory data for the given user. This will occur asynchronous if running on a grid | 91 | /// Request the inventory data for the given user. This will occur asynchronously if running on a grid |
89 | /// </summary> | 92 | /// </summary> |
90 | /// <param name="userID"></param> | 93 | /// <param name="userID"></param> |
91 | /// <param name="userInfo"></param> | 94 | /// <param name="userInfo"></param> |