aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-09-02 00:04:22 +0100
committerJustin Clark-Casey (justincc)2011-09-02 00:04:22 +0100
commit01146bb3e3b60fd3ab54a1321fb58fe2e8cfbf1e (patch)
treec0b3292dbc894b3d991a76f53dd966639d25f284
parentrefactor: factor out DoPostRezWhenFromItem() from IAM.RezObject() (diff)
downloadopensim-SC_OLD-01146bb3e3b60fd3ab54a1321fb58fe2e8cfbf1e.zip
opensim-SC_OLD-01146bb3e3b60fd3ab54a1321fb58fe2e8cfbf1e.tar.gz
opensim-SC_OLD-01146bb3e3b60fd3ab54a1321fb58fe2e8cfbf1e.tar.bz2
opensim-SC_OLD-01146bb3e3b60fd3ab54a1321fb58fe2e8cfbf1e.tar.xz
factor out a section of IAM.RezObject() into DoPreRezWhenFromItem()
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs88
1 files changed, 48 insertions, 40 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
index 41f0e8c..9bc7a09 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
@@ -822,7 +822,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
822 return null; 822 return null;
823 } 823 }
824 824
825 for (int i = 0 ; i < objlist.Count; i++) 825 for (int i = 0; i < objlist.Count; i++)
826 { 826 {
827 group = objlist[i]; 827 group = objlist[i];
828 828
@@ -832,8 +832,6 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
832 m_log.Debug("[InventoryAccessModule]: Inventory object has UUID.Zero! Position 3"); 832 m_log.Debug("[InventoryAccessModule]: Inventory object has UUID.Zero! Position 3");
833 } 833 }
834 834
835 group.RootPart.FromFolderID = item.Folder;
836
837 // If it's rezzed in world, select it. Much easier to 835 // If it's rezzed in world, select it. Much easier to
838 // find small items. 836 // find small items.
839 // 837 //
@@ -890,44 +888,8 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
890 } 888 }
891 889
892 group.SetGroup(remoteClient.ActiveGroupId, remoteClient); 890 group.SetGroup(remoteClient.ActiveGroupId, remoteClient);
893 if ((rootPart.OwnerID != item.Owner) ||
894 (item.CurrentPermissions & 16) != 0)
895 {
896 //Need to kill the for sale here
897 rootPart.ObjectSaleType = 0;
898 rootPart.SalePrice = 10;
899
900 if (m_Scene.Permissions.PropagatePermissions())
901 {
902 foreach (SceneObjectPart part in group.Parts)
903 {
904 if ((item.Flags & (uint)InventoryItemFlags.ObjectHasMultipleItems) == 0)
905 {
906 part.EveryoneMask = item.EveryOnePermissions;
907 part.NextOwnerMask = item.NextPermissions;
908 }
909 part.GroupMask = 0; // DO NOT propagate here
910 }
911
912 group.ApplyNextOwnerPermissions();
913 }
914 }
915 891
916 foreach (SceneObjectPart part in group.Parts) 892 DoPreRezWhenFromItem(item, group);
917 {
918 if ((part.OwnerID != item.Owner) ||
919 (item.CurrentPermissions & 16) != 0)
920 {
921 part.LastOwnerID = part.OwnerID;
922 part.OwnerID = item.Owner;
923 part.Inventory.ChangeInventoryOwner(item.Owner);
924 part.GroupMask = 0; // DO NOT propagate here
925 }
926 part.EveryoneMask = item.EveryOnePermissions;
927 part.NextOwnerMask = item.NextPermissions;
928 }
929
930 rootPart.TrimPermissions();
931 893
932 if (!attachment) 894 if (!attachment)
933 { 895 {
@@ -951,6 +913,52 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
951 return group; 913 return group;
952 } 914 }
953 915
916 private void DoPreRezWhenFromItem(InventoryItemBase item, SceneObjectGroup so)
917 {
918 so.RootPart.FromFolderID = item.Folder;
919
920 SceneObjectPart rootPart = so.RootPart;
921
922 if ((rootPart.OwnerID != item.Owner) ||
923 (item.CurrentPermissions & 16) != 0)
924 {
925 //Need to kill the for sale here
926 rootPart.ObjectSaleType = 0;
927 rootPart.SalePrice = 10;
928
929 if (m_Scene.Permissions.PropagatePermissions())
930 {
931 foreach (SceneObjectPart part in so.Parts)
932 {
933 if ((item.Flags & (uint)InventoryItemFlags.ObjectHasMultipleItems) == 0)
934 {
935 part.EveryoneMask = item.EveryOnePermissions;
936 part.NextOwnerMask = item.NextPermissions;
937 }
938 part.GroupMask = 0; // DO NOT propagate here
939 }
940
941 so.ApplyNextOwnerPermissions();
942 }
943 }
944
945 foreach (SceneObjectPart part in so.Parts)
946 {
947 if ((part.OwnerID != item.Owner) ||
948 (item.CurrentPermissions & 16) != 0)
949 {
950 part.LastOwnerID = part.OwnerID;
951 part.OwnerID = item.Owner;
952 part.Inventory.ChangeInventoryOwner(item.Owner);
953 part.GroupMask = 0; // DO NOT propagate here
954 }
955 part.EveryoneMask = item.EveryOnePermissions;
956 part.NextOwnerMask = item.NextPermissions;
957 }
958
959 rootPart.TrimPermissions();
960 }
961
954 private void DoPostRezWhenFromItem(InventoryItemBase item, bool isAttachment) 962 private void DoPostRezWhenFromItem(InventoryItemBase item, bool isAttachment)
955 { 963 {
956 if (!m_Scene.Permissions.BypassPermissions()) 964 if (!m_Scene.Permissions.BypassPermissions())