diff options
author | Melanie | 2012-08-15 18:22:52 +0200 |
---|---|---|
committer | Melanie | 2012-08-15 18:22:52 +0200 |
commit | 44dc138d8b7a957f9db39fd1a017c0267dfd0829 (patch) | |
tree | 1b4b893b0ecbc1ef97a9d42dfb9767f3b133f52a /OpenSim/Region/ScriptEngine/Shared | |
parent | Add support for the extra params to scene and the event manager (diff) | |
download | opensim-SC-44dc138d8b7a957f9db39fd1a017c0267dfd0829.zip opensim-SC-44dc138d8b7a957f9db39fd1a017c0267dfd0829.tar.gz opensim-SC-44dc138d8b7a957f9db39fd1a017c0267dfd0829.tar.bz2 opensim-SC-44dc138d8b7a957f9db39fd1a017c0267dfd0829.tar.xz |
Let the temp attachment module add a command to allow attaching without permissions and add support for this (incomplete!) to LSL
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 51 |
1 files changed, 22 insertions, 29 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 54cb214..1115542 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -3753,29 +3753,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3753 | 3753 | ||
3754 | m_host.AddScriptLPS(1); | 3754 | m_host.AddScriptLPS(1); |
3755 | 3755 | ||
3756 | int implicitPerms = 0; | ||
3757 | |||
3756 | if (m_host.ParentGroup.IsAttachment && (UUID)agent == m_host.ParentGroup.AttachedAvatar) | 3758 | if (m_host.ParentGroup.IsAttachment && (UUID)agent == m_host.ParentGroup.AttachedAvatar) |
3757 | { | 3759 | { |
3758 | // When attached, certain permissions are implicit if requested from owner | 3760 | // When attached, certain permissions are implicit if requested from owner |
3759 | int implicitPerms = ScriptBaseClass.PERMISSION_TAKE_CONTROLS | | 3761 | implicitPerms = ScriptBaseClass.PERMISSION_TAKE_CONTROLS | |
3760 | ScriptBaseClass.PERMISSION_TRIGGER_ANIMATION | | 3762 | ScriptBaseClass.PERMISSION_TRIGGER_ANIMATION | |
3761 | ScriptBaseClass.PERMISSION_CONTROL_CAMERA | | 3763 | ScriptBaseClass.PERMISSION_CONTROL_CAMERA | |
3762 | ScriptBaseClass.PERMISSION_TRACK_CAMERA | | 3764 | ScriptBaseClass.PERMISSION_TRACK_CAMERA | |
3763 | ScriptBaseClass.PERMISSION_ATTACH; | 3765 | ScriptBaseClass.PERMISSION_ATTACH; |
3764 | 3766 | ||
3765 | if ((perm & (~implicitPerms)) == 0) // Requested only implicit perms | ||
3766 | { | ||
3767 | m_host.TaskInventory.LockItemsForWrite(true); | ||
3768 | m_host.TaskInventory[m_item.ItemID].PermsGranter = agentID; | ||
3769 | m_host.TaskInventory[m_item.ItemID].PermsMask = perm; | ||
3770 | m_host.TaskInventory.LockItemsForWrite(false); | ||
3771 | |||
3772 | m_ScriptEngine.PostScriptEvent(m_item.ItemID, new EventParams( | ||
3773 | "run_time_permissions", new Object[] { | ||
3774 | new LSL_Integer(perm) }, | ||
3775 | new DetectParams[0])); | ||
3776 | |||
3777 | return; | ||
3778 | } | ||
3779 | } | 3767 | } |
3780 | else | 3768 | else |
3781 | { | 3769 | { |
@@ -3796,26 +3784,31 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3796 | if (sitting) | 3784 | if (sitting) |
3797 | { | 3785 | { |
3798 | // When agent is sitting, certain permissions are implicit if requested from sitting agent | 3786 | // When agent is sitting, certain permissions are implicit if requested from sitting agent |
3799 | int implicitPerms = ScriptBaseClass.PERMISSION_TRIGGER_ANIMATION | | 3787 | implicitPerms = ScriptBaseClass.PERMISSION_TRIGGER_ANIMATION | |
3800 | ScriptBaseClass.PERMISSION_CONTROL_CAMERA | | 3788 | ScriptBaseClass.PERMISSION_CONTROL_CAMERA | |
3801 | ScriptBaseClass.PERMISSION_TRACK_CAMERA | | 3789 | ScriptBaseClass.PERMISSION_TRACK_CAMERA | |
3802 | ScriptBaseClass.PERMISSION_TAKE_CONTROLS; | 3790 | ScriptBaseClass.PERMISSION_TAKE_CONTROLS; |
3791 | } | ||
3792 | else | ||
3793 | { | ||
3794 | if (World.GetExtraSetting("auto_grant_attach_perms") == "true") | ||
3795 | implicitPerms = ScriptBaseClass.PERMISSION_ATTACH; | ||
3796 | } | ||
3797 | } | ||
3803 | 3798 | ||
3804 | if ((perm & (~implicitPerms)) == 0) // Requested only implicit perms | 3799 | if ((perm & (~implicitPerms)) == 0) // Requested only implicit perms |
3805 | { | 3800 | { |
3806 | m_host.TaskInventory.LockItemsForWrite(true); | 3801 | m_host.TaskInventory.LockItemsForWrite(true); |
3807 | m_host.TaskInventory[m_item.ItemID].PermsGranter = agentID; | 3802 | m_host.TaskInventory[m_item.ItemID].PermsGranter = agentID; |
3808 | m_host.TaskInventory[m_item.ItemID].PermsMask = perm; | 3803 | m_host.TaskInventory[m_item.ItemID].PermsMask = perm; |
3809 | m_host.TaskInventory.LockItemsForWrite(false); | 3804 | m_host.TaskInventory.LockItemsForWrite(false); |
3810 | 3805 | ||
3811 | m_ScriptEngine.PostScriptEvent(m_item.ItemID, new EventParams( | 3806 | m_ScriptEngine.PostScriptEvent(m_item.ItemID, new EventParams( |
3812 | "run_time_permissions", new Object[] { | 3807 | "run_time_permissions", new Object[] { |
3813 | new LSL_Integer(perm) }, | 3808 | new LSL_Integer(perm) }, |
3814 | new DetectParams[0])); | 3809 | new DetectParams[0])); |
3815 | 3810 | ||
3816 | return; | 3811 | return; |
3817 | } | ||
3818 | } | ||
3819 | } | 3812 | } |
3820 | 3813 | ||
3821 | ScenePresence presence = World.GetScenePresence(agentID); | 3814 | ScenePresence presence = World.GetScenePresence(agentID); |