diff options
Diffstat (limited to 'OpenSim/Region')
3 files changed, 45 insertions, 2 deletions
diff --git a/OpenSim/Region/Communications/Hypergrid/HGInventoryService.cs b/OpenSim/Region/Communications/Hypergrid/HGInventoryService.cs index 8296910..9d70c46 100644 --- a/OpenSim/Region/Communications/Hypergrid/HGInventoryService.cs +++ b/OpenSim/Region/Communications/Hypergrid/HGInventoryService.cs | |||
@@ -317,6 +317,29 @@ namespace OpenSim.Region.Communications.Hypergrid | |||
317 | 317 | ||
318 | return false; | 318 | return false; |
319 | } | 319 | } |
320 | |||
321 | public InventoryItemBase QueryItem(InventoryItemBase item, UUID session_id) | ||
322 | { | ||
323 | if (IsLocalStandaloneUser(item.Owner)) | ||
324 | { | ||
325 | return base.QueryItem(item); | ||
326 | } | ||
327 | |||
328 | try | ||
329 | { | ||
330 | string invServ = GetUserInventoryURI(item.Owner); | ||
331 | |||
332 | return SynchronousRestSessionObjectPoster<InventoryItemBase, InventoryItemBase>.BeginPostObject( | ||
333 | "POST", invServ + "/QueryItem/", item, session_id.ToString(), item.Owner.ToString()); | ||
334 | } | ||
335 | catch (WebException e) | ||
336 | { | ||
337 | m_log.ErrorFormat("[HGrid INVENTORY SERVICE]: Query inventory item operation failed, {0} {1}", | ||
338 | e.Source, e.Message); | ||
339 | } | ||
340 | |||
341 | return null; | ||
342 | } | ||
320 | #endregion | 343 | #endregion |
321 | 344 | ||
322 | #region Methods common to ISecureInventoryService and IInventoryService | 345 | #region Methods common to ISecureInventoryService and IInventoryService |
diff --git a/OpenSim/Region/Communications/OGS1/OGS1SecureInventoryService.cs b/OpenSim/Region/Communications/OGS1/OGS1SecureInventoryService.cs index 0f4c732..0f50b01 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1SecureInventoryService.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1SecureInventoryService.cs | |||
@@ -296,6 +296,22 @@ namespace OpenSim.Region.Communications.OGS1 | |||
296 | return false; | 296 | return false; |
297 | } | 297 | } |
298 | 298 | ||
299 | public InventoryItemBase QueryItem(InventoryItemBase item, UUID session_id) | ||
300 | { | ||
301 | try | ||
302 | { | ||
303 | return SynchronousRestSessionObjectPoster<InventoryItemBase, InventoryItemBase>.BeginPostObject( | ||
304 | "POST", _inventoryServerUrl + "/QueryItem/", item, session_id.ToString(), item.Owner.ToString()); | ||
305 | } | ||
306 | catch (WebException e) | ||
307 | { | ||
308 | m_log.ErrorFormat("[OGS1 INVENTORY SERVICE]: Query inventory item operation failed, {0} {1}", | ||
309 | e.Source, e.Message); | ||
310 | } | ||
311 | |||
312 | return null; | ||
313 | } | ||
314 | |||
299 | public bool HasInventoryForUser(UUID userID) | 315 | public bool HasInventoryForUser(UUID userID) |
300 | { | 316 | { |
301 | return false; | 317 | return false; |
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs index 147d453..465167a 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs | |||
@@ -433,10 +433,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
433 | else | 433 | else |
434 | { | 434 | { |
435 | UUID itemID = new UUID(msg.binaryBucket, 1); | 435 | UUID itemID = new UUID(msg.binaryBucket, 1); |
436 | InventoryItemBase item = new InventoryItemBase(); | ||
437 | |||
438 | item.ID = itemID; | ||
439 | item.Owner = user.ControllingClient.AgentId; | ||
436 | 440 | ||
437 | // Fetch from database | 441 | // Fetch from database |
438 | // | 442 | // |
439 | if (!userInfo.QueryItem(itemID)) | 443 | if (!userInfo.QueryItem(item)) |
440 | { | 444 | { |
441 | m_log.Debug("[INVENTORY TRANSFER] Can't find item to give"); | 445 | m_log.Debug("[INVENTORY TRANSFER] Can't find item to give"); |
442 | return; | 446 | return; |
@@ -444,7 +448,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
444 | 448 | ||
445 | // Get item info | 449 | // Get item info |
446 | // | 450 | // |
447 | InventoryItemBase item = userInfo.RootFolder.FindItem(itemID); | 451 | item = userInfo.RootFolder.FindItem(item.ID); |
448 | if (item == null) | 452 | if (item == null) |
449 | { | 453 | { |
450 | m_log.Debug("[INVENTORY TRANSFER] Can't retrieve item to give"); | 454 | m_log.Debug("[INVENTORY TRANSFER] Can't retrieve item to give"); |