aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Communications
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Communications')
-rw-r--r--OpenSim/Region/Communications/Local/LocalInventoryService.cs6
-rw-r--r--OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs25
2 files changed, 10 insertions, 21 deletions
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
77 } 77 }
78 } 78 }
79 79
80 callback(userID, folders, items); 80 m_log.InfoFormat(
81 "[LOCAL1 INVENTORY SERVICE]: Received inventory response for user {0} containing {1} folders and {2} items",
82 userID, folders.Count, items.Count);
83
84 callback(folders, items);
81 } 85 }
82 86
83 public override bool HasInventoryForUser(LLUUID userID) 87 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
44 = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 44 = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
45 45
46 private string _inventoryServerUrl; 46 private string _inventoryServerUrl;
47 private Dictionary<LLUUID, InventoryRequest> m_RequestingInventory = new Dictionary<LLUUID, InventoryRequest>(); 47 private Dictionary<LLUUID, InventoryReceiptCallback> m_RequestingInventory
48 = new Dictionary<LLUUID, InventoryReceiptCallback>();
48 49
49 public OGS1InventoryService(string inventoryServerUrl) 50 public OGS1InventoryService(string inventoryServerUrl)
50 { 51 {
@@ -62,8 +63,7 @@ namespace OpenSim.Region.Communications.OGS1
62 { 63 {
63 if (!m_RequestingInventory.ContainsKey(userID)) 64 if (!m_RequestingInventory.ContainsKey(userID))
64 { 65 {
65 InventoryRequest request = new InventoryRequest(userID, callback); 66 m_RequestingInventory.Add(userID, callback);
66 m_RequestingInventory.Add(userID, request);
67 67
68 try 68 try
69 { 69 {
@@ -103,7 +103,7 @@ namespace OpenSim.Region.Communications.OGS1
103 userID, response.Folders.Count, response.Items.Count); 103 userID, response.Folders.Count, response.Items.Count);
104 104
105 InventoryFolderImpl rootFolder = null; 105 InventoryFolderImpl rootFolder = null;
106 InventoryRequest request = m_RequestingInventory[userID]; 106 InventoryReceiptCallback callback = m_RequestingInventory[userID];
107 107
108 ICollection<InventoryFolderImpl> folders = new List<InventoryFolderImpl>(); 108 ICollection<InventoryFolderImpl> folders = new List<InventoryFolderImpl>();
109 ICollection<InventoryItemBase> items = new List<InventoryItemBase>(); 109 ICollection<InventoryItemBase> items = new List<InventoryItemBase>();
@@ -139,7 +139,7 @@ namespace OpenSim.Region.Communications.OGS1
139 m_log.ErrorFormat("[OGS1 INVENTORY SERVICE]: Did not get back an inventory containing a root folder for user {0}", userID); 139 m_log.ErrorFormat("[OGS1 INVENTORY SERVICE]: Did not get back an inventory containing a root folder for user {0}", userID);
140 } 140 }
141 141
142 request.Callback(userID, folders, items); 142 callback(folders, items);
143 143
144 m_RequestingInventory.Remove(userID); 144 m_RequestingInventory.Remove(userID);
145 } 145 }
@@ -289,20 +289,5 @@ namespace OpenSim.Region.Communications.OGS1
289 } 289 }
290 290
291 #endregion 291 #endregion
292
293 /// <summary>
294 /// Caches a pending inventory request that has yet to be satisfied by the inventory service
295 /// </summary>
296 public class InventoryRequest
297 {
298 public LLUUID UserID;
299 public InventoryReceiptCallback Callback;
300
301 public InventoryRequest(LLUUID userId, InventoryReceiptCallback callback)
302 {
303 UserID = userId;
304 Callback = callback;
305 }
306 }
307 } 292 }
308} 293}