diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar/Inventory')
3 files changed, 142 insertions, 31 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs index ee10d04..0833154 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs | |||
@@ -635,4 +635,4 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
635 | m_assetsLoaded = true; | 635 | m_assetsLoaded = true; |
636 | } | 636 | } |
637 | } | 637 | } |
638 | } \ No newline at end of file | 638 | } |
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs index 849449b..f4f9e2d 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs | |||
@@ -519,6 +519,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
519 | return null; | 519 | return null; |
520 | } | 520 | } |
521 | 521 | ||
522 | return account; | ||
523 | /* | ||
522 | try | 524 | try |
523 | { | 525 | { |
524 | string encpass = Util.Md5Hash(pass); | 526 | string encpass = Util.Md5Hash(pass); |
@@ -539,6 +541,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
539 | m_log.ErrorFormat("[INVENTORY ARCHIVER]: Could not authenticate password, {0}", e.Message); | 541 | m_log.ErrorFormat("[INVENTORY ARCHIVER]: Could not authenticate password, {0}", e.Message); |
540 | return null; | 542 | return null; |
541 | } | 543 | } |
544 | */ | ||
542 | } | 545 | } |
543 | 546 | ||
544 | /// <summary> | 547 | /// <summary> |
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs index 5d4fec1..d41691a 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 | { |
@@ -244,6 +244,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
244 | im.imSessionID = itemID.Guid; | 244 | im.imSessionID = itemID.Guid; |
245 | } | 245 | } |
246 | 246 | ||
247 | im.offline = 0; | ||
248 | |||
247 | // Send the IM to the recipient. The item is already | 249 | // Send the IM to the recipient. The item is already |
248 | // in their inventory, so it will not be lost if | 250 | // in their inventory, so it will not be lost if |
249 | // they are offline. | 251 | // they are offline. |
@@ -263,8 +265,42 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
263 | }); | 265 | }); |
264 | } | 266 | } |
265 | } | 267 | } |
266 | else if (im.dialog == (byte) InstantMessageDialog.InventoryAccepted) | 268 | else if (im.dialog == (byte) InstantMessageDialog.InventoryAccepted || |
269 | im.dialog == (byte) InstantMessageDialog.TaskInventoryAccepted) | ||
267 | { | 270 | { |
271 | UUID inventoryID = new UUID(im.imSessionID); // The inventory item/folder, back from it's trip | ||
272 | IInventoryService invService = scene.InventoryService; | ||
273 | |||
274 | // Special case: folder redirect. | ||
275 | // RLV uses this | ||
276 | if (im.dialog == (byte) InstantMessageDialog.TaskInventoryAccepted) | ||
277 | { | ||
278 | InventoryFolderBase folder = new InventoryFolderBase(inventoryID, client.AgentId); | ||
279 | folder = invService.GetFolder(folder); | ||
280 | |||
281 | if (folder != null) | ||
282 | { | ||
283 | if (im.binaryBucket.Length >= 16) | ||
284 | { | ||
285 | UUID destFolderID = new UUID(im.binaryBucket, 0); | ||
286 | if (destFolderID != UUID.Zero) | ||
287 | { | ||
288 | InventoryFolderBase destFolder = new InventoryFolderBase(destFolderID, client.AgentId); | ||
289 | destFolder = invService.GetFolder(destFolder); | ||
290 | if (destFolder != null) | ||
291 | { | ||
292 | if (folder.ParentID != destFolder.ID) | ||
293 | { | ||
294 | folder.ParentID = destFolder.ID; | ||
295 | invService.MoveFolder(folder); | ||
296 | client.SendBulkUpdateInventory(folder); | ||
297 | } | ||
298 | } | ||
299 | } | ||
300 | } | ||
301 | } | ||
302 | } | ||
303 | |||
268 | ScenePresence user = scene.GetScenePresence(new UUID(im.toAgentID)); | 304 | ScenePresence user = scene.GetScenePresence(new UUID(im.toAgentID)); |
269 | 305 | ||
270 | if (user != null) // Local | 306 | if (user != null) // Local |
@@ -274,27 +310,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
274 | else | 310 | else |
275 | { | 311 | { |
276 | if (m_TransferModule != null) | 312 | if (m_TransferModule != null) |
277 | m_TransferModule.SendInstantMessage(im, delegate(bool success) { | 313 | m_TransferModule.SendInstantMessage(im, delegate(bool success) {}); |
278 | |||
279 | // justincc - FIXME: Comment out for now. This code was added in commit db91044 Mon Aug 22 2011 | ||
280 | // and is apparently supposed to fix bulk inventory updates after accepting items. But | ||
281 | // instead it appears to cause two copies of an accepted folder for the receiving user in | ||
282 | // at least some cases. Folder/item update is already done when the offer is made (see code above) | ||
283 | |||
284 | // // Send BulkUpdateInventory | ||
285 | // IInventoryService invService = scene.InventoryService; | ||
286 | // UUID inventoryEntityID = new UUID(im.imSessionID); // The inventory item /folder, back from it's trip | ||
287 | // | ||
288 | // InventoryFolderBase folder = new InventoryFolderBase(inventoryEntityID, client.AgentId); | ||
289 | // folder = invService.GetFolder(folder); | ||
290 | // | ||
291 | // ScenePresence fromUser = scene.GetScenePresence(new UUID(im.fromAgentID)); | ||
292 | // | ||
293 | // // If the user has left the scene by the time the message comes back then we can't send | ||
294 | // // them the update. | ||
295 | // if (fromUser != null) | ||
296 | // fromUser.ControllingClient.SendBulkUpdateInventory(folder); | ||
297 | }); | ||
298 | } | 314 | } |
299 | } | 315 | } |
300 | 316 | ||
@@ -409,6 +425,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
409 | previousParentFolderID = folder.ParentID; | 425 | previousParentFolderID = folder.ParentID; |
410 | folder.ParentID = trashFolder.ID; | 426 | folder.ParentID = trashFolder.ID; |
411 | invService.MoveFolder(folder); | 427 | invService.MoveFolder(folder); |
428 | client.SendBulkUpdateInventory(folder); | ||
412 | } | 429 | } |
413 | } | 430 | } |
414 | 431 | ||
@@ -522,22 +539,113 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
522 | /// | 539 | /// |
523 | /// </summary> | 540 | /// </summary> |
524 | /// <param name="msg"></param> | 541 | /// <param name="msg"></param> |
525 | private void OnGridInstantMessage(GridInstantMessage msg) | 542 | private void OnGridInstantMessage(GridInstantMessage im) |
526 | { | 543 | { |
527 | // Check if this is ours to handle | 544 | // Check if this is ours to handle |
528 | // | 545 | // |
529 | Scene scene = FindClientScene(new UUID(msg.toAgentID)); | 546 | Scene scene = FindClientScene(new UUID(im.toAgentID)); |
530 | 547 | ||
531 | if (scene == null) | 548 | if (scene == null) |
532 | return; | 549 | return; |
533 | 550 | ||
534 | // Find agent to deliver to | 551 | // Find agent to deliver to |
535 | // | 552 | // |
536 | ScenePresence user = scene.GetScenePresence(new UUID(msg.toAgentID)); | 553 | ScenePresence user = scene.GetScenePresence(new UUID(im.toAgentID)); |
554 | if (user == null) | ||
555 | return; | ||
556 | |||
557 | // This requires a little bit of processing because we have to make the | ||
558 | // new item visible in the recipient's inventory here | ||
559 | // | ||
560 | if (im.dialog == (byte) InstantMessageDialog.InventoryOffered) | ||
561 | { | ||
562 | if (im.binaryBucket.Length < 17) // Invalid | ||
563 | return; | ||
564 | |||
565 | UUID recipientID = new UUID(im.toAgentID); | ||
566 | |||
567 | // First byte is the asset type | ||
568 | AssetType assetType = (AssetType)im.binaryBucket[0]; | ||
569 | |||
570 | if (AssetType.Folder == assetType) | ||
571 | { | ||
572 | UUID folderID = new UUID(im.binaryBucket, 1); | ||
537 | 573 | ||
538 | // Just forward to local handling | 574 | InventoryFolderBase given = |
539 | OnInstantMessage(user.ControllingClient, msg); | 575 | new InventoryFolderBase(folderID, recipientID); |
576 | InventoryFolderBase folder = | ||
577 | scene.InventoryService.GetFolder(given); | ||
540 | 578 | ||
579 | if (folder != null) | ||
580 | user.ControllingClient.SendBulkUpdateInventory(folder); | ||
581 | } | ||
582 | else | ||
583 | { | ||
584 | UUID itemID = new UUID(im.binaryBucket, 1); | ||
585 | |||
586 | InventoryItemBase given = | ||
587 | new InventoryItemBase(itemID, recipientID); | ||
588 | InventoryItemBase item = | ||
589 | scene.InventoryService.GetItem(given); | ||
590 | |||
591 | if (item != null) | ||
592 | { | ||
593 | user.ControllingClient.SendBulkUpdateInventory(item); | ||
594 | } | ||
595 | } | ||
596 | user.ControllingClient.SendInstantMessage(im); | ||
597 | } | ||
598 | if (im.dialog == (byte) InstantMessageDialog.TaskInventoryOffered) | ||
599 | { | ||
600 | if (im.binaryBucket.Length < 1) // Invalid | ||
601 | return; | ||
602 | |||
603 | UUID recipientID = new UUID(im.toAgentID); | ||
604 | |||
605 | // Bucket is the asset type | ||
606 | AssetType assetType = (AssetType)im.binaryBucket[0]; | ||
607 | |||
608 | if (AssetType.Folder == assetType) | ||
609 | { | ||
610 | UUID folderID = new UUID(im.imSessionID); | ||
611 | |||
612 | InventoryFolderBase given = | ||
613 | new InventoryFolderBase(folderID, recipientID); | ||
614 | InventoryFolderBase folder = | ||
615 | scene.InventoryService.GetFolder(given); | ||
616 | |||
617 | if (folder != null) | ||
618 | user.ControllingClient.SendBulkUpdateInventory(folder); | ||
619 | } | ||
620 | else | ||
621 | { | ||
622 | UUID itemID = new UUID(im.imSessionID); | ||
623 | |||
624 | InventoryItemBase given = | ||
625 | new InventoryItemBase(itemID, recipientID); | ||
626 | InventoryItemBase item = | ||
627 | scene.InventoryService.GetItem(given); | ||
628 | |||
629 | if (item != null) | ||
630 | { | ||
631 | user.ControllingClient.SendBulkUpdateInventory(item); | ||
632 | } | ||
633 | } | ||
634 | |||
635 | // Fix up binary bucket since this may be 17 chars long here | ||
636 | Byte[] bucket = new Byte[1]; | ||
637 | bucket[0] = im.binaryBucket[0]; | ||
638 | im.binaryBucket = bucket; | ||
639 | |||
640 | user.ControllingClient.SendInstantMessage(im); | ||
641 | } | ||
642 | else if (im.dialog == (byte) InstantMessageDialog.InventoryAccepted || | ||
643 | im.dialog == (byte) InstantMessageDialog.InventoryDeclined || | ||
644 | im.dialog == (byte) InstantMessageDialog.TaskInventoryDeclined || | ||
645 | im.dialog == (byte) InstantMessageDialog.TaskInventoryAccepted) | ||
646 | { | ||
647 | user.ControllingClient.SendInstantMessage(im); | ||
648 | } | ||
541 | } | 649 | } |
542 | } | 650 | } |
543 | } | 651 | } |