diff options
author | UbitUmarov | 2017-01-21 10:22:00 +0000 |
---|---|---|
committer | UbitUmarov | 2017-01-21 10:22:00 +0000 |
commit | 186f0b73cd9c3005fc75a9925bc65902d26d497b (patch) | |
tree | 6fa51e4ffa9be113268abba4ecff596c8fe04dbc /OpenSim/Region/Framework/Scenes/Scene.Permissions.cs | |
parent | fix llScriptDanger(); don't call old ScriptDamage on ossl health functions (diff) | |
download | opensim-SC-186f0b73cd9c3005fc75a9925bc65902d26d497b.zip opensim-SC-186f0b73cd9c3005fc75a9925bc65902d26d497b.tar.gz opensim-SC-186f0b73cd9c3005fc75a9925bc65902d26d497b.tar.bz2 opensim-SC-186f0b73cd9c3005fc75a9925bc65902d26d497b.tar.xz |
add/fix CanRunScript
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.Permissions.cs | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs index 6925b6c..e941210 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs | |||
@@ -60,7 +60,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
60 | public delegate bool ViewNotecardHandler(UUID script, UUID objectID, UUID user, Scene scene); | 60 | public delegate bool ViewNotecardHandler(UUID script, UUID objectID, UUID user, Scene scene); |
61 | public delegate bool EditScriptHandler(UUID script, UUID objectID, UUID user, Scene scene); | 61 | public delegate bool EditScriptHandler(UUID script, UUID objectID, UUID user, Scene scene); |
62 | public delegate bool EditNotecardHandler(UUID notecard, UUID objectID, UUID user, Scene scene); | 62 | public delegate bool EditNotecardHandler(UUID notecard, UUID objectID, UUID user, Scene scene); |
63 | public delegate bool RunScriptHandler(UUID script, UUID objectID, UUID user, Scene scene); | 63 | public delegate bool RunScriptHandlerByIDs(UUID script, UUID objectID, UUID user, Scene scene); |
64 | public delegate bool RunScriptHandler(TaskInventoryItem item, SceneObjectPart part); | ||
64 | public delegate bool CompileScriptHandler(UUID ownerUUID, int scriptType, Scene scene); | 65 | public delegate bool CompileScriptHandler(UUID ownerUUID, int scriptType, Scene scene); |
65 | public delegate bool StartScriptHandler(UUID script, UUID user, Scene scene); | 66 | public delegate bool StartScriptHandler(UUID script, UUID user, Scene scene); |
66 | public delegate bool StopScriptHandler(UUID script, UUID user, Scene scene); | 67 | public delegate bool StopScriptHandler(UUID script, UUID user, Scene scene); |
@@ -131,6 +132,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
131 | public event ViewNotecardHandler OnViewNotecard; | 132 | public event ViewNotecardHandler OnViewNotecard; |
132 | public event EditScriptHandler OnEditScript; | 133 | public event EditScriptHandler OnEditScript; |
133 | public event EditNotecardHandler OnEditNotecard; | 134 | public event EditNotecardHandler OnEditNotecard; |
135 | public event RunScriptHandlerByIDs OnRunScriptByIDs; | ||
134 | public event RunScriptHandler OnRunScript; | 136 | public event RunScriptHandler OnRunScript; |
135 | public event CompileScriptHandler OnCompileScript; | 137 | public event CompileScriptHandler OnCompileScript; |
136 | public event StartScriptHandler OnStartScript; | 138 | public event StartScriptHandler OnStartScript; |
@@ -654,19 +656,37 @@ namespace OpenSim.Region.Framework.Scenes | |||
654 | #region RUN SCRIPT (When Script Placed in Object) | 656 | #region RUN SCRIPT (When Script Placed in Object) |
655 | public bool CanRunScript(UUID script, UUID objectID, UUID user) | 657 | public bool CanRunScript(UUID script, UUID objectID, UUID user) |
656 | { | 658 | { |
659 | RunScriptHandlerByIDs handler = OnRunScriptByIDs; | ||
660 | if (handler != null) | ||
661 | { | ||
662 | Delegate[] list = handler.GetInvocationList(); | ||
663 | foreach (RunScriptHandlerByIDs h in list) | ||
664 | { | ||
665 | if (h(script, objectID, user, m_scene) == false) | ||
666 | return false; | ||
667 | } | ||
668 | } | ||
669 | return true; | ||
670 | } | ||
671 | |||
672 | public bool CanRunScript(TaskInventoryItem item, SceneObjectPart part) | ||
673 | { | ||
657 | RunScriptHandler handler = OnRunScript; | 674 | RunScriptHandler handler = OnRunScript; |
658 | if (handler != null) | 675 | if (handler != null) |
659 | { | 676 | { |
677 | if(item == null || part == null) | ||
678 | return false; | ||
660 | Delegate[] list = handler.GetInvocationList(); | 679 | Delegate[] list = handler.GetInvocationList(); |
661 | foreach (RunScriptHandler h in list) | 680 | foreach (RunScriptHandler h in list) |
662 | { | 681 | { |
663 | if (h(script, objectID, user, m_scene) == false) | 682 | if (h(item, part) == false) |
664 | return false; | 683 | return false; |
665 | } | 684 | } |
666 | } | 685 | } |
667 | return true; | 686 | return true; |
668 | } | 687 | } |
669 | 688 | ||
689 | |||
670 | #endregion | 690 | #endregion |
671 | 691 | ||
672 | #region COMPILE SCRIPT (When Script needs to get (re)compiled) | 692 | #region COMPILE SCRIPT (When Script needs to get (re)compiled) |