From 901fdca13b8b6617ceabc4766c684799f4f8739b Mon Sep 17 00:00:00 2001 From: Dr Scofield Date: Wed, 27 May 2009 18:01:06 +0000 Subject: From: Chris Yeoh The attached patch implements llPassTouches. It has been added to the export/import XML along with the flag for AllowedInventoryDrop. The MySQL backend has been updated as well, though I haven't done one of those before so could do with a check. I added the migration mysql file as well. The other data backends need updating as well. --- OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs | 10 ++++++++-- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 15 ++++++++++++++- .../ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 5 ++++- 3 files changed, 26 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs index 4c99873..8bf47e7 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs @@ -251,10 +251,16 @@ namespace OpenSim.Region.Framework.Scenes // If the touched prim handles touches, deliver it // If not, deliver to root prim - if ((part.ScriptEvents & scriptEvents.touch_start) != 0) + if ((part.ScriptEvents & scriptEvents.touch_start) != 0) EventManager.TriggerObjectGrab(part.LocalId, 0, part.OffsetPosition, remoteClient, surfaceArg); - else + // Deliver to the root prim if the touched prim doesn't handle touches + // or if we're meant to pass on touches anyway. Don't send to root prim + // if prim touched is the root prim as we just did it + if (((part.ScriptEvents & scriptEvents.touch_start) == 0) || + (part.PassTouches && (part.LocalId != obj.RootPart.LocalId))) + { EventManager.TriggerObjectGrab(obj.RootPart.LocalId, part.LocalId, part.OffsetPosition, remoteClient, surfaceArg); + } return; } diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 9a455ae..719b028 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -102,7 +102,6 @@ namespace OpenSim.Region.Framework.Scenes #region Fields - [XmlIgnore] public bool AllowedDrop = false; [XmlIgnore] @@ -216,6 +215,9 @@ namespace OpenSim.Region.Framework.Scenes private readonly UndoStack m_undo = new UndoStack(5); private UUID _creatorID; + + private bool m_passTouches = false; + /// /// Only used internally to schedule client updates. /// 0 - no update is scheduled @@ -431,6 +433,17 @@ namespace OpenSim.Region.Framework.Scenes } } + public bool PassTouches + { + get { return m_passTouches; } + set + { + m_passTouches = value; + if (ParentGroup != null) + ParentGroup.HasGroupChanged = true; + } + } + public ulong RegionHandle { get { return m_regionHandle; } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index f932dbe..f4a944c 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -3705,7 +3705,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llPassTouches(int pass) { m_host.AddScriptLPS(1); - NotImplemented("llPassTouches"); + if (pass != 0) + m_host.PassTouches = true; + else + m_host.PassTouches = false; } public LSL_String llRequestAgentData(string id, int data) -- cgit v1.1