Fix Copy on Ray, Drag Copy and other little things. Removed the wrong and

nonworking ownership assignment in SOG, which messed things up before.
No longer trust the client to send the ID of the person something is copied
as, since it allows to run a script with someone else's permissions. Properly
adjust inventory ownership and perms.
avinationmerge
Melanie Thielker 2010-06-28 01:29:30 +02:00
parent 2cced72d70
commit d570cffa39
3 changed files with 6 additions and 20 deletions

View File

@ -6307,8 +6307,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if (handlerObjectDuplicate != null) if (handlerObjectDuplicate != null)
{ {
handlerObjectDuplicate(dupe.ObjectData[i].ObjectLocalID, dupe.SharedData.Offset, handlerObjectDuplicate(dupe.ObjectData[i].ObjectLocalID, dupe.SharedData.Offset,
dupe.SharedData.DuplicateFlags, AgentandGroupData.AgentID, dupe.SharedData.DuplicateFlags, AgentId,
AgentandGroupData.GroupID); m_activeGroupID);
} }
} }
@ -6898,7 +6898,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if (handlerObjectDuplicateOnRay != null) if (handlerObjectDuplicateOnRay != null)
{ {
handlerObjectDuplicateOnRay(dupeOnRay.ObjectData[i].ObjectLocalID, dupeOnRay.AgentData.DuplicateFlags, handlerObjectDuplicateOnRay(dupeOnRay.ObjectData[i].ObjectLocalID, dupeOnRay.AgentData.DuplicateFlags,
dupeOnRay.AgentData.AgentID, dupeOnRay.AgentData.GroupID, dupeOnRay.AgentData.RayTargetID, dupeOnRay.AgentData.RayEnd, AgentId, m_activeGroupID, dupeOnRay.AgentData.RayTargetID, dupeOnRay.AgentData.RayEnd,
dupeOnRay.AgentData.RayStart, dupeOnRay.AgentData.BypassRaycast, dupeOnRay.AgentData.RayEndIsIntersection, dupeOnRay.AgentData.RayStart, dupeOnRay.AgentData.BypassRaycast, dupeOnRay.AgentData.RayEndIsIntersection,
dupeOnRay.AgentData.CopyCenters, dupeOnRay.AgentData.CopyRotates); dupeOnRay.AgentData.CopyCenters, dupeOnRay.AgentData.CopyRotates);
} }

View File

@ -1851,7 +1851,7 @@ namespace OpenSim.Region.Framework.Scenes
SceneObjectGroup copy = original.Copy(AgentID, GroupID, true); SceneObjectGroup copy = original.Copy(AgentID, GroupID, true);
copy.AbsolutePosition = copy.AbsolutePosition + offset; copy.AbsolutePosition = copy.AbsolutePosition + offset;
if (copy.OwnerID != AgentID) if (original.OwnerID != AgentID)
{ {
copy.SetOwnerId(AgentID); copy.SetOwnerId(AgentID);
copy.SetRootPartOwner(copy.RootPart, AgentID, GroupID); copy.SetRootPartOwner(copy.RootPart, AgentID, GroupID);

View File

@ -1781,7 +1781,9 @@ namespace OpenSim.Region.Framework.Scenes
dupe.AbsolutePosition = new Vector3(AbsolutePosition.X, AbsolutePosition.Y, AbsolutePosition.Z); dupe.AbsolutePosition = new Vector3(AbsolutePosition.X, AbsolutePosition.Y, AbsolutePosition.Z);
if (!userExposed) if (!userExposed)
{
dupe.RootPart.IsAttachment = previousAttachmentStatus; dupe.RootPart.IsAttachment = previousAttachmentStatus;
}
dupe.CopyRootPart(m_rootPart, OwnerID, GroupID, userExposed); dupe.CopyRootPart(m_rootPart, OwnerID, GroupID, userExposed);
dupe.m_rootPart.LinkNum = m_rootPart.LinkNum; dupe.m_rootPart.LinkNum = m_rootPart.LinkNum;
@ -1806,16 +1808,6 @@ namespace OpenSim.Region.Framework.Scenes
dupe.RootPart.DoPhysicsPropertyUpdate(dupe.RootPart.PhysActor.IsPhysical, true); dupe.RootPart.DoPhysicsPropertyUpdate(dupe.RootPart.PhysActor.IsPhysical, true);
} }
// Now we've made a copy that replaces this one, we need to
// switch the owner to the person who did the copying
// Second Life copies an object and duplicates the first one in it's place
// So, we have to make a copy of this one, set it in it's place then set the owner on this one
if (userExposed)
{
SetRootPartOwner(m_rootPart, cAgentID, cGroupID);
m_rootPart.ScheduleFullUpdate();
}
List<SceneObjectPart> partList; List<SceneObjectPart> partList;
lockPartsForRead(true); lockPartsForRead(true);
@ -1837,12 +1829,6 @@ namespace OpenSim.Region.Framework.Scenes
SceneObjectPart newPart = dupe.CopyPart(part, OwnerID, GroupID, userExposed); SceneObjectPart newPart = dupe.CopyPart(part, OwnerID, GroupID, userExposed);
newPart.LinkNum = part.LinkNum; newPart.LinkNum = part.LinkNum;
if (userExposed)
{
SetPartOwner(newPart, cAgentID, cGroupID);
newPart.ScheduleFullUpdate();
}
} }
} }