diff options
author | UbitUmarov | 2018-11-13 00:58:27 +0000 |
---|---|---|
committer | UbitUmarov | 2018-11-13 00:58:27 +0000 |
commit | cc10cd2161ab6bc8fe20485e8265c64a5697264b (patch) | |
tree | 4f05a20ebd4e7d9b387b0e0b1d943c2bcf4c6b16 | |
parent | similar changes on CopyBundleToInventory (diff) | |
download | opensim-SC-cc10cd2161ab6bc8fe20485e8265c64a5697264b.zip opensim-SC-cc10cd2161ab6bc8fe20485e8265c64a5697264b.tar.gz opensim-SC-cc10cd2161ab6bc8fe20485e8265c64a5697264b.tar.bz2 opensim-SC-cc10cd2161ab6bc8fe20485e8265c64a5697264b.tar.xz |
oops
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs | 127 |
1 files changed, 64 insertions, 63 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs index d8b7072..f388064 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs | |||
@@ -521,9 +521,10 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
521 | objlist[0].OwnerID.ToString()); | 521 | objlist[0].OwnerID.ToString()); |
522 | m_Scene.AssetService.Store(asset); | 522 | m_Scene.AssetService.Store(asset); |
523 | 523 | ||
524 | item.AssetID = asset.FullID; | ||
525 | item.Description = desc; | 524 | item.Description = desc; |
526 | item.Name = name; | 525 | item.Name = name; |
526 | item.AssetType = (int)AssetType.Object; | ||
527 | item.AssetID = asset.FullID; | ||
527 | 528 | ||
528 | if (DeRezAction.SaveToExistingUserInventoryItem == action) | 529 | if (DeRezAction.SaveToExistingUserInventoryItem == action) |
529 | { | 530 | { |
@@ -696,95 +697,95 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
696 | 697 | ||
697 | return null; | 698 | return null; |
698 | } | 699 | } |
700 | return item; | ||
699 | } | 701 | } |
700 | else | 702 | |
703 | // Folder magic | ||
704 | // | ||
705 | if (action == DeRezAction.Delete) | ||
701 | { | 706 | { |
702 | // Folder magic | 707 | // Deleting someone else's item |
703 | // | 708 | // |
704 | if (action == DeRezAction.Delete) | 709 | if (remoteClient == null || |
710 | so.OwnerID != remoteClient.AgentId) | ||
705 | { | 711 | { |
706 | // Deleting someone else's item | 712 | folder = m_Scene.InventoryService.GetFolderForType(userID, FolderType.LostAndFound); |
707 | // | ||
708 | if (remoteClient == null || | ||
709 | so.OwnerID != remoteClient.AgentId) | ||
710 | { | ||
711 | folder = m_Scene.InventoryService.GetFolderForType(userID, FolderType.LostAndFound); | ||
712 | } | ||
713 | else | ||
714 | { | ||
715 | folder = m_Scene.InventoryService.GetFolderForType(userID, FolderType.Trash); | ||
716 | } | ||
717 | } | 713 | } |
718 | else if (action == DeRezAction.Return) | 714 | else |
719 | { | 715 | { |
720 | // Dump to lost + found unconditionally | 716 | folder = m_Scene.InventoryService.GetFolderForType(userID, FolderType.Trash); |
721 | // | ||
722 | folder = m_Scene.InventoryService.GetFolderForType(userID, FolderType.LostAndFound); | ||
723 | } | 717 | } |
718 | } | ||
719 | else if (action == DeRezAction.Return) | ||
720 | { | ||
721 | // Dump to lost + found unconditionally | ||
722 | // | ||
723 | folder = m_Scene.InventoryService.GetFolderForType(userID, FolderType.LostAndFound); | ||
724 | } | ||
724 | 725 | ||
725 | if (folderID == UUID.Zero && folder == null) | 726 | if (folderID == UUID.Zero && folder == null) |
727 | { | ||
728 | if (action == DeRezAction.Delete) | ||
729 | { | ||
730 | // Deletes go to trash by default | ||
731 | // | ||
732 | folder = m_Scene.InventoryService.GetFolderForType(userID, FolderType.Trash); | ||
733 | } | ||
734 | else | ||
726 | { | 735 | { |
727 | if (action == DeRezAction.Delete) | 736 | if (remoteClient == null || so.RootPart.OwnerID != remoteClient.AgentId) |
728 | { | 737 | { |
729 | // Deletes go to trash by default | 738 | // Taking copy of another person's item. Take to |
730 | // | 739 | // Objects folder. |
731 | folder = m_Scene.InventoryService.GetFolderForType(userID, FolderType.Trash); | 740 | folder = m_Scene.InventoryService.GetFolderForType(userID, FolderType.Object); |
741 | so.FromFolderID = UUID.Zero; | ||
732 | } | 742 | } |
733 | else | 743 | else |
734 | { | 744 | { |
735 | if (remoteClient == null || so.RootPart.OwnerID != remoteClient.AgentId) | 745 | // Catch all. Use lost & found |
736 | { | 746 | // |
737 | // Taking copy of another person's item. Take to | 747 | folder = m_Scene.InventoryService.GetFolderForType(userID, FolderType.LostAndFound); |
738 | // Objects folder. | ||
739 | folder = m_Scene.InventoryService.GetFolderForType(userID, FolderType.Object); | ||
740 | so.FromFolderID = UUID.Zero; | ||
741 | } | ||
742 | else | ||
743 | { | ||
744 | // Catch all. Use lost & found | ||
745 | // | ||
746 | folder = m_Scene.InventoryService.GetFolderForType(userID, FolderType.LostAndFound); | ||
747 | } | ||
748 | } | 748 | } |
749 | } | 749 | } |
750 | } | ||
750 | 751 | ||
751 | // Override and put into where it came from, if it came | 752 | // Override and put into where it came from, if it came |
752 | // from anywhere in inventory and the owner is taking it back. | 753 | // from anywhere in inventory and the owner is taking it back. |
753 | // | 754 | // |
754 | if (action == DeRezAction.Take || action == DeRezAction.TakeCopy) | 755 | if (action == DeRezAction.Take || action == DeRezAction.TakeCopy) |
756 | { | ||
757 | if (so.FromFolderID != UUID.Zero && so.RootPart.OwnerID == remoteClient.AgentId) | ||
755 | { | 758 | { |
756 | if (so.FromFolderID != UUID.Zero && so.RootPart.OwnerID == remoteClient.AgentId) | 759 | folder = m_Scene.InventoryService.GetFolder(userID, so.FromFolderID); |
757 | { | ||
758 | folder = m_Scene.InventoryService.GetFolder(userID, so.FromFolderID); | ||
759 | 760 | ||
760 | if(folder.Type == 14 || folder.Type == 16) | 761 | if(folder.Type == 14 || folder.Type == 16) |
761 | { | 762 | { |
762 | // folder.Type = 6; | 763 | // folder.Type = 6; |
763 | folder = m_Scene.InventoryService.GetFolderForType(userID, FolderType.Object); | 764 | folder = m_Scene.InventoryService.GetFolderForType(userID, FolderType.Object); |
764 | } | ||
765 | } | 765 | } |
766 | } | 766 | } |
767 | } | ||
767 | 768 | ||
768 | if (folder == null) // None of the above | 769 | if (folder == null) // None of the above |
769 | { | 770 | { |
770 | folder = new InventoryFolderBase(folderID); | 771 | folder = new InventoryFolderBase(folderID); |
771 | 772 | ||
772 | if (folder == null) // Nowhere to put it | 773 | if (folder == null) // Nowhere to put it |
773 | { | 774 | { |
774 | return null; | 775 | return null; |
775 | } | ||
776 | } | 776 | } |
777 | |||
778 | item = new InventoryItemBase(); | ||
779 | item.ID = UUID.Random(); | ||
780 | item.InvType = (int)InventoryType.Object; | ||
781 | item.Folder = folder.ID; | ||
782 | item.Owner = userID; | ||
783 | item.CreationDate = Util.UnixTimeSinceEpoch(); | ||
784 | } | 777 | } |
785 | 778 | ||
779 | item = new InventoryItemBase(); | ||
780 | item.ID = UUID.Random(); | ||
781 | item.InvType = (int)InventoryType.Object; | ||
782 | item.Folder = folder.ID; | ||
783 | item.Owner = userID; | ||
784 | item.CreationDate = Util.UnixTimeSinceEpoch(); | ||
785 | |||
786 | return item; | 786 | return item; |
787 | } | 787 | } |
788 | |||
788 | // compatibility do not use | 789 | // compatibility do not use |
789 | public virtual SceneObjectGroup RezObject( | 790 | public virtual SceneObjectGroup RezObject( |
790 | IClientAPI remoteClient, UUID itemID, Vector3 RayEnd, Vector3 RayStart, | 791 | IClientAPI remoteClient, UUID itemID, Vector3 RayEnd, Vector3 RayStart, |