diff options
author | Melanie | 2012-05-30 00:50:47 +0200 |
---|---|---|
committer | Melanie | 2012-05-30 00:50:47 +0200 |
commit | 4358bb8f850863aec8a519c6f533c298630dc1af (patch) | |
tree | 28cf0ae831bc5eaf2e0813ab740847def9188fef | |
parent | fix physics not reporting collisions only with terrain (diff) | |
download | opensim-SC-4358bb8f850863aec8a519c6f533c298630dc1af.zip opensim-SC-4358bb8f850863aec8a519c6f533c298630dc1af.tar.gz opensim-SC-4358bb8f850863aec8a519c6f533c298630dc1af.tar.bz2 opensim-SC-4358bb8f850863aec8a519c6f533c298630dc1af.tar.xz |
Fix the log standing attach-from-world bug.
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 50 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | 51 |
2 files changed, 59 insertions, 42 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 2d46a5b..5912a15 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | |||
@@ -3761,24 +3761,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3761 | { | 3761 | { |
3762 | SceneObjectPart part = (SceneObjectPart)update.Entity; | 3762 | SceneObjectPart part = (SceneObjectPart)update.Entity; |
3763 | 3763 | ||
3764 | // Please do not remove this unless you can demonstrate on the OpenSim mailing list that a client | ||
3765 | // will never receive an update after a prim kill. Even then, keeping the kill record may be a good | ||
3766 | // safety measure. | ||
3767 | // | ||
3768 | // If a Linden Lab 1.23.5 client (and possibly later and earlier) receives an object update | ||
3769 | // after a kill, it will keep displaying the deleted object until relog. OpenSim currently performs | ||
3770 | // updates and kills on different threads with different scheduling strategies, hence this protection. | ||
3771 | // | ||
3772 | // This doesn't appear to apply to child prims - a client will happily ignore these updates | ||
3773 | // after the root prim has been deleted. | ||
3774 | lock (m_killRecord) | ||
3775 | { | ||
3776 | if (m_killRecord.Contains(part.LocalId)) | ||
3777 | continue; | ||
3778 | if (m_killRecord.Contains(part.ParentGroup.RootPart.LocalId)) | ||
3779 | continue; | ||
3780 | } | ||
3781 | |||
3782 | if (part.ParentGroup.IsDeleted) | 3764 | if (part.ParentGroup.IsDeleted) |
3783 | continue; | 3765 | continue; |
3784 | 3766 | ||
@@ -3816,7 +3798,39 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3816 | // attachments until the avatar becomes root. | 3798 | // attachments until the avatar becomes root. |
3817 | if (sp.IsChildAgent) | 3799 | if (sp.IsChildAgent) |
3818 | continue; | 3800 | continue; |
3801 | |||
3802 | // If the object is an attachment we don't want it to be in the kill | ||
3803 | // record. Else attaching from inworld and subsequently dropping | ||
3804 | // it will no longer work. | ||
3805 | lock (m_killRecord) | ||
3806 | { | ||
3807 | m_killRecord.Remove(part.LocalId); | ||
3808 | m_killRecord.Remove(part.ParentGroup.RootPart.LocalId); | ||
3809 | } | ||
3819 | } | 3810 | } |
3811 | else | ||
3812 | { | ||
3813 | // Please do not remove this unless you can demonstrate on the OpenSim mailing list that a client | ||
3814 | // will never receive an update after a prim kill. Even then, keeping the kill record may be a good | ||
3815 | // safety measure. | ||
3816 | // | ||
3817 | // If a Linden Lab 1.23.5 client (and possibly later and earlier) receives an object update | ||
3818 | // after a kill, it will keep displaying the deleted object until relog. OpenSim currently performs | ||
3819 | // updates and kills on different threads with different scheduling strategies, hence this protection. | ||
3820 | // | ||
3821 | // This doesn't appear to apply to child prims - a client will happily ignore these updates | ||
3822 | // after the root prim has been deleted. | ||
3823 | // | ||
3824 | // We ignore this for attachments because attaching something from inworld breaks unless we do. | ||
3825 | lock (m_killRecord) | ||
3826 | { | ||
3827 | if (m_killRecord.Contains(part.LocalId)) | ||
3828 | continue; | ||
3829 | if (m_killRecord.Contains(part.ParentGroup.RootPart.LocalId)) | ||
3830 | continue; | ||
3831 | } | ||
3832 | } | ||
3833 | |||
3820 | if (part.ParentGroup.IsAttachment && m_disableFacelights) | 3834 | if (part.ParentGroup.IsAttachment && m_disableFacelights) |
3821 | { | 3835 | { |
3822 | if (part.ParentGroup.RootPart.Shape.State != (byte)AttachmentPoint.LeftHand && | 3836 | if (part.ParentGroup.RootPart.Shape.State != (byte)AttachmentPoint.LeftHand && |
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index 78ae5e9..d7c7283 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | |||
@@ -631,19 +631,19 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
631 | // "[ATTACHMENTS MODULE]: Called AddSceneObjectAsAttachment for object {0} {1} for {2}", | 631 | // "[ATTACHMENTS MODULE]: Called AddSceneObjectAsAttachment for object {0} {1} for {2}", |
632 | // grp.Name, grp.LocalId, remoteClient.Name); | 632 | // grp.Name, grp.LocalId, remoteClient.Name); |
633 | 633 | ||
634 | Vector3 inventoryStoredPosition = new Vector3 | 634 | // Vector3 inventoryStoredPosition = new Vector3 |
635 | (((grp.AbsolutePosition.X > (int)Constants.RegionSize) | 635 | // (((grp.AbsolutePosition.X > (int)Constants.RegionSize) |
636 | ? (float)Constants.RegionSize - 6 | 636 | // ? (float)Constants.RegionSize - 6 |
637 | : grp.AbsolutePosition.X) | 637 | // : grp.AbsolutePosition.X) |
638 | , | 638 | // , |
639 | (grp.AbsolutePosition.Y > (int)Constants.RegionSize) | 639 | // (grp.AbsolutePosition.Y > (int)Constants.RegionSize) |
640 | ? (float)Constants.RegionSize - 6 | 640 | // ? (float)Constants.RegionSize - 6 |
641 | : grp.AbsolutePosition.Y, | 641 | // : grp.AbsolutePosition.Y, |
642 | grp.AbsolutePosition.Z); | 642 | // grp.AbsolutePosition.Z); |
643 | 643 | // | |
644 | Vector3 originalPosition = grp.AbsolutePosition; | 644 | // Vector3 originalPosition = grp.AbsolutePosition; |
645 | 645 | // | |
646 | grp.AbsolutePosition = inventoryStoredPosition; | 646 | // grp.AbsolutePosition = inventoryStoredPosition; |
647 | 647 | ||
648 | // If we're being called from a script, then trying to serialize that same script's state will not complete | 648 | // If we're being called from a script, then trying to serialize that same script's state will not complete |
649 | // in any reasonable time period. Therefore, we'll avoid it. The worst that can happen is that if | 649 | // 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 | |||
651 | // without state on relog. Arguably, this is what we want anyway. | 651 | // without state on relog. Arguably, this is what we want anyway. |
652 | string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(grp, false); | 652 | string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(grp, false); |
653 | 653 | ||
654 | grp.AbsolutePosition = originalPosition; | 654 | // grp.AbsolutePosition = originalPosition; |
655 | 655 | ||
656 | AssetBase asset = m_scene.CreateAsset( | 656 | AssetBase asset = m_scene.CreateAsset( |
657 | grp.GetPartName(grp.LocalId), | 657 | grp.GetPartName(grp.LocalId), |
@@ -679,21 +679,24 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
679 | else // oopsies | 679 | else // oopsies |
680 | item.Folder = UUID.Zero; | 680 | item.Folder = UUID.Zero; |
681 | 681 | ||
682 | // Nix the special bits we used to use for slam and the folded perms | ||
683 | uint allowablePermissionsMask = (uint)(PermissionMask.Copy | PermissionMask.Transfer | PermissionMask.Modify | PermissionMask.Move); | ||
684 | |||
682 | if ((sp.UUID != grp.RootPart.OwnerID) && m_scene.Permissions.PropagatePermissions()) | 685 | if ((sp.UUID != grp.RootPart.OwnerID) && m_scene.Permissions.PropagatePermissions()) |
683 | { | 686 | { |
684 | item.BasePermissions = grp.RootPart.NextOwnerMask; | 687 | item.BasePermissions = grp.RootPart.BaseMask & grp.RootPart.NextOwnerMask & allowablePermissionsMask; |
685 | item.CurrentPermissions = grp.RootPart.NextOwnerMask; | 688 | item.CurrentPermissions = grp.RootPart.BaseMask & grp.RootPart.NextOwnerMask & allowablePermissionsMask; |
686 | item.NextPermissions = grp.RootPart.NextOwnerMask; | 689 | item.NextPermissions = grp.RootPart.NextOwnerMask & allowablePermissionsMask; |
687 | item.EveryOnePermissions = grp.RootPart.EveryoneMask & grp.RootPart.NextOwnerMask; | 690 | item.EveryOnePermissions = grp.RootPart.EveryoneMask & grp.RootPart.NextOwnerMask & allowablePermissionsMask; |
688 | item.GroupPermissions = grp.RootPart.GroupMask & grp.RootPart.NextOwnerMask; | 691 | item.GroupPermissions = grp.RootPart.GroupMask & grp.RootPart.NextOwnerMask & allowablePermissionsMask; |
689 | } | 692 | } |
690 | else | 693 | else |
691 | { | 694 | { |
692 | item.BasePermissions = grp.RootPart.BaseMask; | 695 | item.BasePermissions = grp.RootPart.BaseMask & allowablePermissionsMask; |
693 | item.CurrentPermissions = grp.RootPart.OwnerMask; | 696 | item.CurrentPermissions = grp.RootPart.OwnerMask & allowablePermissionsMask; |
694 | item.NextPermissions = grp.RootPart.NextOwnerMask; | 697 | item.NextPermissions = grp.RootPart.NextOwnerMask & allowablePermissionsMask; |
695 | item.EveryOnePermissions = grp.RootPart.EveryoneMask; | 698 | item.EveryOnePermissions = grp.RootPart.EveryoneMask & allowablePermissionsMask; |
696 | item.GroupPermissions = grp.RootPart.GroupMask; | 699 | item.GroupPermissions = grp.RootPart.GroupMask & allowablePermissionsMask; |
697 | } | 700 | } |
698 | item.CreationDate = Util.UnixTimeSinceEpoch(); | 701 | item.CreationDate = Util.UnixTimeSinceEpoch(); |
699 | 702 | ||