diff options
Diffstat (limited to 'OpenSim/Framework/Communications/Cache')
-rw-r--r-- | OpenSim/Framework/Communications/Cache/CachedUserInfo.cs | 29 | ||||
-rw-r--r-- | OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs | 8 |
2 files changed, 18 insertions, 19 deletions
diff --git a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs index 4c0aaa2..d6e1715 100644 --- a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs +++ b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs | |||
@@ -66,7 +66,8 @@ namespace OpenSim.Framework.Communications.Cache | |||
66 | /// <summary> | 66 | /// <summary> |
67 | /// Has we received the user's inventory from the inventory service? | 67 | /// Has we received the user's inventory from the inventory service? |
68 | /// </summary> | 68 | /// </summary> |
69 | private bool m_hasInventory; | 69 | public bool HasReceivedInventory { get { return m_hasReceivedInventory; } } |
70 | private bool m_hasReceivedInventory; | ||
70 | 71 | ||
71 | /// <summary> | 72 | /// <summary> |
72 | /// Inventory requests waiting for receipt of this user's inventory from the inventory service. | 73 | /// Inventory requests waiting for receipt of this user's inventory from the inventory service. |
@@ -74,12 +75,10 @@ namespace OpenSim.Framework.Communications.Cache | |||
74 | private readonly IList<IInventoryRequest> m_pendingRequests = new List<IInventoryRequest>(); | 75 | private readonly IList<IInventoryRequest> m_pendingRequests = new List<IInventoryRequest>(); |
75 | 76 | ||
76 | /// <summary> | 77 | /// <summary> |
77 | /// Has this user info object yet received its inventory information from the invetnroy service? | 78 | /// The root folder of this user's inventory. Returns null if the inventory has not yet been received. |
78 | /// </summary> | 79 | /// </summary> |
79 | public bool HasInventory { get { return m_hasInventory; } } | ||
80 | |||
81 | private InventoryFolderImpl m_rootFolder; | ||
82 | public InventoryFolderImpl RootFolder { get { return m_rootFolder; } } | 80 | public InventoryFolderImpl RootFolder { get { return m_rootFolder; } } |
81 | private InventoryFolderImpl m_rootFolder; | ||
83 | 82 | ||
84 | /// <summary> | 83 | /// <summary> |
85 | /// FIXME: This could be contained within a local variable - it doesn't need to be a field | 84 | /// FIXME: This could be contained within a local variable - it doesn't need to be a field |
@@ -126,7 +125,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
126 | { | 125 | { |
127 | lock (m_pendingRequests) | 126 | lock (m_pendingRequests) |
128 | { | 127 | { |
129 | if (m_hasInventory) | 128 | if (HasReceivedInventory) |
130 | { | 129 | { |
131 | request.Execute(); | 130 | request.Execute(); |
132 | } | 131 | } |
@@ -216,7 +215,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
216 | { | 215 | { |
217 | // We're going to change inventory status within the lock to avoid a race condition | 216 | // We're going to change inventory status within the lock to avoid a race condition |
218 | // where requests are processed after the AddRequest() method has been called. | 217 | // where requests are processed after the AddRequest() method has been called. |
219 | m_hasInventory = true; | 218 | m_hasReceivedInventory = true; |
220 | 219 | ||
221 | foreach (IInventoryRequest request in m_pendingRequests) | 220 | foreach (IInventoryRequest request in m_pendingRequests) |
222 | { | 221 | { |
@@ -318,7 +317,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
318 | // m_log.DebugFormat( | 317 | // m_log.DebugFormat( |
319 | // "[AGENT INVENTORY]: Creating inventory folder {0} {1} for {2} {3}", folderID, folderName, remoteClient.Name, remoteClient.AgentId); | 318 | // "[AGENT INVENTORY]: Creating inventory folder {0} {1} for {2} {3}", folderID, folderName, remoteClient.Name, remoteClient.AgentId); |
320 | 319 | ||
321 | if (HasInventory) | 320 | if (m_hasReceivedInventory) |
322 | { | 321 | { |
323 | InventoryFolderImpl parentFolder = RootFolder.FindFolder(parentID); | 322 | InventoryFolderImpl parentFolder = RootFolder.FindFolder(parentID); |
324 | 323 | ||
@@ -393,7 +392,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
393 | // m_log.DebugFormat( | 392 | // m_log.DebugFormat( |
394 | // "[AGENT INVENTORY]: Updating inventory folder {0} {1} for {2} {3}", folderID, name, remoteClient.Name, remoteClient.AgentId); | 393 | // "[AGENT INVENTORY]: Updating inventory folder {0} {1} for {2} {3}", folderID, name, remoteClient.Name, remoteClient.AgentId); |
395 | 394 | ||
396 | if (HasInventory) | 395 | if (m_hasReceivedInventory) |
397 | { | 396 | { |
398 | InventoryFolderBase baseFolder = new InventoryFolderBase(); | 397 | InventoryFolderBase baseFolder = new InventoryFolderBase(); |
399 | baseFolder.Owner = m_userProfile.ID; | 398 | baseFolder.Owner = m_userProfile.ID; |
@@ -445,7 +444,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
445 | // "[AGENT INVENTORY]: Moving inventory folder {0} into folder {1} for {2} {3}", | 444 | // "[AGENT INVENTORY]: Moving inventory folder {0} into folder {1} for {2} {3}", |
446 | // parentID, remoteClient.Name, remoteClient.Name, remoteClient.AgentId); | 445 | // parentID, remoteClient.Name, remoteClient.Name, remoteClient.AgentId); |
447 | 446 | ||
448 | if (HasInventory) | 447 | if (m_hasReceivedInventory) |
449 | { | 448 | { |
450 | InventoryFolderBase baseFolder = new InventoryFolderBase(); | 449 | InventoryFolderBase baseFolder = new InventoryFolderBase(); |
451 | baseFolder.Owner = m_userProfile.ID; | 450 | baseFolder.Owner = m_userProfile.ID; |
@@ -491,7 +490,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
491 | // m_log.InfoFormat("[AGENT INVENTORY]: Purging folder {0} for {1} uuid {2}", | 490 | // m_log.InfoFormat("[AGENT INVENTORY]: Purging folder {0} for {1} uuid {2}", |
492 | // folderID, remoteClient.Name, remoteClient.AgentId); | 491 | // folderID, remoteClient.Name, remoteClient.AgentId); |
493 | 492 | ||
494 | if (HasInventory) | 493 | if (m_hasReceivedInventory) |
495 | { | 494 | { |
496 | InventoryFolderImpl purgedFolder = RootFolder.FindFolder(folderID); | 495 | InventoryFolderImpl purgedFolder = RootFolder.FindFolder(folderID); |
497 | 496 | ||
@@ -539,7 +538,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
539 | /// <param name="itemInfo"></param> | 538 | /// <param name="itemInfo"></param> |
540 | public void AddItem(InventoryItemBase item) | 539 | public void AddItem(InventoryItemBase item) |
541 | { | 540 | { |
542 | if (HasInventory) | 541 | if (m_hasReceivedInventory) |
543 | { | 542 | { |
544 | if (item.Folder == LLUUID.Zero) | 543 | if (item.Folder == LLUUID.Zero) |
545 | { | 544 | { |
@@ -575,7 +574,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
575 | /// <param name="itemInfo"></param> | 574 | /// <param name="itemInfo"></param> |
576 | public void UpdateItem(InventoryItemBase item) | 575 | public void UpdateItem(InventoryItemBase item) |
577 | { | 576 | { |
578 | if (HasInventory) | 577 | if (m_hasReceivedInventory) |
579 | { | 578 | { |
580 | if (m_commsManager.SecureInventoryService != null) | 579 | if (m_commsManager.SecureInventoryService != null) |
581 | { | 580 | { |
@@ -608,7 +607,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
608 | /// </returns> | 607 | /// </returns> |
609 | public bool DeleteItem(LLUUID itemID) | 608 | public bool DeleteItem(LLUUID itemID) |
610 | { | 609 | { |
611 | if (HasInventory) | 610 | if (m_hasReceivedInventory) |
612 | { | 611 | { |
613 | // XXX For historical reasons (grid comms), we need to retrieve the whole item in order to delete, even though | 612 | // XXX For historical reasons (grid comms), we need to retrieve the whole item in order to delete, even though |
614 | // really only the item id is required. | 613 | // really only the item id is required. |
@@ -656,7 +655,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
656 | /// <returns>true if the request was queued or successfully processed, false otherwise</returns> | 655 | /// <returns>true if the request was queued or successfully processed, false otherwise</returns> |
657 | public bool SendInventoryDecendents(IClientAPI client, LLUUID folderID, bool fetchFolders, bool fetchItems) | 656 | public bool SendInventoryDecendents(IClientAPI client, LLUUID folderID, bool fetchFolders, bool fetchItems) |
658 | { | 657 | { |
659 | if (HasInventory) | 658 | if (m_hasReceivedInventory) |
660 | { | 659 | { |
661 | InventoryFolderImpl folder; | 660 | InventoryFolderImpl folder; |
662 | 661 | ||
diff --git a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs index 5f98c08..ac52535 100644 --- a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs +++ b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs | |||
@@ -348,7 +348,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
348 | // This is a crude way of dealing with that by retrying the lookup. It's not quite as bad | 348 | // This is a crude way of dealing with that by retrying the lookup. It's not quite as bad |
349 | // in CAPS as doing this with the udp request, since here it won't hold up other packets. | 349 | // in CAPS as doing this with the udp request, since here it won't hold up other packets. |
350 | // In fact, here we'll be generous and try for longer. | 350 | // In fact, here we'll be generous and try for longer. |
351 | if (!userProfile.HasInventory) | 351 | if (!userProfile.HasReceivedInventory) |
352 | { | 352 | { |
353 | int attempts = 0; | 353 | int attempts = 0; |
354 | while (attempts++ < 30) | 354 | while (attempts++ < 30) |
@@ -359,14 +359,14 @@ namespace OpenSim.Framework.Communications.Cache | |||
359 | 359 | ||
360 | Thread.Sleep(2000); | 360 | Thread.Sleep(2000); |
361 | 361 | ||
362 | if (userProfile.HasInventory) | 362 | if (userProfile.HasReceivedInventory) |
363 | { | 363 | { |
364 | break; | 364 | break; |
365 | } | 365 | } |
366 | } | 366 | } |
367 | } | 367 | } |
368 | 368 | ||
369 | if (userProfile.HasInventory) | 369 | if (userProfile.HasReceivedInventory) |
370 | { | 370 | { |
371 | if ((fold = userProfile.RootFolder.FindFolder(folderID)) != null) | 371 | if ((fold = userProfile.RootFolder.FindFolder(folderID)) != null) |
372 | { | 372 | { |
@@ -434,7 +434,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
434 | CachedUserInfo userProfile; | 434 | CachedUserInfo userProfile; |
435 | if (m_userProfiles.TryGetValue(remoteClient.AgentId, out userProfile)) | 435 | if (m_userProfiles.TryGetValue(remoteClient.AgentId, out userProfile)) |
436 | { | 436 | { |
437 | if (userProfile.HasInventory) | 437 | if (userProfile.HasReceivedInventory) |
438 | { | 438 | { |
439 | InventoryItemBase item = userProfile.RootFolder.FindItem(itemID); | 439 | InventoryItemBase item = userProfile.RootFolder.FindItem(itemID); |
440 | if (item != null) | 440 | if (item != null) |