start adding calls to effective permissions aggregation on changes; rearrange code in DuplicateObject();

httptests
UbitUmarov 2017-01-17 00:41:30 +00:00
parent 2b5ef89272
commit a5c693e302
5 changed files with 30 additions and 37 deletions

View File

@ -146,6 +146,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.BuySell
child.TriggerScriptChangedEvent(Changed.OWNER); child.TriggerScriptChangedEvent(Changed.OWNER);
child.ApplyNextOwnerPermissions(); child.ApplyNextOwnerPermissions();
} }
group.AggregatePerms();
} }
part.ObjectSaleType = 0; part.ObjectSaleType = 0;

View File

@ -2766,8 +2766,6 @@ namespace OpenSim.Region.Framework.Scenes
child.Inventory.ChangeInventoryOwner(groupID); child.Inventory.ChangeInventoryOwner(groupID);
child.TriggerScriptChangedEvent(Changed.OWNER); child.TriggerScriptChangedEvent(Changed.OWNER);
} }
} }
} }

View File

@ -2101,20 +2101,23 @@ namespace OpenSim.Region.Framework.Scenes
SceneObjectGroup copy = original.Copy(true); SceneObjectGroup copy = original.Copy(true);
copy.AbsolutePosition = copy.AbsolutePosition + offset; copy.AbsolutePosition = copy.AbsolutePosition + offset;
SceneObjectPart[] parts = copy.Parts;
m_numTotalPrim += parts.Length;
if (original.OwnerID != AgentID) if (original.OwnerID != AgentID)
{ {
copy.SetOwner(AgentID, GroupID); copy.SetOwner(AgentID, GroupID);
SceneObjectPart[] partList = copy.Parts;
if (m_parentScene.Permissions.PropagatePermissions()) if (m_parentScene.Permissions.PropagatePermissions())
{ {
foreach (SceneObjectPart child in partList) foreach (SceneObjectPart child in parts)
{ {
child.Inventory.ChangeInventoryOwner(AgentID); child.Inventory.ChangeInventoryOwner(AgentID);
child.TriggerScriptChangedEvent(Changed.OWNER); child.TriggerScriptChangedEvent(Changed.OWNER);
child.ApplyNextOwnerPermissions(); child.ApplyNextOwnerPermissions();
} }
copy.AggregatePerms();
} }
} }
@ -2124,10 +2127,6 @@ namespace OpenSim.Region.Framework.Scenes
lock (SceneObjectGroupsByFullID) lock (SceneObjectGroupsByFullID)
SceneObjectGroupsByFullID[copy.UUID] = copy; SceneObjectGroupsByFullID[copy.UUID] = copy;
SceneObjectPart[] parts = copy.Parts;
m_numTotalPrim += parts.Length;
foreach (SceneObjectPart part in parts) foreach (SceneObjectPart part in parts)
{ {
if (part.GetPrimType() == PrimType.SCULPT) if (part.GetPrimType() == PrimType.SCULPT)
@ -2150,21 +2149,17 @@ namespace OpenSim.Region.Framework.Scenes
// think it's selected, so it will never send a deselect... // think it's selected, so it will never send a deselect...
copy.IsSelected = false; copy.IsSelected = false;
m_numPrim += copy.Parts.Length;
if (rot != Quaternion.Identity) if (rot != Quaternion.Identity)
{
copy.UpdateGroupRotationR(rot); copy.UpdateGroupRotationR(rot);
}
copy.CreateScriptInstances(0, false, m_parentScene.DefaultScriptEngine, 1);
copy.HasGroupChanged = true;
copy.ScheduleGroupForFullUpdate();
copy.ResumeScripts();
// required for physics to update it's position // required for physics to update it's position
copy.AbsolutePosition = copy.AbsolutePosition; copy.ResetChildPrimPhysicsPositions();
copy.CreateScriptInstances(0, false, m_parentScene.DefaultScriptEngine, 1);
copy.ResumeScripts();
copy.HasGroupChanged = true;
copy.ScheduleGroupForFullUpdate();
return copy; return copy;
} }
} }

View File

@ -5243,17 +5243,13 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter
if (OwnerID != item.Owner) if (OwnerID != item.Owner)
{ {
//LogPermissions("Before ApplyNextOwnerPermissions");
if (scene.Permissions.PropagatePermissions())
ApplyNextOwnerPermissions();
//LogPermissions("After ApplyNextOwnerPermissions");
if(OwnerID != GroupID) if(OwnerID != GroupID)
LastOwnerID = OwnerID; LastOwnerID = OwnerID;
OwnerID = item.Owner; OwnerID = item.Owner;
Inventory.ChangeInventoryOwner(item.Owner); Inventory.ChangeInventoryOwner(item.Owner);
if (scene.Permissions.PropagatePermissions())
ApplyNextOwnerPermissions();
} }
} }
@ -5277,6 +5273,7 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter
GroupMask = 0; // Giving an object zaps group permissions GroupMask = 0; // Giving an object zaps group permissions
Inventory.ApplyNextOwnerPermissions(); Inventory.ApplyNextOwnerPermissions();
AggregateInnerPerms();
} }
public void UpdateLookAt() public void UpdateLookAt()

View File

@ -134,11 +134,12 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments
private int llAttachToAvatarTemp(UUID host, UUID script, int attachmentPoint) private int llAttachToAvatarTemp(UUID host, UUID script, int attachmentPoint)
{ {
SceneObjectPart hostPart = m_scene.GetSceneObjectPart(host); SceneObjectPart hostPart = m_scene.GetSceneObjectPart(host);
if (hostPart == null) if (hostPart == null)
return 0; return 0;
if (hostPart.ParentGroup.IsAttachment) SceneObjectGroup hostgroup = hostPart.ParentGroup;
if (hostgroup== null || hostgroup.IsAttachment)
return 0; return 0;
IAttachmentsModule attachmentsModule = m_scene.RequestModuleInterface<IAttachmentsModule>(); IAttachmentsModule attachmentsModule = m_scene.RequestModuleInterface<IAttachmentsModule>();
@ -156,31 +157,32 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments
if (!m_scene.TryGetScenePresence(item.PermsGranter, out target)) if (!m_scene.TryGetScenePresence(item.PermsGranter, out target))
return 0; return 0;
if (target.UUID != hostPart.ParentGroup.OwnerID) if (target.UUID != hostgroup.OwnerID)
{ {
uint effectivePerms = hostPart.ParentGroup.GetEffectivePermissions(); uint effectivePerms = hostgroup.GetEffectivePermissions();
if ((effectivePerms & (uint)PermissionMask.Transfer) == 0) if ((effectivePerms & (uint)PermissionMask.Transfer) == 0)
return 0; return 0;
hostPart.ParentGroup.SetOwner(target.UUID, target.ControllingClient.ActiveGroupId); hostgroup.SetOwner(target.UUID, target.ControllingClient.ActiveGroupId);
if (m_scene.Permissions.PropagatePermissions()) if (m_scene.Permissions.PropagatePermissions())
{ {
foreach (SceneObjectPart child in hostPart.ParentGroup.Parts) foreach (SceneObjectPart child in hostgroup.Parts)
{ {
child.Inventory.ChangeInventoryOwner(target.UUID); child.Inventory.ChangeInventoryOwner(target.UUID);
child.TriggerScriptChangedEvent(Changed.OWNER); child.TriggerScriptChangedEvent(Changed.OWNER);
child.ApplyNextOwnerPermissions(); child.ApplyNextOwnerPermissions();
} }
hostgroup.AggregatePerms();
} }
hostPart.ParentGroup.RootPart.ObjectSaleType = 0; hostgroup.RootPart.ObjectSaleType = 0;
hostPart.ParentGroup.RootPart.SalePrice = 10; hostgroup.RootPart.SalePrice = 10;
hostPart.ParentGroup.HasGroupChanged = true; hostgroup.HasGroupChanged = true;
hostPart.ParentGroup.RootPart.SendPropertiesToClient(target.ControllingClient); hostgroup.RootPart.SendPropertiesToClient(target.ControllingClient);
hostPart.ParentGroup.RootPart.ScheduleFullUpdate(); hostgroup.RootPart.ScheduleFullUpdate();
} }
return attachmentsModule.AttachObject(target, hostPart.ParentGroup, (uint)attachmentPoint, false, false, true) ? 1 : 0; return attachmentsModule.AttachObject(target, hostPart.ParentGroup, (uint)attachmentPoint, false, false, true) ? 1 : 0;