aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes
diff options
context:
space:
mode:
authorUbitUmarov2019-08-01 04:14:31 +0100
committerUbitUmarov2019-08-01 04:14:49 +0100
commit618c6ceda514190924e8003d4ee895f3e2e9f0cc (patch)
treea7e068a45d5807412ef5d567eb24b79557107277 /OpenSim/Region/Framework/Scenes
parentmantis8548: let rotation division be -(olderResult) this is formally more cor... (diff)
downloadopensim-SC-618c6ceda514190924e8003d4ee895f3e2e9f0cc.zip
opensim-SC-618c6ceda514190924e8003d4ee895f3e2e9f0cc.tar.gz
opensim-SC-618c6ceda514190924e8003d4ee895f3e2e9f0cc.tar.bz2
opensim-SC-618c6ceda514190924e8003d4ee895f3e2e9f0cc.tar.xz
mantis8569: do aggregate script events when a script is deleted; block nonphysical drag if a touch event is triggered, add a time guard on that
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs7
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs48
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs7
3 files changed, 40 insertions, 22 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
index 2995091..b0ecb80 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
@@ -341,7 +341,7 @@ namespace OpenSim.Region.Framework.Scenes
341 if(group == null || group.IsDeleted) 341 if(group == null || group.IsDeleted)
342 return; 342 return;
343 343
344 if (Permissions.CanMoveObject(group, remoteClient))// && PermissionsMngr.) 344 if (Permissions.CanMoveObject(group, remoteClient))
345 { 345 {
346 group.GrabMovement(objectID, offset, pos, remoteClient); 346 group.GrabMovement(objectID, offset, pos, remoteClient);
347 } 347 }
@@ -359,16 +359,13 @@ namespace OpenSim.Region.Framework.Scenes
359 Vector3 grabOffset = pos - part.AbsolutePosition; 359 Vector3 grabOffset = pos - part.AbsolutePosition;
360 // If the touched prim handles touches, deliver it 360 // If the touched prim handles touches, deliver it
361 if ((part.ScriptEvents & scriptEvents.touch) != 0) 361 if ((part.ScriptEvents & scriptEvents.touch) != 0)
362// EventManager.TriggerObjectGrabbing(part.LocalId, 0, part.OffsetPosition, remoteClient, surfaceArg);
363 EventManager.TriggerObjectGrabbing(part.LocalId, 0, grabOffset, remoteClient, surfaceArg); 362 EventManager.TriggerObjectGrabbing(part.LocalId, 0, grabOffset, remoteClient, surfaceArg);
363
364 // Deliver to the root prim if the touched prim doesn't handle touches 364 // Deliver to the root prim if the touched prim doesn't handle touches
365 // or if we're meant to pass on touches anyway. 365 // or if we're meant to pass on touches anyway.
366 if (((part.ScriptEvents & scriptEvents.touch) == 0) || 366 if (((part.ScriptEvents & scriptEvents.touch) == 0) ||
367 (part.PassTouches && (part.LocalId != group.RootPart.LocalId))) 367 (part.PassTouches && (part.LocalId != group.RootPart.LocalId)))
368 {
369// EventManager.TriggerObjectGrabbing(group.RootPart.LocalId, part.LocalId, part.OffsetPosition, remoteClient, surfaceArg);
370 EventManager.TriggerObjectGrabbing(group.RootPart.LocalId, part.LocalId, grabOffset, remoteClient, surfaceArg); 368 EventManager.TriggerObjectGrabbing(group.RootPart.LocalId, part.LocalId, grabOffset, remoteClient, surfaceArg);
371 }
372 } 369 }
373 370
374 public virtual void ProcessObjectDeGrab(uint localID, IClientAPI remoteClient, List<SurfaceTouchEventArgs> surfaceArgs) 371 public virtual void ProcessObjectDeGrab(uint localID, IClientAPI remoteClient, List<SurfaceTouchEventArgs> surfaceArgs)
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index c0bafc5..dcfe79b 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -2086,13 +2086,20 @@ namespace OpenSim.Region.Framework.Scenes
2086 2086
2087 public void ObjectGrabHandler(uint localId, Vector3 offsetPos, IClientAPI remoteClient) 2087 public void ObjectGrabHandler(uint localId, Vector3 offsetPos, IClientAPI remoteClient)
2088 { 2088 {
2089
2089 if (m_rootPart.LocalId == localId) 2090 if (m_rootPart.LocalId == localId)
2090 { 2091 {
2092 if((RootPart.ScriptEvents & scriptEvents.anytouch) != 0)
2093 lastTouchTime = Util.GetTimeStampMS();
2091 OnGrabGroup(offsetPos, remoteClient); 2094 OnGrabGroup(offsetPos, remoteClient);
2092 } 2095 }
2093 else 2096 else
2094 { 2097 {
2095 SceneObjectPart part = GetPart(localId); 2098 SceneObjectPart part = GetPart(localId);
2099
2100 if (((part.ScriptEvents & scriptEvents.anytouch) != 0) ||
2101 (part.PassTouches && (RootPart.ScriptEvents & scriptEvents.anytouch) != 0))
2102 lastTouchTime = Util.GetTimeStampMS();
2096 OnGrabPart(part, offsetPos, remoteClient); 2103 OnGrabPart(part, offsetPos, remoteClient);
2097 } 2104 }
2098 } 2105 }
@@ -3615,6 +3622,10 @@ namespace OpenSim.Region.Framework.Scenes
3615// part.UpdatePrimFlags(UsesPhysics, IsTemporary, IsPhantom, IsVolumeDetect, false); 3622// part.UpdatePrimFlags(UsesPhysics, IsTemporary, IsPhantom, IsVolumeDetect, false);
3616 } 3623 }
3617 3624
3625 double lastTouchTime = 0;
3626
3627
3628
3618 /// <summary> 3629 /// <summary>
3619 /// If object is physical, apply force to move it around 3630 /// If object is physical, apply force to move it around
3620 /// If object is not physical, just put it at the resulting location 3631 /// If object is not physical, just put it at the resulting location
@@ -3623,7 +3634,7 @@ namespace OpenSim.Region.Framework.Scenes
3623 /// <param name="offset">Always seems to be 0,0,0, so ignoring</param> 3634 /// <param name="offset">Always seems to be 0,0,0, so ignoring</param>
3624 /// <param name="pos">New position. We do the math here to turn it into a force</param> 3635 /// <param name="pos">New position. We do the math here to turn it into a force</param>
3625 /// <param name="remoteClient"></param> 3636 /// <param name="remoteClient"></param>
3626 public void GrabMovement(UUID partID, Vector3 offset, Vector3 pos, IClientAPI remoteClient) 3637 public void GrabMovement(UUID partID, Vector3 offset, Vector3 pos, IClientAPI remoteClienth)
3627 { 3638 {
3628 if (m_scene.EventManager.TriggerGroupMove(UUID, pos)) 3639 if (m_scene.EventManager.TriggerGroupMove(UUID, pos))
3629 { 3640 {
@@ -3650,25 +3661,32 @@ namespace OpenSim.Region.Framework.Scenes
3650 } 3661 }
3651 else 3662 else
3652 { 3663 {
3653 NonPhysicalGrabMovement(pos); 3664 if(IsAttachment)
3665 return;
3666
3667 // block movement if there was a touch at start
3668 double now = Util.GetTimeStampMS();
3669 if (now - lastTouchTime < 250)
3670 {
3671 lastTouchTime = now;
3672 return;
3673 }
3674
3675 // a touch or pass may had become active ??
3676 if (((part.ScriptEvents & scriptEvents.anytouch) != 0) ||
3677 (part.PassTouches && (RootPart.ScriptEvents & scriptEvents.anytouch) != 0))
3678 {
3679 lastTouchTime = now;
3680 return;
3681 }
3682
3683 lastTouchTime = 0;
3684 UpdateGroupPosition(pos);
3654 } 3685 }
3655 } 3686 }
3656 } 3687 }
3657 3688
3658 /// <summary> 3689 /// <summary>
3659 /// Apply possition for grabbing non-physical linksets (Ctrl+Drag)
3660 /// This MUST be blocked for linksets that contain touch scripts because the viewer triggers grab on the touch
3661 /// event (Viewer Bug?) This would allow anyone to drag a linkset with a touch script. SL behaviour is also to
3662 /// block grab on prims with touch events.
3663 /// </summary>
3664 /// <param name="pos">New Position</param>
3665 public void NonPhysicalGrabMovement(Vector3 pos)
3666 {
3667 if(!IsAttachment && ScriptCount() == 0)
3668 UpdateGroupPosition(pos);
3669 }
3670
3671 /// <summary>
3672 /// If object is physical, prepare for spinning torques (set flag to save old orientation) 3690 /// If object is physical, prepare for spinning torques (set flag to save old orientation)
3673 /// </summary> 3691 /// </summary>
3674 /// <param name="rotation">Rotation. We do the math here to turn it into a torque</param> 3692 /// <param name="rotation">Rotation. We do the math here to turn it into a torque</param>
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
index a0f8959..1ba74f4 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -1091,7 +1091,6 @@ namespace OpenSim.Region.Framework.Scenes
1091 m_part.ParentGroup.InvalidateDeepEffectivePerms(); 1091 m_part.ParentGroup.InvalidateDeepEffectivePerms();
1092 1092
1093 m_inventorySerial++; 1093 m_inventorySerial++;
1094 m_part.TriggerScriptChangedEvent(Changed.INVENTORY);
1095 1094
1096 HasInventoryChanged = true; 1095 HasInventoryChanged = true;
1097 m_part.ParentGroup.HasGroupChanged = true; 1096 m_part.ParentGroup.HasGroupChanged = true;
@@ -1113,8 +1112,12 @@ namespace OpenSim.Region.Framework.Scenes
1113 m_part.RemFlag(PrimFlags.Scripted); 1112 m_part.RemFlag(PrimFlags.Scripted);
1114 } 1113 }
1115 1114
1116 m_part.ScheduleFullUpdate(); 1115 if (type == (int)InventoryType.LSL)
1116 m_part.aggregateScriptEvents(); // this also does full update
1117 else
1118 m_part.ScheduleFullUpdate();
1117 1119
1120 m_part.TriggerScriptChangedEvent(Changed.INVENTORY);
1118 return type; 1121 return type;
1119 } 1122 }
1120 else 1123 else