aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs
diff options
context:
space:
mode:
authorJeff Ames2008-05-16 01:22:11 +0000
committerJeff Ames2008-05-16 01:22:11 +0000
commit65c5efe43b68700bad94076d4cd421160203c5de (patch)
tree589b56649ed02f4942671fd6e51c6dc43f682e0d /OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs
parentThank you very much, mjm for : (diff)
downloadopensim-SC_OLD-65c5efe43b68700bad94076d4cd421160203c5de.zip
opensim-SC_OLD-65c5efe43b68700bad94076d4cd421160203c5de.tar.gz
opensim-SC_OLD-65c5efe43b68700bad94076d4cd421160203c5de.tar.bz2
opensim-SC_OLD-65c5efe43b68700bad94076d4cd421160203c5de.tar.xz
Formatting cleanup.
Diffstat (limited to 'OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs')
-rw-r--r--OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs78
1 files changed, 39 insertions, 39 deletions
diff --git a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs
index 7f911dc..fe61406 100644
--- a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs
+++ b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs
@@ -33,7 +33,7 @@ using libsecondlife;
33using log4net; 33using log4net;
34 34
35namespace OpenSim.Framework.Communications.Cache 35namespace OpenSim.Framework.Communications.Cache
36{ 36{
37 /// <summary> 37 /// <summary>
38 /// Holds user profile information and retrieves it from backend services. 38 /// Holds user profile information and retrieves it from backend services.
39 /// </summary> 39 /// </summary>
@@ -45,7 +45,7 @@ namespace OpenSim.Framework.Communications.Cache
45 /// The comms manager holds references to services (user, grid, inventory, etc.) 45 /// The comms manager holds references to services (user, grid, inventory, etc.)
46 /// </summary> 46 /// </summary>
47 private readonly CommunicationsManager m_commsManager; 47 private readonly CommunicationsManager m_commsManager;
48 48
49 /// <summary> 49 /// <summary>
50 /// Each user has a cached profile. 50 /// Each user has a cached profile.
51 /// </summary> 51 /// </summary>
@@ -84,8 +84,8 @@ namespace OpenSim.Framework.Communications.Cache
84 } 84 }
85 } 85 }
86 } 86 }
87 } 87 }
88 88
89 /// <summary> 89 /// <summary>
90 /// Remove this user's profile cache. 90 /// Remove this user's profile cache.
91 /// </summary> 91 /// </summary>
@@ -103,9 +103,9 @@ namespace OpenSim.Framework.Communications.Cache
103 else 103 else
104 { 104 {
105 m_log.ErrorFormat("[USER CACHE]: Tried to remove the profile of user {0}, but this was not in the scene", userID); 105 m_log.ErrorFormat("[USER CACHE]: Tried to remove the profile of user {0}, but this was not in the scene", userID);
106 } 106 }
107 } 107 }
108 108
109 return false; 109 return false;
110 } 110 }
111 111
@@ -118,14 +118,14 @@ namespace OpenSim.Framework.Communications.Cache
118 { 118 {
119 CachedUserInfo userInfo = GetUserDetails(userID); 119 CachedUserInfo userInfo = GetUserDetails(userID);
120 if (userInfo != null) 120 if (userInfo != null)
121 { 121 {
122 m_commsManager.InventoryService.RequestInventoryForUser(userID, userInfo.InventoryReceive); 122 m_commsManager.InventoryService.RequestInventoryForUser(userID, userInfo.InventoryReceive);
123 } 123 }
124 else 124 else
125 { 125 {
126 m_log.ErrorFormat("[USER CACHE]: RequestInventoryForUser() - user profile for user {0} not found", userID); 126 m_log.ErrorFormat("[USER CACHE]: RequestInventoryForUser() - user profile for user {0} not found", userID);
127 } 127 }
128 } 128 }
129 129
130 /// <summary> 130 /// <summary>
131 /// Get the details of the given user. A caller should try this method first if it isn't sure that 131 /// Get the details of the given user. A caller should try this method first if it isn't sure that
@@ -151,7 +151,7 @@ namespace OpenSim.Framework.Communications.Cache
151 /// <param name="parentID"></param> 151 /// <param name="parentID"></param>
152 public void HandleCreateInventoryFolder(IClientAPI remoteClient, LLUUID folderID, ushort folderType, 152 public void HandleCreateInventoryFolder(IClientAPI remoteClient, LLUUID folderID, ushort folderType,
153 string folderName, LLUUID parentID) 153 string folderName, LLUUID parentID)
154 { 154 {
155 CachedUserInfo userProfile; 155 CachedUserInfo userProfile;
156 156
157 if (m_userProfiles.TryGetValue(remoteClient.AgentId, out userProfile)) 157 if (m_userProfiles.TryGetValue(remoteClient.AgentId, out userProfile))
@@ -159,21 +159,21 @@ namespace OpenSim.Framework.Communications.Cache
159 if (!userProfile.CreateFolder(folderName, folderID, folderType, parentID)) 159 if (!userProfile.CreateFolder(folderName, folderID, folderType, parentID))
160 { 160 {
161 m_log.ErrorFormat( 161 m_log.ErrorFormat(
162 "[AGENT INVENTORY]: Failed to create folder for user {0} {1}", 162 "[AGENT INVENTORY]: Failed to create folder for user {0} {1}",
163 remoteClient.Name, remoteClient.AgentId); 163 remoteClient.Name, remoteClient.AgentId);
164 } 164 }
165 } 165 }
166 else 166 else
167 { 167 {
168 m_log.ErrorFormat( 168 m_log.ErrorFormat(
169 "[AGENT INVENTORY]: Could not find user profile for {0} {1}", 169 "[AGENT INVENTORY]: Could not find user profile for {0} {1}",
170 remoteClient.Name, remoteClient.AgentId); 170 remoteClient.Name, remoteClient.AgentId);
171 } 171 }
172 } 172 }
173 173
174 /// <summary> 174 /// <summary>
175 /// Handle a client request to update the inventory folder 175 /// Handle a client request to update the inventory folder
176 /// 176 ///
177 /// FIXME: We call add new inventory folder because in the data layer, we happen to use an SQL REPLACE 177 /// FIXME: We call add new inventory folder because in the data layer, we happen to use an SQL REPLACE
178 /// so this will work to rename an existing folder. Needless to say, to rely on this is very confusing, 178 /// so this will work to rename an existing folder. Needless to say, to rely on this is very confusing,
179 /// and needs to be changed. 179 /// and needs to be changed.
@@ -188,7 +188,7 @@ namespace OpenSim.Framework.Communications.Cache
188 { 188 {
189// m_log.DebugFormat( 189// m_log.DebugFormat(
190// "[AGENT INVENTORY]: Updating inventory folder {0} {1} for {2} {3}", folderID, name, remoteClient.Name, remoteClient.AgentId); 190// "[AGENT INVENTORY]: Updating inventory folder {0} {1} for {2} {3}", folderID, name, remoteClient.Name, remoteClient.AgentId);
191 191
192 CachedUserInfo userProfile; 192 CachedUserInfo userProfile;
193 193
194 if (m_userProfiles.TryGetValue(remoteClient.AgentId, out userProfile)) 194 if (m_userProfiles.TryGetValue(remoteClient.AgentId, out userProfile))
@@ -196,16 +196,16 @@ namespace OpenSim.Framework.Communications.Cache
196 if (!userProfile.UpdateFolder(name, folderID, type, parentID)) 196 if (!userProfile.UpdateFolder(name, folderID, type, parentID))
197 { 197 {
198 m_log.ErrorFormat( 198 m_log.ErrorFormat(
199 "[AGENT INVENTORY]: Failed to update folder for user {0} {1}", 199 "[AGENT INVENTORY]: Failed to update folder for user {0} {1}",
200 remoteClient.Name, remoteClient.AgentId); 200 remoteClient.Name, remoteClient.AgentId);
201 } 201 }
202 } 202 }
203 else 203 else
204 { 204 {
205 m_log.ErrorFormat( 205 m_log.ErrorFormat(
206 "[AGENT INVENTORY]: Could not find user profile for {0} {1}", 206 "[AGENT INVENTORY]: Could not find user profile for {0} {1}",
207 remoteClient.Name, remoteClient.AgentId); 207 remoteClient.Name, remoteClient.AgentId);
208 } 208 }
209 } 209 }
210 210
211 /// <summary> 211 /// <summary>
@@ -223,16 +223,16 @@ namespace OpenSim.Framework.Communications.Cache
223 if (!userProfile.MoveFolder(folderID, parentID)) 223 if (!userProfile.MoveFolder(folderID, parentID))
224 { 224 {
225 m_log.ErrorFormat( 225 m_log.ErrorFormat(
226 "[AGENT INVENTORY]: Failed to move folder for user {0} {1}", 226 "[AGENT INVENTORY]: Failed to move folder for user {0} {1}",
227 remoteClient.Name, remoteClient.AgentId); 227 remoteClient.Name, remoteClient.AgentId);
228 } 228 }
229 } 229 }
230 else 230 else
231 { 231 {
232 m_log.ErrorFormat( 232 m_log.ErrorFormat(
233 "[AGENT INVENTORY]: Could not find user profile for {0} {1}", 233 "[AGENT INVENTORY]: Could not find user profile for {0} {1}",
234 remoteClient.Name, remoteClient.AgentId); 234 remoteClient.Name, remoteClient.AgentId);
235 } 235 }
236 } 236 }
237 237
238 /// <summary> 238 /// <summary>
@@ -267,14 +267,14 @@ namespace OpenSim.Framework.Communications.Cache
267 else 267 else
268 { 268 {
269 m_log.ErrorFormat( 269 m_log.ErrorFormat(
270 "[AGENT INVENTORY]: Could not find user profile for {0} {1}", 270 "[AGENT INVENTORY]: Could not find user profile for {0} {1}",
271 remoteClient.Name, remoteClient.AgentId); 271 remoteClient.Name, remoteClient.AgentId);
272 } 272 }
273 } 273 }
274 274
275 /// <summary> 275 /// <summary>
276 /// Handle the caps inventory descendents fetch. 276 /// Handle the caps inventory descendents fetch.
277 /// 277 ///
278 /// Since the folder structure is sent to the client on login, I believe we only need to handle items. 278 /// Since the folder structure is sent to the client on login, I believe we only need to handle items.
279 /// </summary> 279 /// </summary>
280 /// <param name="agentID"></param> 280 /// <param name="agentID"></param>
@@ -288,20 +288,20 @@ namespace OpenSim.Framework.Communications.Cache
288 bool fetchFolders, bool fetchItems, int sortOrder) 288 bool fetchFolders, bool fetchItems, int sortOrder)
289 { 289 {
290// m_log.DebugFormat( 290// m_log.DebugFormat(
291// "[INVENTORY CACHE]: Fetching folders ({0}), items ({1}) from {2} for agent {3}", 291// "[INVENTORY CACHE]: Fetching folders ({0}), items ({1}) from {2} for agent {3}",
292// fetchFolders, fetchItems, folderID, agentID); 292// fetchFolders, fetchItems, folderID, agentID);
293 293
294 // FIXME MAYBE: We're not handling sortOrder! 294 // FIXME MAYBE: We're not handling sortOrder!
295 295
296 InventoryFolderImpl fold; 296 InventoryFolderImpl fold;
297 if ((fold = libraryRoot.FindFolder(folderID)) != null) 297 if ((fold = libraryRoot.FindFolder(folderID)) != null)
298 { 298 {
299 return fold.RequestListOfItems(); 299 return fold.RequestListOfItems();
300 } 300 }
301 301
302 CachedUserInfo userProfile; 302 CachedUserInfo userProfile;
303 if (m_userProfiles.TryGetValue(agentID, out userProfile)) 303 if (m_userProfiles.TryGetValue(agentID, out userProfile))
304 { 304 {
305 // XXX: When a client crosses into a scene, their entire inventory is fetched 305 // XXX: When a client crosses into a scene, their entire inventory is fetched
306 // asynchronously. If the client makes a request before the inventory is received, we need 306 // asynchronously. If the client makes a request before the inventory is received, we need
307 // to give the inventory a chance to come in. 307 // to give the inventory a chance to come in.
@@ -315,18 +315,18 @@ namespace OpenSim.Framework.Communications.Cache
315 while (attempts++ < 30) 315 while (attempts++ < 30)
316 { 316 {
317 m_log.DebugFormat( 317 m_log.DebugFormat(
318 "[INVENTORY CACHE]: Poll number {0} for inventory items in folder {1} for user {2}", 318 "[INVENTORY CACHE]: Poll number {0} for inventory items in folder {1} for user {2}",
319 attempts, folderID, agentID); 319 attempts, folderID, agentID);
320 320
321 Thread.Sleep(2000); 321 Thread.Sleep(2000);
322 322
323 if (userProfile.HasInventory) 323 if (userProfile.HasInventory)
324 { 324 {
325 break; 325 break;
326 } 326 }
327 } 327 }
328 } 328 }
329 329
330 if (userProfile.HasInventory) 330 if (userProfile.HasInventory)
331 { 331 {
332 if ((fold = userProfile.RootFolder.FindFolder(folderID)) != null) 332 if ((fold = userProfile.RootFolder.FindFolder(folderID)) != null)
@@ -338,9 +338,9 @@ namespace OpenSim.Framework.Communications.Cache
338 m_log.WarnFormat( 338 m_log.WarnFormat(
339 "[AGENT INVENTORY]: Could not find folder {0} requested by user {1}", 339 "[AGENT INVENTORY]: Could not find folder {0} requested by user {1}",
340 folderID, agentID); 340 folderID, agentID);
341 341
342 return null; 342 return null;
343 } 343 }
344 } 344 }
345 else 345 else
346 { 346 {
@@ -352,7 +352,7 @@ namespace OpenSim.Framework.Communications.Cache
352 else 352 else
353 { 353 {
354 m_log.ErrorFormat("[AGENT INVENTORY]: Could not find user profile for {0}", agentID); 354 m_log.ErrorFormat("[AGENT INVENTORY]: Could not find user profile for {0}", agentID);
355 355
356 return null; 356 return null;
357 } 357 }
358 } 358 }
@@ -371,16 +371,16 @@ namespace OpenSim.Framework.Communications.Cache
371 if (!userProfile.PurgeFolder(folderID)) 371 if (!userProfile.PurgeFolder(folderID))
372 { 372 {
373 m_log.ErrorFormat( 373 m_log.ErrorFormat(
374 "[AGENT INVENTORY]: Failed to purge folder for user {0} {1}", 374 "[AGENT INVENTORY]: Failed to purge folder for user {0} {1}",
375 remoteClient.Name, remoteClient.AgentId); 375 remoteClient.Name, remoteClient.AgentId);
376 } 376 }
377 } 377 }
378 else 378 else
379 { 379 {
380 m_log.ErrorFormat( 380 m_log.ErrorFormat(
381 "[AGENT INVENTORY]: Could not find user profile for {0} {1}", 381 "[AGENT INVENTORY]: Could not find user profile for {0} {1}",
382 remoteClient.Name, remoteClient.AgentId); 382 remoteClient.Name, remoteClient.AgentId);
383 } 383 }
384 } 384 }
385 385
386 public void HandleFetchInventory(IClientAPI remoteClient, LLUUID itemID, LLUUID ownerID) 386 public void HandleFetchInventory(IClientAPI remoteClient, LLUUID itemID, LLUUID ownerID)
@@ -407,9 +407,9 @@ namespace OpenSim.Framework.Communications.Cache
407 else 407 else
408 { 408 {
409 m_log.ErrorFormat( 409 m_log.ErrorFormat(
410 "[AGENT INVENTORY]: Could not find user profile for {0} {1}", 410 "[AGENT INVENTORY]: Could not find user profile for {0} {1}",
411 remoteClient.Name, remoteClient.AgentId); 411 remoteClient.Name, remoteClient.AgentId);
412 } 412 }
413 } 413 }
414 } 414 }
415} 415}