From 6a77a656753fd5433cbb105649b8dd1e3cf83337 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Thu, 14 Jun 2012 00:35:26 +0100 Subject: [PATCH 1/2] minor: remove unnecessary IsAttachment = false setting for new object in UploadObjectAssetModule, property always starts as false --- .../Linden/Caps/ObjectCaps/UploadObjectAssetModule.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/UploadObjectAssetModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/UploadObjectAssetModule.cs index f0f398417f..ba902b2a3b 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/UploadObjectAssetModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/UploadObjectAssetModule.cs @@ -333,7 +333,6 @@ namespace OpenSim.Region.ClientStack.Linden grp.AbsolutePosition = obj.Position; prim.RotationOffset = obj.Rotation; - grp.IsAttachment = false; // Required for linking grp.RootPart.ClearUpdateSchedule(); From a4290048e5333d34910fd8c4dfd6cb9b5819d1c1 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Thu, 14 Jun 2012 01:12:16 +0100 Subject: [PATCH 2/2] Add SOG.HasPrivateAttachmentPoint to tell if a SOG has a private attachment point. HUDs attachment points are private. Change SOP.SendFullUpdateToClient() and SoundModule.PlayAttachedSound() to use this rather than different magic number formulations. This also corrects a bug in PlayAttachedSound() where the code assumed that all attachment points over 30 were HUDs. It appears this is no longer true with Neck and Root (Avatar Center) --- .../CoreModules/World/Sound/SoundModule.cs | 7 ++----- .../Region/Framework/Scenes/SceneObjectGroup.cs | 16 ++++++++++++++++ .../Region/Framework/Scenes/SceneObjectPart.cs | 5 +++-- 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs b/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs index 93b10052fc..d768a1ac16 100644 --- a/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs +++ b/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs @@ -78,11 +78,8 @@ namespace OpenSim.Region.CoreModules.World.Sound if (grp.IsAttachment) { - if (grp.AttachmentPoint > 30) // HUD - { - if (sp.ControllingClient.AgentId != grp.OwnerID) - return; - } + if (grp.HasPrivateAttachmentPoint && sp.ControllingClient.AgentId != grp.OwnerID) + return; if (sp.ControllingClient.AgentId == grp.OwnerID) dis = 0; diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 20d7a01bd7..619296ed61 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -180,6 +180,22 @@ namespace OpenSim.Region.Framework.Scenes } } + /// + /// If this scene object has an attachment point then indicate whether there is a point where + /// attachments are perceivable by avatars other than the avatar to which this object is attached. + /// + /// + /// HUDs are not perceivable by other avatars. + /// + public bool HasPrivateAttachmentPoint + { + get + { + return AttachmentPoint >= (uint)OpenMetaverse.AttachmentPoint.HUDCenter2 + && AttachmentPoint <= (uint)OpenMetaverse.AttachmentPoint.HUDBottomRight; + } + } + public void ClearPartAttachmentData() { AttachmentPoint = 0; diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 17c766191f..7640fc04b8 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -2573,8 +2573,9 @@ namespace OpenSim.Region.Framework.Scenes if (ParentGroup.IsDeleted) return; - if (ParentGroup.IsAttachment && (ParentGroup.AttachedAvatar != remoteClient.AgentId) && - (ParentGroup.AttachmentPoint >= 31) && (ParentGroup.AttachmentPoint <= 38)) + if (ParentGroup.IsAttachment + && ParentGroup.AttachedAvatar != remoteClient.AgentId + && ParentGroup.HasPrivateAttachmentPoint) return; if (remoteClient.AgentId == OwnerID)