From a81edef2b9b32c6697a46f504af679185aab3ceb Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Thu, 1 May 2008 21:22:03 +0000 Subject: * Refactor: Remove redundant userID from further up the inventory request chain --- .../Communications/Local/LocalInventoryService.cs | 6 +++++- .../Communications/OGS1/OGS1InventoryService.cs | 25 +++++----------------- 2 files changed, 10 insertions(+), 21 deletions(-) (limited to 'OpenSim/Region/Communications') diff --git a/OpenSim/Region/Communications/Local/LocalInventoryService.cs b/OpenSim/Region/Communications/Local/LocalInventoryService.cs index 80108e3..9e63fbf 100644 --- a/OpenSim/Region/Communications/Local/LocalInventoryService.cs +++ b/OpenSim/Region/Communications/Local/LocalInventoryService.cs @@ -77,7 +77,11 @@ namespace OpenSim.Region.Communications.Local } } - callback(userID, folders, items); + m_log.InfoFormat( + "[LOCAL1 INVENTORY SERVICE]: Received inventory response for user {0} containing {1} folders and {2} items", + userID, folders.Count, items.Count); + + callback(folders, items); } public override bool HasInventoryForUser(LLUUID userID) diff --git a/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs b/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs index ba91f14..f7037ea 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs @@ -44,7 +44,8 @@ namespace OpenSim.Region.Communications.OGS1 = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private string _inventoryServerUrl; - private Dictionary m_RequestingInventory = new Dictionary(); + private Dictionary m_RequestingInventory + = new Dictionary(); public OGS1InventoryService(string inventoryServerUrl) { @@ -62,8 +63,7 @@ namespace OpenSim.Region.Communications.OGS1 { if (!m_RequestingInventory.ContainsKey(userID)) { - InventoryRequest request = new InventoryRequest(userID, callback); - m_RequestingInventory.Add(userID, request); + m_RequestingInventory.Add(userID, callback); try { @@ -103,7 +103,7 @@ namespace OpenSim.Region.Communications.OGS1 userID, response.Folders.Count, response.Items.Count); InventoryFolderImpl rootFolder = null; - InventoryRequest request = m_RequestingInventory[userID]; + InventoryReceiptCallback callback = m_RequestingInventory[userID]; ICollection folders = new List(); ICollection items = new List(); @@ -139,7 +139,7 @@ namespace OpenSim.Region.Communications.OGS1 m_log.ErrorFormat("[OGS1 INVENTORY SERVICE]: Did not get back an inventory containing a root folder for user {0}", userID); } - request.Callback(userID, folders, items); + callback(folders, items); m_RequestingInventory.Remove(userID); } @@ -289,20 +289,5 @@ namespace OpenSim.Region.Communications.OGS1 } #endregion - - /// - /// Caches a pending inventory request that has yet to be satisfied by the inventory service - /// - public class InventoryRequest - { - public LLUUID UserID; - public InventoryReceiptCallback Callback; - - public InventoryRequest(LLUUID userId, InventoryReceiptCallback callback) - { - UserID = userId; - Callback = callback; - } - } } } -- cgit v1.1