From 7ac7f79f88f51504680a24f1621115c595492f62 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Fri, 11 Apr 2008 18:46:54 +0000 Subject: * Eliminate a class of errors where an inventory request could be made before the region had completely received the inventory for the user. * A much larger race condition where the inventory request could be made before the region gets any data at all will also be fixed in the near future. * This change also fixes a regression from two patches ago where items stopped appearing in standalone inventory --- .../Communications/Cache/CachedUserInfo.cs | 31 ++++++++++++++-------- 1 file changed, 20 insertions(+), 11 deletions(-) (limited to 'OpenSim/Framework/Communications') diff --git a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs index d97cf01..686f8d2 100644 --- a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs +++ b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs @@ -47,10 +47,18 @@ namespace OpenSim.Framework.Communications.Cache private UserProfileData m_userProfile; public UserProfileData UserProfile { get { return m_userProfile; } } + + + private bool m_hasInventory; + + /// + /// Has this user info object yet received its inventory information from the invetnroy service? + /// + public bool HasInventory { get { return m_hasInventory; } } // FIXME: These need to be hidden behind accessors private InventoryFolderImpl m_rootFolder; - public InventoryFolderImpl RootFolder { get { return m_rootFolder; } } + public InventoryFolderImpl RootFolder { get { return m_rootFolder; } } /// /// Stores received folders for which we have not yet received the parents. @@ -68,11 +76,6 @@ namespace OpenSim.Framework.Communications.Cache m_commsManager = commsManager; m_userProfile = userProfile; } - - /// - /// Has this user info object yet received its inventory information from the invetnroy service? - /// - public bool HasInventory { get { return RootFolder != null; } } /// /// Store a folder pending categorization when its parent is received. @@ -142,8 +145,10 @@ namespace OpenSim.Framework.Communications.Cache } catch (Exception e) { - m_log.ErrorFormat("[INVENTORY CACHE]: {0}", e); - } + m_log.ErrorFormat("[INVENTORY CACHE]: Error processing inventory received from inventory service, {0}", e); + } + + m_hasInventory = true; } /// @@ -153,9 +158,9 @@ namespace OpenSim.Framework.Communications.Cache /// private void FolderReceive(LLUUID userID, InventoryFolderImpl folderInfo) { -// m_log.DebugFormat( -// "[INVENTORY CACHE]: Received folder {0} {1} for user {2}", -// folderInfo.name, folderInfo.folderID, userID); + m_log.DebugFormat( + "[INVENTORY CACHE]: Received folder {0} {1} for user {2}", + folderInfo.Name, folderInfo.ID, userID); if (userID == UserProfile.ID) { @@ -207,6 +212,10 @@ namespace OpenSim.Framework.Communications.Cache /// private void ItemReceive(LLUUID userID, InventoryItemBase itemInfo) { + m_log.DebugFormat( + "[INVENTORY CACHE]: Received item {0} {1} for user {2}", + itemInfo.Name, itemInfo.ID, userID); + if ((userID == UserProfile.ID) && (RootFolder != null)) { if (itemInfo.Folder == RootFolder.ID) -- cgit v1.1