aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs
diff options
context:
space:
mode:
authorDr Scofield2008-11-14 10:55:14 +0000
committerDr Scofield2008-11-14 10:55:14 +0000
commit5e20e32b6993a79f8f31cb12882b9c4499140275 (patch)
tree8620c9dbaec8e4c973334511f5d3ebc98389a3d8 /OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs
parentFrom: Alan Webb (alan_webb@us.ibm.com) (diff)
downloadopensim-SC_OLD-5e20e32b6993a79f8f31cb12882b9c4499140275.zip
opensim-SC_OLD-5e20e32b6993a79f8f31cb12882b9c4499140275.tar.gz
opensim-SC_OLD-5e20e32b6993a79f8f31cb12882b9c4499140275.tar.bz2
opensim-SC_OLD-5e20e32b6993a79f8f31cb12882b9c4499140275.tar.xz
From: Christopher Yeoh <cyeoh@au1.ibm.com>
This patch makes llAllowInventoryDrop work with the permissions module enabled. Changes include: - Enabled PropagatePermissions when permissions module serverside perms is on - change ownership of item when item is dropped into an object. Ownership changes to the owner of the object the item is dropped into - propagation of permissions if the permissions module enabled (eg next-owner mask applied) - CHANGED_ALLOWED_DROP is now passed to the change script event if an item was allowed to be dropped into the object only because llAllowInventoryDrop is enabled (instead of CHANGED_INVENTORY being passed). - Sets object flags correctly when llAllowInventoryDrop is called so clients are notified immediately of the change in state. Am not sure that calling aggregateScriptEvents is the right way to do it, but it works and seems to be the only way without making further changes to update LocalFlags
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs35
1 files changed, 27 insertions, 8 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs
index bfa9763..8275ceb 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs
@@ -151,23 +151,42 @@ namespace OpenSim.Region.Environment.Scenes
151 taskItem.AssetID = item.AssetID; 151 taskItem.AssetID = item.AssetID;
152 taskItem.Name = item.Name; 152 taskItem.Name = item.Name;
153 taskItem.Description = item.Description; 153 taskItem.Description = item.Description;
154 taskItem.OwnerID = item.Owner; 154 taskItem.OwnerID = part.OwnerID; // Transfer ownership
155 taskItem.CreatorID = item.Creator; 155 taskItem.CreatorID = item.Creator;
156 taskItem.Type = item.AssetType; 156 taskItem.Type = item.AssetType;
157 taskItem.InvType = item.InvType; 157 taskItem.InvType = item.InvType;
158 158
159 taskItem.BasePermissions = item.BasePermissions; 159 if (remoteClient!=null && remoteClient.AgentId!=part.OwnerID &&
160 taskItem.CurrentPermissions = item.CurrentPermissions; 160 m_scene.ExternalChecks.ExternalChecksPropagatePermissions()) {
161 // FIXME: ignoring group permissions for now as they aren't stored in item 161 taskItem.BasePermissions = item.BasePermissions & item.NextPermissions;
162 taskItem.EveryonePermissions = item.EveryOnePermissions; 162 taskItem.CurrentPermissions = item.CurrentPermissions & item.NextPermissions;
163 taskItem.NextPermissions = item.NextPermissions; 163 taskItem.EveryonePermissions = item.EveryOnePermissions & item.NextPermissions;
164 taskItem.NextPermissions = item.NextPermissions;
165 taskItem.CurrentPermissions |= 8;
166 } else {
167 taskItem.BasePermissions = item.BasePermissions;
168 taskItem.CurrentPermissions = item.CurrentPermissions;
169 taskItem.CurrentPermissions |= 8;
170 taskItem.EveryonePermissions = item.EveryOnePermissions;
171 taskItem.NextPermissions = item.NextPermissions;
172 }
173
174
175
164 taskItem.Flags = item.Flags; 176 taskItem.Flags = item.Flags;
165 // TODO: These are pending addition of those fields to TaskInventoryItem 177 // TODO: These are pending addition of those fields to TaskInventoryItem
166// taskItem.SalePrice = item.SalePrice; 178// taskItem.SalePrice = item.SalePrice;
167// taskItem.SaleType = item.SaleType; 179// taskItem.SaleType = item.SaleType;
168 taskItem.CreationDate = (uint)item.CreationDate; 180 taskItem.CreationDate = (uint)item.CreationDate;
169 181
170 part.AddInventoryItem(taskItem); 182 bool addFromAllowedDrop = false;
183 if (remoteClient!=null)
184 {
185 addFromAllowedDrop = remoteClient.AgentId!=part.OwnerID &&
186 m_scene.ExternalChecks.ExternalChecksPropagatePermissions();
187 }
188
189 part.AddInventoryItem(taskItem, addFromAllowedDrop);
171 190
172 return true; 191 return true;
173 } 192 }