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

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

View File

@@ -2101,20 +2101,23 @@ namespace OpenSim.Region.Framework.Scenes
SceneObjectGroup copy = original.Copy(true);
copy.AbsolutePosition = copy.AbsolutePosition + offset;
SceneObjectPart[] parts = copy.Parts;
m_numTotalPrim += parts.Length;
if (original.OwnerID != AgentID)
{
copy.SetOwner(AgentID, GroupID);
SceneObjectPart[] partList = copy.Parts;
if (m_parentScene.Permissions.PropagatePermissions())
{
foreach (SceneObjectPart child in partList)
foreach (SceneObjectPart child in parts)
{
child.Inventory.ChangeInventoryOwner(AgentID);
child.TriggerScriptChangedEvent(Changed.OWNER);
child.ApplyNextOwnerPermissions();
}
copy.AggregatePerms();
}
}
@@ -2124,10 +2127,6 @@ namespace OpenSim.Region.Framework.Scenes
lock (SceneObjectGroupsByFullID)
SceneObjectGroupsByFullID[copy.UUID] = copy;
SceneObjectPart[] parts = copy.Parts;
m_numTotalPrim += parts.Length;
foreach (SceneObjectPart part in parts)
{
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...
copy.IsSelected = false;
m_numPrim += copy.Parts.Length;
if (rot != Quaternion.Identity)
{
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
copy.AbsolutePosition = copy.AbsolutePosition;
copy.ResetChildPrimPhysicsPositions();
copy.CreateScriptInstances(0, false, m_parentScene.DefaultScriptEngine, 1);
copy.ResumeScripts();
copy.HasGroupChanged = true;
copy.ScheduleGroupForFullUpdate();
return copy;
}
}