diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 65 |
1 files changed, 49 insertions, 16 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 557b55e..bf0e31b 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -244,11 +244,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
244 | 244 | ||
245 | public uint TimeStampTerse; | 245 | public uint TimeStampTerse; |
246 | 246 | ||
247 | // The following two are to hold the attachment data | ||
248 | // while an object is inworld | ||
249 | [XmlIgnore] | ||
250 | public byte AttachPoint = 0; | ||
251 | |||
252 | [XmlIgnore] | 247 | [XmlIgnore] |
253 | public Quaternion AttachRotation = Quaternion.Identity; | 248 | public Quaternion AttachRotation = Quaternion.Identity; |
254 | 249 | ||
@@ -277,7 +272,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
277 | 272 | ||
278 | public scriptEvents AggregateScriptEvents; | 273 | public scriptEvents AggregateScriptEvents; |
279 | 274 | ||
280 | public Vector3 AttachedPos; | 275 | public Vector3 AttachedPos |
276 | { | ||
277 | get; | ||
278 | set; | ||
279 | } | ||
281 | 280 | ||
282 | // rotation locks on local X,Y and or Z axis bit flags | 281 | // rotation locks on local X,Y and or Z axis bit flags |
283 | // bits are as in llSetStatus defined in SceneObjectGroup.axisSelect enum | 282 | // bits are as in llSetStatus defined in SceneObjectGroup.axisSelect enum |
@@ -476,8 +475,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
476 | APIDActive = false; | 475 | APIDActive = false; |
477 | Flags = 0; | 476 | Flags = 0; |
478 | CreateSelected = true; | 477 | CreateSelected = true; |
479 | |||
480 | TrimPermissions(); | 478 | TrimPermissions(); |
479 | AggregateInnerPerms(); | ||
481 | } | 480 | } |
482 | 481 | ||
483 | #endregion Constructors | 482 | #endregion Constructors |
@@ -2228,7 +2227,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
2228 | dupe.LocalId = plocalID; | 2227 | dupe.LocalId = plocalID; |
2229 | 2228 | ||
2230 | // This may be wrong... it might have to be applied in SceneObjectGroup to the object that's being duplicated. | 2229 | // This may be wrong... it might have to be applied in SceneObjectGroup to the object that's being duplicated. |
2231 | dupe.LastOwnerID = OwnerID; | 2230 | if(OwnerID != GroupID) |
2231 | dupe.LastOwnerID = OwnerID; | ||
2232 | else | ||
2233 | dupe.LastOwnerID = LastOwnerID; // redundant ? | ||
2234 | |||
2232 | dupe.RezzerID = RezzerID; | 2235 | dupe.RezzerID = RezzerID; |
2233 | 2236 | ||
2234 | byte[] extraP = new byte[Shape.ExtraParams.Length]; | 2237 | byte[] extraP = new byte[Shape.ExtraParams.Length]; |
@@ -2537,6 +2540,35 @@ namespace OpenSim.Region.Framework.Scenes | |||
2537 | return (uint)Flags | (uint)LocalFlags; | 2540 | return (uint)Flags | (uint)LocalFlags; |
2538 | } | 2541 | } |
2539 | 2542 | ||
2543 | // some of this lines need be moved to other place later | ||
2544 | |||
2545 | // effective permitions considering only this part inventory contents perms | ||
2546 | public uint AggregatedInnerOwnerPerms {get; private set; } | ||
2547 | public uint AggregatedInnerGroupPerms {get; private set; } | ||
2548 | public uint AggregatedInnerEveryonePerms {get; private set; } | ||
2549 | private object InnerPermsLock = new object(); | ||
2550 | |||
2551 | public void AggregateInnerPerms() | ||
2552 | { | ||
2553 | // assuming child prims permissions masks are irrelevant on a linkset | ||
2554 | // root part is handle at SOG since its masks are the sog masks | ||
2555 | const uint mask = (uint)PermissionMask.AllEffective; | ||
2556 | |||
2557 | uint owner = mask; | ||
2558 | uint group = mask; | ||
2559 | uint everyone = mask; | ||
2560 | |||
2561 | lock(InnerPermsLock) // do we really need this? | ||
2562 | { | ||
2563 | if(Inventory != null) | ||
2564 | Inventory.AggregateInnerPerms(ref owner, ref group, ref everyone); | ||
2565 | |||
2566 | AggregatedInnerOwnerPerms = owner & mask; | ||
2567 | AggregatedInnerGroupPerms = group & mask; | ||
2568 | AggregatedInnerEveryonePerms = everyone & mask; | ||
2569 | } | ||
2570 | } | ||
2571 | |||
2540 | public Vector3 GetGeometricCenter() | 2572 | public Vector3 GetGeometricCenter() |
2541 | { | 2573 | { |
2542 | // this is not real geometric center but a average of positions relative to root prim acording to | 2574 | // this is not real geometric center but a average of positions relative to root prim acording to |
@@ -4464,7 +4496,7 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter | |||
4464 | 4496 | ||
4465 | break; | 4497 | break; |
4466 | } | 4498 | } |
4467 | 4499 | AggregateInnerPerms(); | |
4468 | SendFullUpdateToAllClients(); | 4500 | SendFullUpdateToAllClients(); |
4469 | } | 4501 | } |
4470 | } | 4502 | } |
@@ -4481,6 +4513,8 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter | |||
4481 | EveryoneMask = source.EveryoneMask & BaseMask; | 4513 | EveryoneMask = source.EveryoneMask & BaseMask; |
4482 | NextOwnerMask = source.NextOwnerMask & BaseMask; | 4514 | NextOwnerMask = source.NextOwnerMask & BaseMask; |
4483 | 4515 | ||
4516 | AggregateInnerPerms(); | ||
4517 | |||
4484 | if (OwnerMask != prevOwnerMask || | 4518 | if (OwnerMask != prevOwnerMask || |
4485 | GroupMask != prevGroupMask || | 4519 | GroupMask != prevGroupMask || |
4486 | EveryoneMask != prevEveryoneMask || | 4520 | EveryoneMask != prevEveryoneMask || |
@@ -5212,16 +5246,13 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter | |||
5212 | 5246 | ||
5213 | if (OwnerID != item.Owner) | 5247 | if (OwnerID != item.Owner) |
5214 | { | 5248 | { |
5215 | //LogPermissions("Before ApplyNextOwnerPermissions"); | 5249 | if(OwnerID != GroupID) |
5250 | LastOwnerID = OwnerID; | ||
5251 | OwnerID = item.Owner; | ||
5252 | Inventory.ChangeInventoryOwner(item.Owner); | ||
5216 | 5253 | ||
5217 | if (scene.Permissions.PropagatePermissions()) | 5254 | if (scene.Permissions.PropagatePermissions()) |
5218 | ApplyNextOwnerPermissions(); | 5255 | ApplyNextOwnerPermissions(); |
5219 | |||
5220 | //LogPermissions("After ApplyNextOwnerPermissions"); | ||
5221 | |||
5222 | LastOwnerID = OwnerID; | ||
5223 | OwnerID = item.Owner; | ||
5224 | Inventory.ChangeInventoryOwner(item.Owner); | ||
5225 | } | 5256 | } |
5226 | } | 5257 | } |
5227 | 5258 | ||
@@ -5245,6 +5276,7 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter | |||
5245 | GroupMask = 0; // Giving an object zaps group permissions | 5276 | GroupMask = 0; // Giving an object zaps group permissions |
5246 | 5277 | ||
5247 | Inventory.ApplyNextOwnerPermissions(); | 5278 | Inventory.ApplyNextOwnerPermissions(); |
5279 | AggregateInnerPerms(); | ||
5248 | } | 5280 | } |
5249 | 5281 | ||
5250 | public void UpdateLookAt() | 5282 | public void UpdateLookAt() |
@@ -5306,6 +5338,7 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter | |||
5306 | item.OwnerChanged = false; | 5338 | item.OwnerChanged = false; |
5307 | Inventory.UpdateInventoryItem(item, false, false); | 5339 | Inventory.UpdateInventoryItem(item, false, false); |
5308 | } | 5340 | } |
5341 | AggregateInnerPerms(); | ||
5309 | } | 5342 | } |
5310 | 5343 | ||
5311 | /// <summary> | 5344 | /// <summary> |