diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Common/Executor.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Common/Executor.cs | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/OpenSim/Region/ScriptEngine/Common/Executor.cs b/OpenSim/Region/ScriptEngine/Common/Executor.cs index dedf00d..148ae0f 100644 --- a/OpenSim/Region/ScriptEngine/Common/Executor.cs +++ b/OpenSim/Region/ScriptEngine/Common/Executor.cs | |||
@@ -17,12 +17,24 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
17 | 17 | ||
18 | private IScript m_Script; | 18 | private IScript m_Script; |
19 | private Dictionary<string, MethodInfo> Events = new Dictionary<string, MethodInfo>(); | 19 | private Dictionary<string, MethodInfo> Events = new Dictionary<string, MethodInfo>(); |
20 | private bool m_Running = true; | ||
21 | |||
20 | 22 | ||
21 | public Executor(IScript Script) | 23 | public Executor(IScript Script) |
22 | { | 24 | { |
23 | m_Script = Script; | 25 | m_Script = Script; |
24 | 26 | ||
25 | } | 27 | } |
28 | |||
29 | public void StopScript() | ||
30 | { | ||
31 | m_Running = false; | ||
32 | } | ||
33 | public AppDomain GetAppDomain() | ||
34 | { | ||
35 | return AppDomain.CurrentDomain; | ||
36 | } | ||
37 | |||
26 | public void ExecuteEvent(string FunctionName, object[] args) | 38 | public void ExecuteEvent(string FunctionName, object[] args) |
27 | { | 39 | { |
28 | // IMPORTANT: Types and MemberInfo-derived objects require a LOT of memory. | 40 | // IMPORTANT: Types and MemberInfo-derived objects require a LOT of memory. |
@@ -36,7 +48,11 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
36 | //} | 48 | //} |
37 | //} | 49 | //} |
38 | 50 | ||
39 | 51 | if (m_Running == false) | |
52 | { | ||
53 | // Script is inactive, do not execute! | ||
54 | return; | ||
55 | } | ||
40 | 56 | ||
41 | string EventName = m_Script.State() + "_event_" + FunctionName; | 57 | string EventName = m_Script.State() + "_event_" + FunctionName; |
42 | 58 | ||