aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2014-08-29 23:40:21 +0100
committerJustin Clark-Casey (justincc)2014-08-29 23:40:21 +0100
commit099212167b2b3d5f8bdf529d24a6c47536716706 (patch)
tree7f258a6c50ee2b00c81c82e588afb4ccdb7329ae /OpenSim/Region
parentIgnore whitespace when reading serialized XML objects. (diff)
downloadopensim-SC-099212167b2b3d5f8bdf529d24a6c47536716706.zip
opensim-SC-099212167b2b3d5f8bdf529d24a6c47536716706.tar.gz
opensim-SC-099212167b2b3d5f8bdf529d24a6c47536716706.tar.bz2
opensim-SC-099212167b2b3d5f8bdf529d24a6c47536716706.tar.xz
Implement STATUS_BLOCK_GRAB_OBJECT in llSetStatus()/llGetStatus() and correct effect of STATUS_BLOCK_GRAB
As per http://wiki.secondlife.com/wiki/LlSetStatus Setting STATUS_BLOCK_GRAB_OBJECT prevents or allows move of a physical linkset by grab on any prim. Setting STATUS_BLOCK_GRAB prevents or allows move of a physical linkset by grab on a particular prim. Previously, setting STATUS_BLOCK_GRAB would prevent drag via all prims of the linkset.
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneGraph.cs3
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs16
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs18
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs18
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs1
5 files changed, 26 insertions, 30 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index 3678c7e..51f50d9 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -1446,8 +1446,9 @@ namespace OpenSim.Region.Framework.Scenes
1446 { 1446 {
1447 if (m_parentScene.Permissions.CanMoveObject(group.UUID, remoteClient.AgentId))// && PermissionsMngr.) 1447 if (m_parentScene.Permissions.CanMoveObject(group.UUID, remoteClient.AgentId))// && PermissionsMngr.)
1448 { 1448 {
1449 group.GrabMovement(offset, pos, remoteClient); 1449 group.GrabMovement(objectID, offset, pos, remoteClient);
1450 } 1450 }
1451
1451 // This is outside the above permissions condition 1452 // This is outside the above permissions condition
1452 // so that if the object is locked the client moving the object 1453 // so that if the object is locked the client moving the object
1453 // get's it's position on the simulator even if it was the same as before 1454 // get's it's position on the simulator even if it was the same as before
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index e37bbd8..2aeccd8 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -828,6 +828,12 @@ namespace OpenSim.Region.Framework.Scenes
828 public UUID FromFolderID { get; set; } 828 public UUID FromFolderID { get; set; }
829 829
830 /// <summary> 830 /// <summary>
831 /// If true then grabs are blocked no matter what the individual part BlockGrab setting.
832 /// </summary>
833 /// <value><c>true</c> if block grab override; otherwise, <c>false</c>.</value>
834 public bool BlockGrabOverride { get; set; }
835
836 /// <summary>
831 /// IDs of all avatars sat on this scene object. 837 /// IDs of all avatars sat on this scene object.
832 /// </summary> 838 /// </summary>
833 /// <remarks> 839 /// <remarks>
@@ -2610,20 +2616,26 @@ namespace OpenSim.Region.Framework.Scenes
2610 /// If object is physical, apply force to move it around 2616 /// If object is physical, apply force to move it around
2611 /// If object is not physical, just put it at the resulting location 2617 /// If object is not physical, just put it at the resulting location
2612 /// </summary> 2618 /// </summary>
2619 /// <param name="partID">Part ID to check for grab</param>
2613 /// <param name="offset">Always seems to be 0,0,0, so ignoring</param> 2620 /// <param name="offset">Always seems to be 0,0,0, so ignoring</param>
2614 /// <param name="pos">New position. We do the math here to turn it into a force</param> 2621 /// <param name="pos">New position. We do the math here to turn it into a force</param>
2615 /// <param name="remoteClient"></param> 2622 /// <param name="remoteClient"></param>
2616 public void GrabMovement(Vector3 offset, Vector3 pos, IClientAPI remoteClient) 2623 public void GrabMovement(UUID partID, Vector3 offset, Vector3 pos, IClientAPI remoteClient)
2617 { 2624 {
2618 if (m_scene.EventManager.TriggerGroupMove(UUID, pos)) 2625 if (m_scene.EventManager.TriggerGroupMove(UUID, pos))
2619 { 2626 {
2627 SceneObjectPart part = GetPart(partID);
2628
2629 if (part == null)
2630 return;
2631
2620 PhysicsActor pa = m_rootPart.PhysActor; 2632 PhysicsActor pa = m_rootPart.PhysActor;
2621 2633
2622 if (pa != null) 2634 if (pa != null)
2623 { 2635 {
2624 if (pa.IsPhysical) 2636 if (pa.IsPhysical)
2625 { 2637 {
2626 if (!m_rootPart.BlockGrab) 2638 if (!BlockGrabOverride && !part.BlockGrab)
2627 { 2639 {
2628 Vector3 llmoveforce = pos - AbsolutePosition; 2640 Vector3 llmoveforce = pos - AbsolutePosition;
2629 Vector3 grabforce = llmoveforce; 2641 Vector3 grabforce = llmoveforce;
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 05e3ee9..8785ca9 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -186,7 +186,7 @@ namespace OpenSim.Region.Framework.Scenes
186 186
187 public bool RETURN_AT_EDGE; 187 public bool RETURN_AT_EDGE;
188 188
189 public bool BlockGrab; 189 public bool BlockGrab { get; set; }
190 190
191 public bool StatusSandbox; 191 public bool StatusSandbox;
192 192
@@ -2079,22 +2079,6 @@ namespace OpenSim.Region.Framework.Scenes
2079 ParentGroup.RootPart.RETURN_AT_EDGE = p; 2079 ParentGroup.RootPart.RETURN_AT_EDGE = p;
2080 } 2080 }
2081 2081
2082 public bool GetBlockGrab()
2083 {
2084 if (ParentGroup.IsDeleted)
2085 return false;
2086
2087 return ParentGroup.RootPart.BlockGrab;
2088 }
2089
2090 public void SetBlockGrab(bool p)
2091 {
2092 if (ParentGroup.IsDeleted)
2093 return;
2094
2095 ParentGroup.RootPart.BlockGrab = p;
2096 }
2097
2098 public void SetStatusSandbox(bool p) 2082 public void SetStatusSandbox(bool p)
2099 { 2083 {
2100 if (ParentGroup.IsDeleted) 2084 if (ParentGroup.IsDeleted)
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 50e4804..5aef892 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -1377,12 +1377,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1377 } 1377 }
1378 1378
1379 if ((status & ScriptBaseClass.STATUS_BLOCK_GRAB) == ScriptBaseClass.STATUS_BLOCK_GRAB) 1379 if ((status & ScriptBaseClass.STATUS_BLOCK_GRAB) == ScriptBaseClass.STATUS_BLOCK_GRAB)
1380 { 1380 m_host.BlockGrab = value != 0;
1381 if (value != 0) 1381
1382 m_host.SetBlockGrab(true); 1382 if ((status & ScriptBaseClass.STATUS_BLOCK_GRAB_OBJECT) == ScriptBaseClass.STATUS_BLOCK_GRAB_OBJECT)
1383 else 1383 m_host.ParentGroup.BlockGrabOverride = value != 0;
1384 m_host.SetBlockGrab(false);
1385 }
1386 1384
1387 if ((status & ScriptBaseClass.STATUS_DIE_AT_EDGE) == ScriptBaseClass.STATUS_DIE_AT_EDGE) 1385 if ((status & ScriptBaseClass.STATUS_DIE_AT_EDGE) == ScriptBaseClass.STATUS_DIE_AT_EDGE)
1388 { 1386 {
@@ -1443,10 +1441,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1443 return 0; 1441 return 0;
1444 1442
1445 case ScriptBaseClass.STATUS_BLOCK_GRAB: 1443 case ScriptBaseClass.STATUS_BLOCK_GRAB:
1446 if (m_host.GetBlockGrab()) 1444 return m_host.BlockGrab ? 1 : 0;
1447 return 1; 1445
1448 else 1446 case ScriptBaseClass.STATUS_BLOCK_GRAB_OBJECT:
1449 return 0; 1447 return m_host.ParentGroup.BlockGrabOverride ? 1 : 0;
1450 1448
1451 case ScriptBaseClass.STATUS_DIE_AT_EDGE: 1449 case ScriptBaseClass.STATUS_DIE_AT_EDGE:
1452 if (m_host.GetDieAtEdge()) 1450 if (m_host.GetDieAtEdge())
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs
index 7d80dcb..a96cd16 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs
@@ -48,6 +48,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
48 public const int STATUS_DIE_AT_EDGE = 128; 48 public const int STATUS_DIE_AT_EDGE = 128;
49 public const int STATUS_RETURN_AT_EDGE = 256; 49 public const int STATUS_RETURN_AT_EDGE = 256;
50 public const int STATUS_CAST_SHADOWS = 512; 50 public const int STATUS_CAST_SHADOWS = 512;
51 public const int STATUS_BLOCK_GRAB_OBJECT = 1024;
51 52
52 public const int AGENT = 1; 53 public const int AGENT = 1;
53 public const int AGENT_BY_LEGACY_NAME = 1; 54 public const int AGENT_BY_LEGACY_NAME = 1;