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 f5a146d..50c51d3 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 24208df..5d20524 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 | ||
@@ -406,6 +422,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
406 | previousParentFolderID = folder.ParentID; | 422 | previousParentFolderID = folder.ParentID; |
407 | folder.ParentID = trashFolder.ID; | 423 | folder.ParentID = trashFolder.ID; |
408 | invService.MoveFolder(folder); | 424 | invService.MoveFolder(folder); |
425 | client.SendBulkUpdateInventory(folder); | ||
409 | } | 426 | } |
410 | } | 427 | } |
411 | 428 | ||
@@ -519,22 +536,113 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
519 | /// | 536 | /// |
520 | /// </summary> | 537 | /// </summary> |
521 | /// <param name="msg"></param> | 538 | /// <param name="msg"></param> |
522 | private void OnGridInstantMessage(GridInstantMessage msg) | 539 | private void OnGridInstantMessage(GridInstantMessage im) |
523 | { | 540 | { |
524 | // Check if this is ours to handle | 541 | // Check if this is ours to handle |
525 | // | 542 | // |
526 | Scene scene = FindClientScene(new UUID(msg.toAgentID)); | 543 | Scene scene = FindClientScene(new UUID(im.toAgentID)); |
527 | 544 | ||
528 | if (scene == null) | 545 | if (scene == null) |
529 | return; | 546 | return; |
530 | 547 | ||
531 | // Find agent to deliver to | 548 | // Find agent to deliver to |
532 | // | 549 | // |
533 | ScenePresence user = scene.GetScenePresence(new UUID(msg.toAgentID)); | 550 | ScenePresence user = scene.GetScenePresence(new UUID(im.toAgentID)); |
551 | if (user == null) | ||
552 | return; | ||
553 | |||
554 | // This requires a little bit of processing because we have to make the | ||
555 | // new item visible in the recipient's inventory here | ||
556 | // | ||
557 | if (im.dialog == (byte) InstantMessageDialog.InventoryOffered) | ||
558 | { | ||
559 | if (im.binaryBucket.Length < 17) // Invalid | ||
560 | return; | ||
561 | |||
562 | UUID recipientID = new UUID(im.toAgentID); | ||
563 | |||
564 | // First byte is the asset type | ||
565 | AssetType assetType = (AssetType)im.binaryBucket[0]; | ||
566 | |||
567 | if (AssetType.Folder == assetType) | ||
568 | { | ||
569 | UUID folderID = new UUID(im.binaryBucket, 1); | ||
534 | 570 | ||
535 | // Just forward to local handling | 571 | InventoryFolderBase given = |
536 | OnInstantMessage(user.ControllingClient, msg); | 572 | new InventoryFolderBase(folderID, recipientID); |
573 | InventoryFolderBase folder = | ||
574 | scene.InventoryService.GetFolder(given); | ||
537 | 575 | ||
576 | if (folder != null) | ||
577 | user.ControllingClient.SendBulkUpdateInventory(folder); | ||
578 | } | ||
579 | else | ||
580 | { | ||
581 | UUID itemID = new UUID(im.binaryBucket, 1); | ||
582 | |||
583 | InventoryItemBase given = | ||
584 | new InventoryItemBase(itemID, recipientID); | ||
585 | InventoryItemBase item = | ||
586 | scene.InventoryService.GetItem(given); | ||
587 | |||
588 | if (item != null) | ||
589 | { | ||
590 | user.ControllingClient.SendBulkUpdateInventory(item); | ||
591 | } | ||
592 | } | ||
593 | user.ControllingClient.SendInstantMessage(im); | ||
594 | } | ||
595 | if (im.dialog == (byte) InstantMessageDialog.TaskInventoryOffered) | ||
596 | { | ||
597 | if (im.binaryBucket.Length < 1) // Invalid | ||
598 | return; | ||
599 | |||
600 | UUID recipientID = new UUID(im.toAgentID); | ||
601 | |||
602 | // Bucket is the asset type | ||
603 | AssetType assetType = (AssetType)im.binaryBucket[0]; | ||
604 | |||
605 | if (AssetType.Folder == assetType) | ||
606 | { | ||
607 | UUID folderID = new UUID(im.imSessionID); | ||
608 | |||
609 | InventoryFolderBase given = | ||
610 | new InventoryFolderBase(folderID, recipientID); | ||
611 | InventoryFolderBase folder = | ||
612 | scene.InventoryService.GetFolder(given); | ||
613 | |||
614 | if (folder != null) | ||
615 | user.ControllingClient.SendBulkUpdateInventory(folder); | ||
616 | } | ||
617 | else | ||
618 | { | ||
619 | UUID itemID = new UUID(im.imSessionID); | ||
620 | |||
621 | InventoryItemBase given = | ||
622 | new InventoryItemBase(itemID, recipientID); | ||
623 | InventoryItemBase item = | ||
624 | scene.InventoryService.GetItem(given); | ||
625 | |||
626 | if (item != null) | ||
627 | { | ||
628 | user.ControllingClient.SendBulkUpdateInventory(item); | ||
629 | } | ||
630 | } | ||
631 | |||
632 | // Fix up binary bucket since this may be 17 chars long here | ||
633 | Byte[] bucket = new Byte[1]; | ||
634 | bucket[0] = im.binaryBucket[0]; | ||
635 | im.binaryBucket = bucket; | ||
636 | |||
637 | user.ControllingClient.SendInstantMessage(im); | ||
638 | } | ||
639 | else if (im.dialog == (byte) InstantMessageDialog.InventoryAccepted || | ||
640 | im.dialog == (byte) InstantMessageDialog.InventoryDeclined || | ||
641 | im.dialog == (byte) InstantMessageDialog.TaskInventoryDeclined || | ||
642 | im.dialog == (byte) InstantMessageDialog.TaskInventoryAccepted) | ||
643 | { | ||
644 | user.ControllingClient.SendInstantMessage(im); | ||
645 | } | ||
538 | } | 646 | } |
539 | } | 647 | } |
540 | } | 648 | } |