From 43b2ff1d112174c36bb18caf353945afc6390840 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Fri, 1 Aug 2008 18:49:48 +0000 Subject: * Drop cached inventory from the local region when a user crosses out into a remote region * May resolves inventory problems that occur when the user moves between two regions` * e.g. if the user moves to a second region, adds an inventory item, moves back to the original region then tries to manipulate that item * Not yet implemented for teleport --- .../Framework/Communications/Cache/CachedUserInfo.cs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'OpenSim/Framework/Communications/Cache/CachedUserInfo.cs') diff --git a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs index 025b934..d85eda0 100644 --- a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs +++ b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs @@ -75,7 +75,7 @@ namespace OpenSim.Framework.Communications.Cache private readonly IList m_pendingRequests = new List(); /// - /// The root folder of this user's inventory. Returns null if the inventory has not yet been received. + /// The root folder of this user's inventory. Returns null if the root folder has not yet been received. /// public InventoryFolderImpl RootFolder { get { return m_rootFolder; } } private InventoryFolderImpl m_rootFolder; @@ -183,6 +183,21 @@ namespace OpenSim.Framework.Communications.Cache } } } + + /// + /// Drop all cached inventory. + /// + public void DropInventory() + { + // Make sure there aren't pending requests around when we do this + // FIXME: There is still a race condition where an inventory operation can be requested (since these aren't being locked). + // Will have to extend locking to exclude this very soon. + lock (m_pendingRequests) + { + m_hasReceivedInventory = false; + m_rootFolder = null; + } + } /// /// Callback invoked when the inventory is received from an async request to the inventory service -- cgit v1.1