aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs118
1 files changed, 59 insertions, 59 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs
index 8a7096f..1ac51a6 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs
@@ -50,7 +50,7 @@ namespace OpenSim.Region.Environment.Scenes
50 if (part != null) 50 if (part != null)
51 { 51 {
52 part.StartScript(itemID); 52 part.StartScript(itemID);
53 53
54 } 54 }
55 else 55 else
56 { 56 {
@@ -58,9 +58,9 @@ namespace OpenSim.Region.Environment.Scenes
58 "[PRIM INVENTORY]: " + 58 "[PRIM INVENTORY]: " +
59 "Couldn't find part {0} in object group {1}, {2} to start script with ID {3}", 59 "Couldn't find part {0} in object group {1}, {2} to start script with ID {3}",
60 localID, Name, UUID, itemID); 60 localID, Name, UUID, itemID);
61 } 61 }
62 } 62 }
63 63
64// /// Start a given script. 64// /// Start a given script.
65// /// </summary> 65// /// </summary>
66// /// <param name="localID"> 66// /// <param name="localID">
@@ -79,9 +79,9 @@ namespace OpenSim.Region.Environment.Scenes
79// "[PRIM INVENTORY]: " + 79// "[PRIM INVENTORY]: " +
80// "Couldn't find part {0} in object group {1}, {2} to start script with ID {3}", 80// "Couldn't find part {0} in object group {1}, {2} to start script with ID {3}",
81// localID, Name, UUID, itemID); 81// localID, Name, UUID, itemID);
82// } 82// }
83// } 83// }
84 84
85 /// <summary> 85 /// <summary>
86 /// Start the scripts contained in all the prims in this group. 86 /// Start the scripts contained in all the prims in this group.
87 /// </summary> 87 /// </summary>
@@ -107,7 +107,7 @@ namespace OpenSim.Region.Environment.Scenes
107 } 107 }
108 } 108 }
109 } 109 }
110 110
111 /// Start a given script. 111 /// Start a given script.
112 /// </summary> 112 /// </summary>
113 /// <param name="localID"> 113 /// <param name="localID">
@@ -127,11 +127,11 @@ namespace OpenSim.Region.Environment.Scenes
127 "[PRIM INVENTORY]: " + 127 "[PRIM INVENTORY]: " +
128 "Couldn't find part {0} in object group {1}, {2} to stop script with ID {3}", 128 "Couldn't find part {0} in object group {1}, {2} to stop script with ID {3}",
129 partID, Name, UUID, itemID); 129 partID, Name, UUID, itemID);
130 } 130 }
131 } 131 }
132 132
133 /// <summary> 133 /// <summary>
134 /// 134 ///
135 /// </summary> 135 /// </summary>
136 /// <param name="remoteClient"></param> 136 /// <param name="remoteClient"></param>
137 /// <param name="localID"></param> 137 /// <param name="localID"></param>
@@ -172,7 +172,7 @@ namespace OpenSim.Region.Environment.Scenes
172 localID, Name, UUID); 172 localID, Name, UUID);
173 } 173 }
174 } 174 }
175 175
176 /// <summary> 176 /// <summary>
177 /// Add an inventory item to a prim in this group. 177 /// Add an inventory item to a prim in this group.
178 /// </summary> 178 /// </summary>
@@ -181,7 +181,7 @@ namespace OpenSim.Region.Environment.Scenes
181 /// <param name="item"></param> 181 /// <param name="item"></param>
182 /// <param name="copyItemID">The item UUID that should be used by the new item.</param> 182 /// <param name="copyItemID">The item UUID that should be used by the new item.</param>
183 /// <returns></returns> 183 /// <returns></returns>
184 public bool AddInventoryItem(IClientAPI remoteClient, uint localID, 184 public bool AddInventoryItem(IClientAPI remoteClient, uint localID,
185 InventoryItemBase item, LLUUID copyItemID) 185 InventoryItemBase item, LLUUID copyItemID)
186 { 186 {
187 LLUUID newItemId = (copyItemID != LLUUID.Zero) ? copyItemID : item.ID; 187 LLUUID newItemId = (copyItemID != LLUUID.Zero) ? copyItemID : item.ID;
@@ -190,8 +190,8 @@ namespace OpenSim.Region.Environment.Scenes
190 if (part != null) 190 if (part != null)
191 { 191 {
192 TaskInventoryItem taskItem = new TaskInventoryItem(); 192 TaskInventoryItem taskItem = new TaskInventoryItem();
193 193
194 taskItem.ItemID = newItemId; 194 taskItem.ItemID = newItemId;
195 taskItem.AssetID = item.AssetID; 195 taskItem.AssetID = item.AssetID;
196 taskItem.Name = item.Name; 196 taskItem.Name = item.Name;
197 taskItem.Description = item.Description; 197 taskItem.Description = item.Description;
@@ -199,15 +199,15 @@ namespace OpenSim.Region.Environment.Scenes
199 taskItem.CreatorID = item.Creator; 199 taskItem.CreatorID = item.Creator;
200 taskItem.Type = item.AssetType; 200 taskItem.Type = item.AssetType;
201 taskItem.InvType = item.InvType; 201 taskItem.InvType = item.InvType;
202 202
203 taskItem.BaseMask = item.BasePermissions; 203 taskItem.BaseMask = item.BasePermissions;
204 taskItem.OwnerMask = item.CurrentPermissions; 204 taskItem.OwnerMask = item.CurrentPermissions;
205 // FIXME: ignoring group permissions for now as they aren't stored in item 205 // FIXME: ignoring group permissions for now as they aren't stored in item
206 taskItem.EveryoneMask = item.EveryOnePermissions; 206 taskItem.EveryoneMask = item.EveryOnePermissions;
207 taskItem.NextOwnerMask = item.NextPermissions; 207 taskItem.NextOwnerMask = item.NextPermissions;
208 208
209 part.AddInventoryItem(taskItem); 209 part.AddInventoryItem(taskItem);
210 210
211 return true; 211 return true;
212 } 212 }
213 else 213 else
@@ -220,7 +220,7 @@ namespace OpenSim.Region.Environment.Scenes
220 220
221 return false; 221 return false;
222 } 222 }
223 223
224 /// <summary> 224 /// <summary>
225 /// Returns an existing inventory item. Returns the original, so any changes will be live. 225 /// Returns an existing inventory item. Returns the original, so any changes will be live.
226 /// </summary> 226 /// </summary>
@@ -240,11 +240,11 @@ namespace OpenSim.Region.Environment.Scenes
240 "[PRIM INVENTORY]: " + 240 "[PRIM INVENTORY]: " +
241 "Couldn't find prim local ID {0} in prim {1}, {2} to get inventory item ID {3}", 241 "Couldn't find prim local ID {0} in prim {1}, {2} to get inventory item ID {3}",
242 primID, part.Name, part.UUID, itemID); 242 primID, part.Name, part.UUID, itemID);
243 } 243 }
244 244
245 return null; 245 return null;
246 } 246 }
247 247
248 /// <summary> 248 /// <summary>
249 /// Update an existing inventory item. 249 /// Update an existing inventory item.
250 /// </summary> 250 /// </summary>
@@ -256,8 +256,8 @@ namespace OpenSim.Region.Environment.Scenes
256 SceneObjectPart part = GetChildPart(item.ParentPartID); 256 SceneObjectPart part = GetChildPart(item.ParentPartID);
257 if (part != null) 257 if (part != null)
258 { 258 {
259 part.UpdateInventoryItem(item); 259 part.UpdateInventoryItem(item);
260 260
261 return true; 261 return true;
262 } 262 }
263 else 263 else
@@ -266,55 +266,55 @@ namespace OpenSim.Region.Environment.Scenes
266 "[PRIM INVENTORY]: " + 266 "[PRIM INVENTORY]: " +
267 "Couldn't find prim ID {0} to update item {1}, {2}", 267 "Couldn't find prim ID {0} to update item {1}, {2}",
268 item.ParentPartID, item.Name, item.ItemID); 268 item.ParentPartID, item.Name, item.ItemID);
269 } 269 }
270 270
271 return false; 271 return false;
272 } 272 }
273 273
274 public int RemoveInventoryItem(uint localID, LLUUID itemID) 274 public int RemoveInventoryItem(uint localID, LLUUID itemID)
275 { 275 {
276 SceneObjectPart part = GetChildPart(localID); 276 SceneObjectPart part = GetChildPart(localID);
277 if (part != null) 277 if (part != null)
278 { 278 {
279 int type = part.RemoveInventoryItem(itemID); 279 int type = part.RemoveInventoryItem(itemID);
280 280
281 return type; 281 return type;
282 } 282 }
283 283
284 return -1; 284 return -1;
285 } 285 }
286 286
287 public uint GetEffectivePermissions() 287 public uint GetEffectivePermissions()
288 { 288 {
289 uint perms=(uint)(PermissionMask.Modify | 289 uint perms=(uint)(PermissionMask.Modify |
290 PermissionMask.Copy | 290 PermissionMask.Copy |
291 PermissionMask.Move | 291 PermissionMask.Move |
292 PermissionMask.Transfer) | 7; 292 PermissionMask.Transfer) | 7;
293 293
294 foreach (SceneObjectPart part in m_parts.Values) 294 foreach (SceneObjectPart part in m_parts.Values)
295 perms &= part.MaskEffectivePermissions(); 295 perms &= part.MaskEffectivePermissions();
296 296
297 if((RootPart.OwnerMask & (uint)PermissionMask.Modify) == 0) 297 if ((RootPart.OwnerMask & (uint)PermissionMask.Modify) == 0)
298 perms &= ~(uint)PermissionMask.Modify; 298 perms &= ~(uint)PermissionMask.Modify;
299 if((RootPart.OwnerMask & (uint)PermissionMask.Copy) == 0) 299 if ((RootPart.OwnerMask & (uint)PermissionMask.Copy) == 0)
300 perms &= ~(uint)PermissionMask.Copy; 300 perms &= ~(uint)PermissionMask.Copy;
301 if((RootPart.OwnerMask & (uint)PermissionMask.Transfer) == 0) 301 if ((RootPart.OwnerMask & (uint)PermissionMask.Transfer) == 0)
302 perms &= ~(uint)PermissionMask.Transfer; 302 perms &= ~(uint)PermissionMask.Transfer;
303 303
304 if((RootPart.OwnerMask & RootPart.NextOwnerMask & (uint)PermissionMask.Modify) == 0) 304 if ((RootPart.OwnerMask & RootPart.NextOwnerMask & (uint)PermissionMask.Modify) == 0)
305 perms &= ~((uint)PermissionMask.Modify >> 13); 305 perms &= ~((uint)PermissionMask.Modify >> 13);
306 if((RootPart.OwnerMask & RootPart.NextOwnerMask & (uint)PermissionMask.Copy) == 0) 306 if ((RootPart.OwnerMask & RootPart.NextOwnerMask & (uint)PermissionMask.Copy) == 0)
307 perms &= ~((uint)PermissionMask.Copy >> 13); 307 perms &= ~((uint)PermissionMask.Copy >> 13);
308 if((RootPart.OwnerMask & RootPart.NextOwnerMask & (uint)PermissionMask.Transfer) == 0) 308 if ((RootPart.OwnerMask & RootPart.NextOwnerMask & (uint)PermissionMask.Transfer) == 0)
309 perms &= ~((uint)PermissionMask.Transfer >> 13); 309 perms &= ~((uint)PermissionMask.Transfer >> 13);
310 310
311 return perms; 311 return perms;
312 } 312 }
313 313
314 public void ApplyNextOwnerPermissions() 314 public void ApplyNextOwnerPermissions()
315 { 315 {
316 foreach (SceneObjectPart part in m_parts.Values) 316 foreach (SceneObjectPart part in m_parts.Values)
317 part.ApplyNextOwnerPermissions(); 317 part.ApplyNextOwnerPermissions();
318 } 318 }
319 } 319 }
320} 320}