From 9bcaf98e37e9aba10f84e71e85cf8f79bb5f580a Mon Sep 17 00:00:00 2001 From: Dr Scofield Date: Tue, 13 Jan 2009 08:15:43 +0000 Subject: From: Christopher Yeoh The attached patch adds the automatic granting of PERMISSION_CONTROL_CAMERA on request to a script when an avatar is sitting on the object that the script resides in. It also automatically removes PERMISSION_TAKE_CONTROLS and PERMISSION_CONTROL_CAMERA from the scripts when an avatar stands up. It doesn't remove the other automatically granted permissions but this follows LL server behavior. Removing these two permissions avoids some potential race conditions (accidentally taking control after the avatar has stood up) which may be why LL put them in the first place. --- OpenSim/Region/Environment/Scenes/ScenePresence.cs | 3 +++ OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index 78e3a83..1a3971d 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs @@ -1434,6 +1434,9 @@ namespace OpenSim.Region.Environment.Scenes foreach (UUID taskID in taskIDict.Keys) { UnRegisterControlEventsToScript(LocalId, taskID); + taskIDict[taskID].PermsMask &= ~( + 2048 | //PERMISSION_CONTROL_CAMERA + 4); // PERMISSION_TAKE_CONTROLS } } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 34a3a26..393e708 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -2958,7 +2958,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // When agent is sitting, certain permissions are implicit if requested from sitting agent int implicitPerms = ScriptBaseClass.PERMISSION_TRIGGER_ANIMATION | ScriptBaseClass.PERMISSION_CONTROL_CAMERA | - ScriptBaseClass.PERMISSION_TRACK_CAMERA; + ScriptBaseClass.PERMISSION_TRACK_CAMERA | + ScriptBaseClass.PERMISSION_TAKE_CONTROLS; if ((perm & (~implicitPerms)) == 0) // Requested only implicit perms { -- cgit v1.1