diff options
author | Melanie Thielker | 2014-06-21 00:39:55 +0200 |
---|---|---|
committer | Melanie Thielker | 2014-06-21 00:39:55 +0200 |
commit | 159fcbf150b7da0e229b29aa7b94793484543d12 (patch) | |
tree | b8c0ff3b4c758a3fba8315b556c923ef4c02a185 /OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | |
parent | Merge commit '68c8633ba18f0a11cfc0ed04d1d0c7c59e6cec76' (diff) | |
parent | Merge branch 'master' into careminster (diff) | |
download | opensim-SC_OLD-159fcbf150b7da0e229b29aa7b94793484543d12.zip opensim-SC_OLD-159fcbf150b7da0e229b29aa7b94793484543d12.tar.gz opensim-SC_OLD-159fcbf150b7da0e229b29aa7b94793484543d12.tar.bz2 opensim-SC_OLD-159fcbf150b7da0e229b29aa7b94793484543d12.tar.xz |
Merge branch 'master' of ssh://3dhosting.de/var/git/careminster
Conflicts:
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | 95 |
1 files changed, 42 insertions, 53 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index d04d87b..8893cc0 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | |||
@@ -696,7 +696,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
696 | /// </param> | 696 | /// </param> |
697 | public void StopScriptInstance(TaskInventoryItem item) | 697 | public void StopScriptInstance(TaskInventoryItem item) |
698 | { | 698 | { |
699 | m_part.ParentGroup.Scene.EventManager.TriggerStopScript(m_part.LocalId, item.ItemID); | 699 | if (m_part.ParentGroup.Scene != null) |
700 | m_part.ParentGroup.Scene.EventManager.TriggerStopScript(m_part.LocalId, item.ItemID); | ||
700 | 701 | ||
701 | // At the moment, even stopped scripts are counted as active, which is probably wrong. | 702 | // At the moment, even stopped scripts are counted as active, which is probably wrong. |
702 | // m_part.ParentGroup.AddActiveScriptCount(-1); | 703 | // m_part.ParentGroup.AddActiveScriptCount(-1); |
@@ -880,8 +881,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
880 | 881 | ||
881 | return items; | 882 | return items; |
882 | } | 883 | } |
883 | 884 | ||
884 | public SceneObjectGroup GetRezReadySceneObject(TaskInventoryItem item) | 885 | public bool GetRezReadySceneObjects(TaskInventoryItem item, out List<SceneObjectGroup> objlist, out List<Vector3> veclist) |
885 | { | 886 | { |
886 | AssetBase rezAsset = m_part.ParentGroup.Scene.AssetService.Get(item.AssetID.ToString()); | 887 | AssetBase rezAsset = m_part.ParentGroup.Scene.AssetService.Get(item.AssetID.ToString()); |
887 | 888 | ||
@@ -890,70 +891,58 @@ namespace OpenSim.Region.Framework.Scenes | |||
890 | m_log.WarnFormat( | 891 | m_log.WarnFormat( |
891 | "[PRIM INVENTORY]: Could not find asset {0} for inventory item {1} in {2}", | 892 | "[PRIM INVENTORY]: Could not find asset {0} for inventory item {1} in {2}", |
892 | item.AssetID, item.Name, m_part.Name); | 893 | item.AssetID, item.Name, m_part.Name); |
893 | return null; | 894 | objlist = null; |
895 | veclist = null; | ||
896 | return false; | ||
894 | } | 897 | } |
895 | 898 | ||
896 | string xmlData = Utils.BytesToString(rezAsset.Data); | 899 | Vector3 bbox; |
897 | SceneObjectGroup group = SceneObjectSerializer.FromOriginalXmlFormat(xmlData); | 900 | float offsetHeight; |
898 | 901 | ||
899 | group.RootPart.AttachPoint = group.RootPart.Shape.State; | 902 | bool single = m_part.ParentGroup.Scene.GetObjectsToRez(rezAsset.Data, false, out objlist, out veclist, out bbox, out offsetHeight); |
900 | group.RootPart.AttachOffset = group.AbsolutePosition; | ||
901 | group.RootPart.AttachRotation = group.GroupRotation; | ||
902 | 903 | ||
903 | group.ResetIDs(); | 904 | for (int i = 0; i < objlist.Count; i++) |
904 | 905 | { | |
905 | SceneObjectPart rootPart = group.GetPart(group.UUID); | 906 | SceneObjectGroup group = objlist[i]; |
906 | 907 | ||
907 | // Since renaming the item in the inventory does not affect the name stored | 908 | group.RootPart.AttachPoint = group.RootPart.Shape.State; |
908 | // in the serialization, transfer the correct name from the inventory to the | 909 | group.RootPart.AttachOffset = group.AbsolutePosition; |
909 | // object itself before we rez. | 910 | group.RootPart.AttachRotation = group.GroupRotation; |
910 | rootPart.Name = item.Name; | ||
911 | rootPart.Description = item.Description; | ||
912 | 911 | ||
913 | SceneObjectPart[] partList = group.Parts; | 912 | group.ResetIDs(); |
914 | 913 | ||
915 | group.SetGroup(m_part.GroupID, null); | 914 | SceneObjectPart rootPart = group.GetPart(group.UUID); |
916 | 915 | ||
917 | // TODO: Remove magic number badness | 916 | // Since renaming the item in the inventory does not affect the name stored |
918 | if ((rootPart.OwnerID != item.OwnerID) || (item.CurrentPermissions & 16) != 0 || (item.Flags & (uint)InventoryItemFlags.ObjectSlamPerm) != 0) // Magic number | 917 | // in the serialization, transfer the correct name from the inventory to the |
919 | { | 918 | // object itself before we rez. |
920 | if (m_part.ParentGroup.Scene.Permissions.PropagatePermissions()) | 919 | // Only do these for the first object if we are rezzing a coalescence. |
920 | if (i == 0) | ||
921 | { | 921 | { |
922 | foreach (SceneObjectPart part in partList) | 922 | rootPart.Name = item.Name; |
923 | { | 923 | rootPart.Description = item.Description; |
924 | if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteEveryone) != 0) | ||
925 | part.EveryoneMask = item.EveryonePermissions; | ||
926 | if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteNextOwner) != 0) | ||
927 | part.NextOwnerMask = item.NextPermissions; | ||
928 | if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteGroup) != 0) | ||
929 | part.GroupMask = item.GroupPermissions; | ||
930 | } | ||
931 | |||
932 | group.ApplyNextOwnerPermissions(); | ||
933 | } | 924 | } |
934 | } | ||
935 | 925 | ||
936 | foreach (SceneObjectPart part in partList) | 926 | group.SetGroup(m_part.GroupID, null); |
937 | { | 927 | |
938 | // TODO: Remove magic number badness | 928 | foreach (SceneObjectPart part in group.Parts) |
939 | if ((part.OwnerID != item.OwnerID) || (item.CurrentPermissions & 16) != 0 || (item.Flags & (uint)InventoryItemFlags.ObjectSlamPerm) != 0) // Magic number | ||
940 | { | 929 | { |
941 | part.LastOwnerID = part.OwnerID; | 930 | // Convert between InventoryItem classes. You can never have too many similar but slightly different classes :) |
942 | part.OwnerID = item.OwnerID; | 931 | InventoryItemBase dest = new InventoryItemBase(item.ItemID, item.OwnerID); |
943 | part.Inventory.ChangeInventoryOwner(item.OwnerID); | 932 | dest.BasePermissions = item.BasePermissions; |
933 | dest.CurrentPermissions = item.CurrentPermissions; | ||
934 | dest.EveryOnePermissions = item.EveryonePermissions; | ||
935 | dest.GroupPermissions = item.GroupPermissions; | ||
936 | dest.NextPermissions = item.NextPermissions; | ||
937 | dest.Flags = item.Flags; | ||
938 | |||
939 | part.ApplyPermissionsOnRez(dest, false, m_part.ParentGroup.Scene); | ||
944 | } | 940 | } |
945 | 941 | ||
946 | if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteEveryone) != 0) | 942 | rootPart.TrimPermissions(); |
947 | part.EveryoneMask = item.EveryonePermissions; | ||
948 | if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteNextOwner) != 0) | ||
949 | part.NextOwnerMask = item.NextPermissions; | ||
950 | if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteGroup) != 0) | ||
951 | part.GroupMask = item.GroupPermissions; | ||
952 | } | 943 | } |
953 | 944 | ||
954 | rootPart.TrimPermissions(); | 945 | return true; |
955 | |||
956 | return group; | ||
957 | } | 946 | } |
958 | 947 | ||
959 | /// <summary> | 948 | /// <summary> |