From 8520ceed630cd0abea467559f613a50311723cb0 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 6 Oct 2017 02:40:28 +0100 Subject: [PATCH 1/4] mantis 8246: don't allow 'delete object name' to delete attachments, but allow delete object id, with confirmation --- .../Objects/Commands/ObjectCommandsModule.cs | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs b/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs index 5a2a173835..28f1869131 100644 --- a/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs +++ b/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs @@ -803,12 +803,15 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands else so = m_scene.GetSceneObjectGroup(localId); - if (so!= null && !so.IsAttachment) - deletes.Add(so); - - // if (deletes.Count == 0) - // m_console.OutputFormat("No objects were found with uuid {0}", match); - + if (so!= null) + { + deletes.Add(so); + if(so.IsAttachment) + { + requireConfirmation = true; + m_console.OutputFormat("Warning: object with uuid {0} is a attachment", uuid); + } + } break; case "name": @@ -900,15 +903,15 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands List sceneObjects = new List(); Action searchAction; - + int refusedAttachments = 0; if (useRegex) { Regex nameRegex = new Regex(name); - searchAction = so => { if (nameRegex.IsMatch(so.Name)) { sceneObjects.Add(so); }}; + searchAction = so => { if (nameRegex.IsMatch(so.Name)) {if(!so.IsAttachment) sceneObjects.Add(so);}}; } else { - searchAction = so => { if (so.Name == name) { sceneObjects.Add(so); }}; + searchAction = so => { if (so.Name == name) {if(!so.IsAttachment) sceneObjects.Add(so);}}; } m_scene.ForEachSOG(searchAction); From 59afeb6c4cde99b836df61894564b54622b50a1c Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 6 Oct 2017 02:43:46 +0100 Subject: [PATCH 2/4] remove a dead line of code --- .../CoreModules/World/Objects/Commands/ObjectCommandsModule.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs b/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs index 28f1869131..3d786dda04 100644 --- a/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs +++ b/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs @@ -903,7 +903,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands List sceneObjects = new List(); Action searchAction; - int refusedAttachments = 0; + if (useRegex) { Regex nameRegex = new Regex(name); From df3759e09998bd05c2a09c79c38ada66fa6ec785 Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Fri, 13 Oct 2017 12:00:07 -0700 Subject: [PATCH 3/4] BulletSim: Add parameter "[BulletSim]AvatarWalkVelocityFactor=1.0" to adjust the walking speed passed from the simulator. Default is 1.0f so there should be no change for regions who do not change the factor. The adjustment for walking speed and AlwaysRun speed should be in the simulator and not the physics engines (who all assume TargetVelocity.set is only used for avatar walking/running) but that would require tweaking all the phyiscs engines. --- .../Region/PhysicsModules/BulletS/BSCharacter.cs | 14 ++++++++++---- OpenSim/Region/PhysicsModules/BulletS/BSParam.cs | 3 +++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/OpenSim/Region/PhysicsModules/BulletS/BSCharacter.cs b/OpenSim/Region/PhysicsModules/BulletS/BSCharacter.cs index 7faee703e5..d182c34890 100644 --- a/OpenSim/Region/PhysicsModules/BulletS/BSCharacter.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSCharacter.cs @@ -460,13 +460,19 @@ public sealed class BSCharacter : BSPhysObject set { DetailLog("{0},BSCharacter.setTargetVelocity,call,vel={1}", LocalID, value); - base.m_targetVelocity = value; OMV.Vector3 targetVel = value; - if (_setAlwaysRun && !_flying) - targetVel *= new OMV.Vector3(BSParam.AvatarAlwaysRunFactor, BSParam.AvatarAlwaysRunFactor, 1f); + if (!_flying) + { + if (_setAlwaysRun) + targetVel *= new OMV.Vector3(BSParam.AvatarAlwaysRunFactor, BSParam.AvatarAlwaysRunFactor, 1f); + else + if (BSParam.AvatarWalkVelocityFactor != 1f) + targetVel *= new OMV.Vector3(BSParam.AvatarWalkVelocityFactor, BSParam.AvatarWalkVelocityFactor, 1f); + } + base.m_targetVelocity = targetVel; if (m_moveActor != null) - m_moveActor.SetVelocityAndTarget(RawVelocity, targetVel, false /* inTaintTime */); + m_moveActor.SetVelocityAndTarget(RawVelocity, base.m_targetVelocity, false /* inTaintTime */); } } // Directly setting velocity means this is what the user really wants now. diff --git a/OpenSim/Region/PhysicsModules/BulletS/BSParam.cs b/OpenSim/Region/PhysicsModules/BulletS/BSParam.cs index fcda92c66a..495f752e46 100755 --- a/OpenSim/Region/PhysicsModules/BulletS/BSParam.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSParam.cs @@ -135,6 +135,7 @@ public static class BSParam public static bool AvatarToAvatarCollisionsByDefault { get; private set; } public static float AvatarFriction { get; private set; } public static float AvatarStandingFriction { get; private set; } + public static float AvatarWalkVelocityFactor { get; private set; } public static float AvatarAlwaysRunFactor { get; private set; } public static float AvatarDensity { get; private set; } public static float AvatarRestitution { get; private set; } @@ -604,6 +605,8 @@ public static class BSParam 0.2f ), new ParameterDefn("AvatarStandingFriction", "Avatar friction when standing. Changed on avatar recreation.", 0.95f ), + new ParameterDefn("AvatarWalkVelocityFactor", "Speed multiplier if avatar is walking", + 1.0f ), new ParameterDefn("AvatarAlwaysRunFactor", "Speed multiplier if avatar is set to always run", 1.3f ), // For historical reasons, density is reported * 100 From dd58f15bffdefe340da7780421753bcf2ca831cd Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 13 Oct 2017 20:00:38 +0100 Subject: [PATCH 4/4] mantis 8249: give better data to llDetectedGrab --- .../Region/Framework/Scenes/Scene.PacketHandlers.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs index 4fef9c3012..3fde5f1cc2 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs @@ -306,14 +306,14 @@ namespace OpenSim.Region.Framework.Scenes // If the touched prim handles touches, deliver it if ((part.ScriptEvents & scriptEvents.touch_start) != 0) - EventManager.TriggerObjectGrab(part.LocalId, 0, part.OffsetPosition, remoteClient, surfaceArg); + EventManager.TriggerObjectGrab(part.LocalId, 0, offsetPos, remoteClient, surfaceArg); // Deliver to the root prim if the touched prim doesn't handle touches // or if we're meant to pass on touches anyway. 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); + EventManager.TriggerObjectGrab(obj.RootPart.LocalId, part.LocalId, offsetPos, remoteClient, surfaceArg); } } @@ -343,15 +343,18 @@ namespace OpenSim.Region.Framework.Scenes if (surfaceArgs != null && surfaceArgs.Count > 0) surfaceArg = surfaceArgs[0]; + Vector3 grabOffset = pos - part.AbsolutePosition; // If the touched prim handles touches, deliver it if ((part.ScriptEvents & scriptEvents.touch) != 0) - EventManager.TriggerObjectGrabbing(part.LocalId, 0, part.OffsetPosition, remoteClient, surfaceArg); +// EventManager.TriggerObjectGrabbing(part.LocalId, 0, part.OffsetPosition, remoteClient, surfaceArg); + EventManager.TriggerObjectGrabbing(part.LocalId, 0, grabOffset, remoteClient, surfaceArg); // Deliver to the root prim if the touched prim doesn't handle touches // or if we're meant to pass on touches anyway. if (((part.ScriptEvents & scriptEvents.touch) == 0) || (part.PassTouches && (part.LocalId != group.RootPart.LocalId))) { - EventManager.TriggerObjectGrabbing(group.RootPart.LocalId, part.LocalId, part.OffsetPosition, remoteClient, surfaceArg); +// EventManager.TriggerObjectGrabbing(group.RootPart.LocalId, part.LocalId, part.OffsetPosition, remoteClient, surfaceArg); + EventManager.TriggerObjectGrabbing(group.RootPart.LocalId, part.LocalId, grabOffset, remoteClient, surfaceArg); } }