diff options
author | Justin Clarke Casey | 2008-05-01 21:22:03 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-05-01 21:22:03 +0000 |
commit | a81edef2b9b32c6697a46f504af679185aab3ceb (patch) | |
tree | 582ee52cc62a01175a6fa693b70c37f36ee2ac19 /OpenSim/Region/Communications/OGS1 | |
parent | * Refactor: Remove the unused userID parameter that was being passed into alm... (diff) | |
download | opensim-SC_OLD-a81edef2b9b32c6697a46f504af679185aab3ceb.zip opensim-SC_OLD-a81edef2b9b32c6697a46f504af679185aab3ceb.tar.gz opensim-SC_OLD-a81edef2b9b32c6697a46f504af679185aab3ceb.tar.bz2 opensim-SC_OLD-a81edef2b9b32c6697a46f504af679185aab3ceb.tar.xz |
* Refactor: Remove redundant userID from further up the inventory request chain
Diffstat (limited to 'OpenSim/Region/Communications/OGS1')
-rw-r--r-- | OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs | 25 |
1 files changed, 5 insertions, 20 deletions
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 | } |