Fix the log standing attach-from-world bug.

avinationmerge
Melanie 2012-05-30 00:50:47 +02:00
parent 3e9a831e87
commit 4358bb8f85
2 changed files with 59 additions and 42 deletions

View File

@ -3761,24 +3761,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
{ {
SceneObjectPart part = (SceneObjectPart)update.Entity; SceneObjectPart part = (SceneObjectPart)update.Entity;
// Please do not remove this unless you can demonstrate on the OpenSim mailing list that a client
// will never receive an update after a prim kill. Even then, keeping the kill record may be a good
// safety measure.
//
// If a Linden Lab 1.23.5 client (and possibly later and earlier) receives an object update
// after a kill, it will keep displaying the deleted object until relog. OpenSim currently performs
// updates and kills on different threads with different scheduling strategies, hence this protection.
//
// This doesn't appear to apply to child prims - a client will happily ignore these updates
// after the root prim has been deleted.
lock (m_killRecord)
{
if (m_killRecord.Contains(part.LocalId))
continue;
if (m_killRecord.Contains(part.ParentGroup.RootPart.LocalId))
continue;
}
if (part.ParentGroup.IsDeleted) if (part.ParentGroup.IsDeleted)
continue; continue;
@ -3816,7 +3798,39 @@ namespace OpenSim.Region.ClientStack.LindenUDP
// attachments until the avatar becomes root. // attachments until the avatar becomes root.
if (sp.IsChildAgent) if (sp.IsChildAgent)
continue; continue;
// If the object is an attachment we don't want it to be in the kill
// record. Else attaching from inworld and subsequently dropping
// it will no longer work.
lock (m_killRecord)
{
m_killRecord.Remove(part.LocalId);
m_killRecord.Remove(part.ParentGroup.RootPart.LocalId);
} }
}
else
{
// Please do not remove this unless you can demonstrate on the OpenSim mailing list that a client
// will never receive an update after a prim kill. Even then, keeping the kill record may be a good
// safety measure.
//
// If a Linden Lab 1.23.5 client (and possibly later and earlier) receives an object update
// after a kill, it will keep displaying the deleted object until relog. OpenSim currently performs
// updates and kills on different threads with different scheduling strategies, hence this protection.
//
// This doesn't appear to apply to child prims - a client will happily ignore these updates
// after the root prim has been deleted.
//
// We ignore this for attachments because attaching something from inworld breaks unless we do.
lock (m_killRecord)
{
if (m_killRecord.Contains(part.LocalId))
continue;
if (m_killRecord.Contains(part.ParentGroup.RootPart.LocalId))
continue;
}
}
if (part.ParentGroup.IsAttachment && m_disableFacelights) if (part.ParentGroup.IsAttachment && m_disableFacelights)
{ {
if (part.ParentGroup.RootPart.Shape.State != (byte)AttachmentPoint.LeftHand && if (part.ParentGroup.RootPart.Shape.State != (byte)AttachmentPoint.LeftHand &&

View File

@ -631,19 +631,19 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
// "[ATTACHMENTS MODULE]: Called AddSceneObjectAsAttachment for object {0} {1} for {2}", // "[ATTACHMENTS MODULE]: Called AddSceneObjectAsAttachment for object {0} {1} for {2}",
// grp.Name, grp.LocalId, remoteClient.Name); // grp.Name, grp.LocalId, remoteClient.Name);
Vector3 inventoryStoredPosition = new Vector3 // Vector3 inventoryStoredPosition = new Vector3
(((grp.AbsolutePosition.X > (int)Constants.RegionSize) // (((grp.AbsolutePosition.X > (int)Constants.RegionSize)
? (float)Constants.RegionSize - 6 // ? (float)Constants.RegionSize - 6
: grp.AbsolutePosition.X) // : grp.AbsolutePosition.X)
, // ,
(grp.AbsolutePosition.Y > (int)Constants.RegionSize) // (grp.AbsolutePosition.Y > (int)Constants.RegionSize)
? (float)Constants.RegionSize - 6 // ? (float)Constants.RegionSize - 6
: grp.AbsolutePosition.Y, // : grp.AbsolutePosition.Y,
grp.AbsolutePosition.Z); // grp.AbsolutePosition.Z);
//
Vector3 originalPosition = grp.AbsolutePosition; // Vector3 originalPosition = grp.AbsolutePosition;
//
grp.AbsolutePosition = inventoryStoredPosition; // grp.AbsolutePosition = inventoryStoredPosition;
// If we're being called from a script, then trying to serialize that same script's state will not complete // If we're being called from a script, then trying to serialize that same script's state will not complete
// in any reasonable time period. Therefore, we'll avoid it. The worst that can happen is that if // in any reasonable time period. Therefore, we'll avoid it. The worst that can happen is that if
@ -651,7 +651,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
// without state on relog. Arguably, this is what we want anyway. // without state on relog. Arguably, this is what we want anyway.
string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(grp, false); string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(grp, false);
grp.AbsolutePosition = originalPosition; // grp.AbsolutePosition = originalPosition;
AssetBase asset = m_scene.CreateAsset( AssetBase asset = m_scene.CreateAsset(
grp.GetPartName(grp.LocalId), grp.GetPartName(grp.LocalId),
@ -679,21 +679,24 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
else // oopsies else // oopsies
item.Folder = UUID.Zero; item.Folder = UUID.Zero;
// Nix the special bits we used to use for slam and the folded perms
uint allowablePermissionsMask = (uint)(PermissionMask.Copy | PermissionMask.Transfer | PermissionMask.Modify | PermissionMask.Move);
if ((sp.UUID != grp.RootPart.OwnerID) && m_scene.Permissions.PropagatePermissions()) if ((sp.UUID != grp.RootPart.OwnerID) && m_scene.Permissions.PropagatePermissions())
{ {
item.BasePermissions = grp.RootPart.NextOwnerMask; item.BasePermissions = grp.RootPart.BaseMask & grp.RootPart.NextOwnerMask & allowablePermissionsMask;
item.CurrentPermissions = grp.RootPart.NextOwnerMask; item.CurrentPermissions = grp.RootPart.BaseMask & grp.RootPart.NextOwnerMask & allowablePermissionsMask;
item.NextPermissions = grp.RootPart.NextOwnerMask; item.NextPermissions = grp.RootPart.NextOwnerMask & allowablePermissionsMask;
item.EveryOnePermissions = grp.RootPart.EveryoneMask & grp.RootPart.NextOwnerMask; item.EveryOnePermissions = grp.RootPart.EveryoneMask & grp.RootPart.NextOwnerMask & allowablePermissionsMask;
item.GroupPermissions = grp.RootPart.GroupMask & grp.RootPart.NextOwnerMask; item.GroupPermissions = grp.RootPart.GroupMask & grp.RootPart.NextOwnerMask & allowablePermissionsMask;
} }
else else
{ {
item.BasePermissions = grp.RootPart.BaseMask; item.BasePermissions = grp.RootPart.BaseMask & allowablePermissionsMask;
item.CurrentPermissions = grp.RootPart.OwnerMask; item.CurrentPermissions = grp.RootPart.OwnerMask & allowablePermissionsMask;
item.NextPermissions = grp.RootPart.NextOwnerMask; item.NextPermissions = grp.RootPart.NextOwnerMask & allowablePermissionsMask;
item.EveryOnePermissions = grp.RootPart.EveryoneMask; item.EveryOnePermissions = grp.RootPart.EveryoneMask & allowablePermissionsMask;
item.GroupPermissions = grp.RootPart.GroupMask; item.GroupPermissions = grp.RootPart.GroupMask & allowablePermissionsMask;
} }
item.CreationDate = Util.UnixTimeSinceEpoch(); item.CreationDate = Util.UnixTimeSinceEpoch();