diff options
author | Diva Canto | 2009-08-19 10:56:08 -0700 |
---|---|---|
committer | Diva Canto | 2009-08-19 10:56:08 -0700 |
commit | d519f1885f587409592cf92bc0f4ba8533a1866f (patch) | |
tree | dc8d0073d09050c8787121290b1e3a8f65119812 /OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |
parent | Async purge so that the client thread doesn't wait. (diff) | |
download | opensim-SC-d519f1885f587409592cf92bc0f4ba8533a1866f.zip opensim-SC-d519f1885f587409592cf92bc0f4ba8533a1866f.tar.gz opensim-SC-d519f1885f587409592cf92bc0f4ba8533a1866f.tar.bz2 opensim-SC-d519f1885f587409592cf92bc0f4ba8533a1866f.tar.xz |
Added MoveItems, which is most useful upon viewer-delete inventory operation. Moving a batch of items is a 1-time operation. Made it async anyway, so that the viewer doesn't wait in case the DB layer is dumb (which is the case currently).
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.Inventory.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 31 |
1 files changed, 4 insertions, 27 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 5e2eb73..a119efc 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -638,36 +638,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
638 | /// <param name="itemID"></param> | 638 | /// <param name="itemID"></param> |
639 | /// <param name="length"></param> | 639 | /// <param name="length"></param> |
640 | /// <param name="newName"></param> | 640 | /// <param name="newName"></param> |
641 | public void MoveInventoryItem(IClientAPI remoteClient, UUID folderID, UUID itemID, int length, | 641 | public void MoveInventoryItem(IClientAPI remoteClient, List<InventoryItemBase> items) |
642 | string newName) | ||
643 | { | 642 | { |
644 | m_log.DebugFormat( | 643 | m_log.DebugFormat( |
645 | "[AGENT INVENTORY]: Moving item {0} to {1} for {2}", itemID, folderID, remoteClient.AgentId); | 644 | "[AGENT INVENTORY]: Moving {0} items for user {1}", items.Count, remoteClient.AgentId); |
646 | 645 | ||
647 | InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); | 646 | if (!InventoryService.MoveItems(remoteClient.AgentId, items)) |
648 | item = InventoryService.GetItem(item); | 647 | m_log.Warn("[AGENT INVENTORY]: Failed to move items for user " + remoteClient.AgentId); |
649 | |||
650 | if (item != null) | ||
651 | { | ||
652 | if (newName != String.Empty) | ||
653 | { | ||
654 | item.Name = newName; | ||
655 | } | ||
656 | item.Folder = folderID; | ||
657 | |||
658 | // Diva comment: can't we just update? | ||
659 | List<UUID> uuids = new List<UUID>(); | ||
660 | uuids.Add(item.ID); | ||
661 | InventoryService.DeleteItems(item.Owner, uuids); | ||
662 | |||
663 | AddInventoryItem(remoteClient, item); | ||
664 | } | ||
665 | else | ||
666 | { | ||
667 | m_log.Warn("[AGENT INVENTORY]: Failed to find item " + itemID.ToString()); | ||
668 | |||
669 | return; | ||
670 | } | ||
671 | } | 648 | } |
672 | 649 | ||
673 | /// <summary> | 650 | /// <summary> |