Prevent linking objects while they are deeded. On unlinking deeded objects,

set LastOwnerID properly so the parts cannot be transferred, circumventing
no trans perms
remove-scene-viewer
Melanie 2011-11-11 00:28:12 +00:00
parent 2bd4eaeb19
commit a5838cf0a6
1 changed files with 19 additions and 4 deletions

View File

@ -1661,6 +1661,13 @@ namespace OpenSim.Region.Framework.Scenes
/// <param name="childPrims"></param> /// <param name="childPrims"></param>
protected internal void LinkObjects(SceneObjectPart root, List<SceneObjectPart> children) protected internal void LinkObjects(SceneObjectPart root, List<SceneObjectPart> children)
{ {
SceneObjectGroup parentGroup = root.ParentGroup;
if (parentGroup == null) return;
// Cowardly refuse to link to a group owned root
if (parentGroup.OwnerID == parentGroup.GroupID)
return;
Monitor.Enter(m_updateLock); Monitor.Enter(m_updateLock);
try try
{ {
@ -1683,11 +1690,14 @@ namespace OpenSim.Region.Framework.Scenes
foreach (SceneObjectGroup child in childGroups) foreach (SceneObjectGroup child in childGroups)
{ {
parentGroup.LinkToGroup(child); if (parentGroup.OwnerID == child.OwnerID)
{
parentGroup.LinkToGroup(child);
// this is here so physics gets updated! // this is here so physics gets updated!
// Don't remove! Bad juju! Stay away! or fix physics! // Don't remove! Bad juju! Stay away! or fix physics!
child.AbsolutePosition = child.AbsolutePosition; child.AbsolutePosition = child.AbsolutePosition;
}
} }
// We need to explicitly resend the newly link prim's object properties since no other actions // We need to explicitly resend the newly link prim's object properties since no other actions
@ -1725,9 +1735,14 @@ namespace OpenSim.Region.Framework.Scenes
if (part.ParentGroup.PrimCount != 1) // Skip single if (part.ParentGroup.PrimCount != 1) // Skip single
{ {
if (part.LinkNum < 2) // Root if (part.LinkNum < 2) // Root
{
rootParts.Add(part); rootParts.Add(part);
}
else else
{
part.LastOwnerID = part.ParentGroup.RootPart.LastOwnerID;
childParts.Add(part); childParts.Add(part);
}
SceneObjectGroup group = part.ParentGroup; SceneObjectGroup group = part.ParentGroup;
if (!affectedGroups.Contains(group)) if (!affectedGroups.Contains(group))