aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-05-01 21:22:03 +0000
committerJustin Clarke Casey2008-05-01 21:22:03 +0000
commita81edef2b9b32c6697a46f504af679185aab3ceb (patch)
tree582ee52cc62a01175a6fa693b70c37f36ee2ac19
parent* Refactor: Remove the unused userID parameter that was being passed into alm... (diff)
downloadopensim-SC-a81edef2b9b32c6697a46f504af679185aab3ceb.zip
opensim-SC-a81edef2b9b32c6697a46f504af679185aab3ceb.tar.gz
opensim-SC-a81edef2b9b32c6697a46f504af679185aab3ceb.tar.bz2
opensim-SC-a81edef2b9b32c6697a46f504af679185aab3ceb.tar.xz
* Refactor: Remove redundant userID from further up the inventory request chain
-rw-r--r--OpenSim/Framework/Communications/Cache/CachedUserInfo.cs2
-rw-r--r--OpenSim/Framework/Communications/IInventoryServices.cs3
-rw-r--r--OpenSim/Region/Communications/Local/LocalInventoryService.cs6
-rw-r--r--OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs25
4 files changed, 13 insertions, 23 deletions
diff --git a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs
index adf01b9..aa27abd 100644
--- a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs
+++ b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs
@@ -158,7 +158,7 @@ namespace OpenSim.Framework.Communications.Cache
158 /// </summary> 158 /// </summary>
159 /// <param name="userID"></param> 159 /// <param name="userID"></param>
160 /// <param name="inventoryCollection"></param> 160 /// <param name="inventoryCollection"></param>
161 public void InventoryReceive(LLUUID userID, ICollection<InventoryFolderImpl> folders, ICollection<InventoryItemBase> items) 161 public void InventoryReceive(ICollection<InventoryFolderImpl> folders, ICollection<InventoryItemBase> items)
162 { 162 {
163 // FIXME: Exceptions thrown upwards never appear on the console. Could fix further up if these 163 // FIXME: Exceptions thrown upwards never appear on the console. Could fix further up if these
164 // are simply being swallowed 164 // are simply being swallowed
diff --git a/OpenSim/Framework/Communications/IInventoryServices.cs b/OpenSim/Framework/Communications/IInventoryServices.cs
index 5907c38..c8a3c85 100644
--- a/OpenSim/Framework/Communications/IInventoryServices.cs
+++ b/OpenSim/Framework/Communications/IInventoryServices.cs
@@ -34,7 +34,8 @@ namespace OpenSim.Framework.Communications
34 /// <summary> 34 /// <summary>
35 /// Callback used when a user's inventory is received from the inventory service 35 /// Callback used when a user's inventory is received from the inventory service
36 /// </summary> 36 /// </summary>
37 public delegate void InventoryReceiptCallback(LLUUID userId, ICollection<InventoryFolderImpl> folders, ICollection<InventoryItemBase> items); 37 public delegate void InventoryReceiptCallback(
38 ICollection<InventoryFolderImpl> folders, ICollection<InventoryItemBase> items);
38 39
39 /// <summary> 40 /// <summary>
40 /// Defines all the operations one can perform on a user's inventory. 41 /// Defines all the operations one can perform on a user's inventory.
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}