diff options
author | Melanie | 2010-08-26 00:11:07 +0100 |
---|---|---|
committer | Melanie | 2010-08-26 00:11:07 +0100 |
commit | fc8d2be632c754338b136fe4a3d57c40b0190ce7 (patch) | |
tree | 94bb954bdf258e968e8c337ad1da57ba9fa68b91 /OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |
parent | Merge branch 'master' into careminster-presence-refactor (diff) | |
parent | Merge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff) | |
download | opensim-SC-fc8d2be632c754338b136fe4a3d57c40b0190ce7.zip opensim-SC-fc8d2be632c754338b136fe4a3d57c40b0190ce7.tar.gz opensim-SC-fc8d2be632c754338b136fe4a3d57c40b0190ce7.tar.bz2 opensim-SC-fc8d2be632c754338b136fe4a3d57c40b0190ce7.tar.xz |
Merge branch 'master' into careminster-presence-refactor
This was rather conflicted. Please test linking.
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.Inventory.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 78 |
1 files changed, 18 insertions, 60 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 012732b..48508f8 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -2022,60 +2022,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
2022 | if (null == item) | 2022 | if (null == item) |
2023 | return null; | 2023 | return null; |
2024 | 2024 | ||
2025 | UUID ownerID = item.OwnerID; | 2025 | SceneObjectGroup group = sourcePart.Inventory.GetRezReadySceneObject(item); |
2026 | AssetBase rezAsset = AssetService.Get(item.AssetID.ToString()); | 2026 | |
2027 | 2027 | if (null == group) | |
2028 | if (null == rezAsset) | ||
2029 | return null; | ||
2030 | |||
2031 | string xmlData = Utils.BytesToString(rezAsset.Data); | ||
2032 | SceneObjectGroup group = SceneObjectSerializer.FromOriginalXmlFormat(xmlData); | ||
2033 | |||
2034 | if (!Permissions.CanRezObject(group.Children.Count, ownerID, pos)) | ||
2035 | return null; | 2028 | return null; |
2036 | |||
2037 | group.ResetIDs(); | ||
2038 | |||
2039 | SceneObjectPart rootPart = group.GetChildPart(group.UUID); | ||
2040 | |||
2041 | // Since renaming the item in the inventory does not affect the name stored | ||
2042 | // in the serialization, transfer the correct name from the inventory to the | ||
2043 | // object itself before we rez. | ||
2044 | rootPart.Name = item.Name; | ||
2045 | rootPart.Description = item.Description; | ||
2046 | |||
2047 | List<SceneObjectPart> partList = new List<SceneObjectPart>(group.Children.Values); | ||
2048 | |||
2049 | group.SetGroup(sourcePart.GroupID, null); | ||
2050 | |||
2051 | if ((rootPart.OwnerID != item.OwnerID) || (item.CurrentPermissions & 16) != 0) | ||
2052 | { | ||
2053 | if (Permissions.PropagatePermissions()) | ||
2054 | { | ||
2055 | foreach (SceneObjectPart part in partList) | ||
2056 | { | ||
2057 | part.EveryoneMask = item.EveryonePermissions; | ||
2058 | part.NextOwnerMask = item.NextPermissions; | ||
2059 | } | ||
2060 | |||
2061 | group.ApplyNextOwnerPermissions(); | ||
2062 | } | ||
2063 | } | ||
2064 | |||
2065 | foreach (SceneObjectPart part in partList) | ||
2066 | { | ||
2067 | if ((part.OwnerID != item.OwnerID) || (item.CurrentPermissions & 16) != 0) | ||
2068 | { | ||
2069 | part.LastOwnerID = part.OwnerID; | ||
2070 | part.OwnerID = item.OwnerID; | ||
2071 | part.Inventory.ChangeInventoryOwner(item.OwnerID); | ||
2072 | } | ||
2073 | |||
2074 | part.EveryoneMask = item.EveryonePermissions; | ||
2075 | part.NextOwnerMask = item.NextPermissions; | ||
2076 | } | ||
2077 | 2029 | ||
2078 | rootPart.TrimPermissions(); | 2030 | if (!Permissions.CanRezObject(group.PrimCount, item.OwnerID, pos)) |
2031 | return null; | ||
2079 | 2032 | ||
2080 | if (!Permissions.BypassPermissions()) | 2033 | if (!Permissions.BypassPermissions()) |
2081 | { | 2034 | { |
@@ -2091,7 +2044,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2091 | 2044 | ||
2092 | group.ScheduleGroupForFullUpdate(); | 2045 | group.ScheduleGroupForFullUpdate(); |
2093 | 2046 | ||
2094 | return rootPart.ParentGroup; | 2047 | return group; |
2095 | } | 2048 | } |
2096 | 2049 | ||
2097 | public virtual bool returnObjects(SceneObjectGroup[] returnobjects, UUID AgentId) | 2050 | public virtual bool returnObjects(SceneObjectGroup[] returnobjects, UUID AgentId) |
@@ -2151,8 +2104,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
2151 | sog.SetGroup(groupID, remoteClient); | 2104 | sog.SetGroup(groupID, remoteClient); |
2152 | sog.ScheduleGroupForFullUpdate(); | 2105 | sog.ScheduleGroupForFullUpdate(); |
2153 | 2106 | ||
2154 | foreach (SceneObjectPart child in sog.Children.Values) | 2107 | lock (sog.Children) |
2155 | child.Inventory.ChangeInventoryOwner(ownerID); | 2108 | { |
2109 | foreach (SceneObjectPart child in sog.Children.Values) | ||
2110 | child.Inventory.ChangeInventoryOwner(ownerID); | ||
2111 | } | ||
2156 | } | 2112 | } |
2157 | else | 2113 | else |
2158 | { | 2114 | { |
@@ -2162,16 +2118,18 @@ namespace OpenSim.Region.Framework.Scenes | |||
2162 | if (sog.GroupID != groupID) | 2118 | if (sog.GroupID != groupID) |
2163 | continue; | 2119 | continue; |
2164 | 2120 | ||
2165 | foreach (SceneObjectPart child in sog.Children.Values) | 2121 | lock (sog.Children) |
2166 | { | 2122 | { |
2167 | child.LastOwnerID = child.OwnerID; | 2123 | foreach (SceneObjectPart child in sog.Children.Values) |
2168 | child.Inventory.ChangeInventoryOwner(groupID); | 2124 | { |
2125 | child.LastOwnerID = child.OwnerID; | ||
2126 | child.Inventory.ChangeInventoryOwner(groupID); | ||
2127 | } | ||
2169 | } | 2128 | } |
2170 | 2129 | ||
2171 | sog.SetOwnerId(groupID); | 2130 | sog.SetOwnerId(groupID); |
2172 | sog.ApplyNextOwnerPermissions(); | 2131 | sog.ApplyNextOwnerPermissions(); |
2173 | } | 2132 | } |
2174 | |||
2175 | } | 2133 | } |
2176 | 2134 | ||
2177 | foreach (uint localID in localIDs) | 2135 | foreach (uint localID in localIDs) |