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 --- OpenSim/Region/Communications/Local/LocalInventoryService.cs | 11 +++++++++-- OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs | 3 ++- 2 files changed, 11 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Communications/Local/LocalInventoryService.cs b/OpenSim/Region/Communications/Local/LocalInventoryService.cs index e81a39f..dafd637 100644 --- a/OpenSim/Region/Communications/Local/LocalInventoryService.cs +++ b/OpenSim/Region/Communications/Local/LocalInventoryService.cs @@ -39,13 +39,18 @@ namespace OpenSim.Region.Communications.Local /// public class LocalInventoryService : InventoryServiceBase { + private static readonly log4net.ILog m_log + = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); + public override void RequestInventoryForUser(LLUUID userID, InventoryReceiptCallback callback) { + m_log.InfoFormat("[LOCAL INVENTORY SERVICE]: Requesting inventory for user {0}", userID); + List skeletonFolders = GetInventorySkeleton(userID); InventoryFolderImpl rootFolder = null; - ICollection folders = new List(); - ICollection items = new List(); + List folders = new List(); + List items = new List(); // Need to retrieve the root folder on the first pass foreach (InventoryFolderBase folder in skeletonFolders) @@ -54,6 +59,7 @@ namespace OpenSim.Region.Communications.Local { rootFolder = new InventoryFolderImpl(folder); folders.Add(rootFolder); + items.AddRange(RequestFolderItems(rootFolder.ID)); } } @@ -64,6 +70,7 @@ namespace OpenSim.Region.Communications.Local if (folder.ID != rootFolder.ID) { folders.Add(new InventoryFolderImpl(folder)); + items.AddRange(RequestFolderItems(folder.ID)); } } } diff --git a/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs b/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs index dc26ce2..8f293f9 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs @@ -38,7 +38,8 @@ namespace OpenSim.Region.Communications.OGS1 { public class OGS1InventoryService : IInventoryServices { - private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); + private static readonly log4net.ILog m_log + = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); private string _inventoryServerUrl; private Dictionary m_RequestingInventory = new Dictionary(); -- cgit v1.1