diff options
author | Melanie | 2010-11-04 19:07:43 +0100 |
---|---|---|
committer | Melanie | 2010-11-04 19:07:43 +0100 |
commit | 82e534a0291c2a2c54ad95991d7b8ed6b6524839 (patch) | |
tree | 55d8565381864f389f494c7bac2373d5a81e3dd1 /OpenSim/Region/CoreModules/Avatar | |
parent | Fix creation of a duplicate physics actor on chained drag-copy operations, (diff) | |
download | opensim-SC-82e534a0291c2a2c54ad95991d7b8ed6b6524839.zip opensim-SC-82e534a0291c2a2c54ad95991d7b8ed6b6524839.tar.gz opensim-SC-82e534a0291c2a2c54ad95991d7b8ed6b6524839.tar.bz2 opensim-SC-82e534a0291c2a2c54ad95991d7b8ed6b6524839.tar.xz |
Fix avatar to avatar inventory gives across servers
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs | 58 |
1 files changed, 50 insertions, 8 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs index 6badc74..e9e7c25 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs | |||
@@ -175,8 +175,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
175 | if (im.binaryBucket.Length < 17) // Invalid | 175 | if (im.binaryBucket.Length < 17) // Invalid |
176 | return; | 176 | return; |
177 | 177 | ||
178 | UUID receipientID = new UUID(im.toAgentID); | 178 | UUID recipientID = new UUID(im.toAgentID); |
179 | ScenePresence user = scene.GetScenePresence(receipientID); | 179 | ScenePresence user = scene.GetScenePresence(recipientID); |
180 | UUID copyID; | 180 | UUID copyID; |
181 | 181 | ||
182 | // First byte is the asset type | 182 | // First byte is the asset type |
@@ -191,7 +191,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
191 | folderID, new UUID(im.toAgentID)); | 191 | folderID, new UUID(im.toAgentID)); |
192 | 192 | ||
193 | InventoryFolderBase folderCopy | 193 | InventoryFolderBase folderCopy |
194 | = scene.GiveInventoryFolder(receipientID, client.AgentId, folderID, UUID.Zero); | 194 | = scene.GiveInventoryFolder(recipientID, client.AgentId, folderID, UUID.Zero); |
195 | 195 | ||
196 | if (folderCopy == null) | 196 | if (folderCopy == null) |
197 | { | 197 | { |
@@ -419,22 +419,64 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
419 | /// | 419 | /// |
420 | /// </summary> | 420 | /// </summary> |
421 | /// <param name="msg"></param> | 421 | /// <param name="msg"></param> |
422 | private void OnGridInstantMessage(GridInstantMessage msg) | 422 | private void OnGridInstantMessage(GridInstantMessage im) |
423 | { | 423 | { |
424 | // Check if this is ours to handle | 424 | // Check if this is ours to handle |
425 | // | 425 | // |
426 | Scene scene = FindClientScene(new UUID(msg.toAgentID)); | 426 | Scene scene = FindClientScene(new UUID(im.toAgentID)); |
427 | 427 | ||
428 | if (scene == null) | 428 | if (scene == null) |
429 | return; | 429 | return; |
430 | 430 | ||
431 | // Find agent to deliver to | 431 | // Find agent to deliver to |
432 | // | 432 | // |
433 | ScenePresence user = scene.GetScenePresence(new UUID(msg.toAgentID)); | 433 | ScenePresence user = scene.GetScenePresence(new UUID(im.toAgentID)); |
434 | if (user == null) | ||
435 | return; | ||
436 | |||
437 | // This requires a little bit of processing because we have to make the | ||
438 | // new item visible in the recipient's inventory here | ||
439 | // | ||
440 | if (im.dialog == (byte) InstantMessageDialog.InventoryOffered) | ||
441 | { | ||
442 | if (im.binaryBucket.Length < 17) // Invalid | ||
443 | return; | ||
444 | |||
445 | UUID recipientID = new UUID(im.toAgentID); | ||
446 | |||
447 | // First byte is the asset type | ||
448 | AssetType assetType = (AssetType)im.binaryBucket[0]; | ||
449 | |||
450 | if (AssetType.Folder == assetType) | ||
451 | { | ||
452 | UUID folderID = new UUID(im.binaryBucket, 1); | ||
434 | 453 | ||
435 | // Just forward to local handling | 454 | InventoryFolderBase given = |
436 | OnInstantMessage(user.ControllingClient, msg); | 455 | new InventoryFolderBase(folderID, recipientID); |
456 | InventoryFolderBase folder = | ||
457 | scene.InventoryService.GetFolder(given); | ||
458 | |||
459 | if (folder != null) | ||
460 | user.ControllingClient.SendBulkUpdateInventory(folder); | ||
461 | } | ||
462 | else | ||
463 | { | ||
464 | UUID itemID = new UUID(im.binaryBucket, 1); | ||
465 | |||
466 | InventoryItemBase given = | ||
467 | new InventoryItemBase(itemID, recipientID); | ||
468 | InventoryItemBase item = | ||
469 | scene.InventoryService.GetItem(given); | ||
470 | |||
471 | if (item != null) | ||
472 | { | ||
473 | user.ControllingClient.SendBulkUpdateInventory(item); | ||
474 | } | ||
475 | } | ||
476 | } | ||
437 | 477 | ||
478 | // Just forward to the client | ||
479 | user.ControllingClient.SendInstantMessage(im); | ||
438 | } | 480 | } |
439 | } | 481 | } |
440 | } | 482 | } |