diff options
author | Justin Clark-Casey (justincc) | 2013-01-17 23:39:09 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2013-01-17 23:39:09 +0000 |
commit | c8afc8523b9caf931afb3d5b3f9874b26b866a77 (patch) | |
tree | b1a84d82591f462ae61b3aeed4f4b6dd3c5c06e8 /OpenSim/Region/ScriptEngine/Interfaces/IScriptEngine.cs | |
parent | Merge branch 'master' of melanie@opensimulator.org:/var/git/opensim (diff) | |
download | opensim-SC_OLD-c8afc8523b9caf931afb3d5b3f9874b26b866a77.zip opensim-SC_OLD-c8afc8523b9caf931afb3d5b3f9874b26b866a77.tar.gz opensim-SC_OLD-c8afc8523b9caf931afb3d5b3f9874b26b866a77.tar.bz2 opensim-SC_OLD-c8afc8523b9caf931afb3d5b3f9874b26b866a77.tar.xz |
Implement non-wait co-operative termination of scripts for XEngine in addition to termination on wait.
This involves inserting opensim_reserved_CheckForCoopTermination() calls in lsl -> c# translation at any place where the script could be in a loop with no wait calls.
These places are for, while, do-while, label, user function call and manual event function call.
Call goes through to an XEngineScriptBase which extends ScriptBase.
IEngine is extended to supply necessary engine-specific parent class references and constructor parameters to Compiler.
Unfortunately, since XEngineScriptBase has to be passed WaitHandle in its constructor, older compiled scripts will fail to load with an error on the OpenSim console.
Such scripts will need to be recompiled, either by removing all *.dll files from the bin/ScriptEngines/<region-id> or by setting DeleteScriptsOnStartup = true in [XEngine] for one run.
Automatic recompilation may be implemented in a later commit.
This feature should not yet be used, default remains termination with Thread.Abort() which will work as normal once scripts are recompiled.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Interfaces/IScriptEngine.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Interfaces/IScriptEngine.cs | 35 |
1 files changed, 30 insertions, 5 deletions
diff --git a/OpenSim/Region/ScriptEngine/Interfaces/IScriptEngine.cs b/OpenSim/Region/ScriptEngine/Interfaces/IScriptEngine.cs index 17c2708..20dcac9 100644 --- a/OpenSim/Region/ScriptEngine/Interfaces/IScriptEngine.cs +++ b/OpenSim/Region/ScriptEngine/Interfaces/IScriptEngine.cs | |||
@@ -25,16 +25,17 @@ | |||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ | 26 | */ |
27 | 27 | ||
28 | using log4net; | ||
29 | using System; | 28 | using System; |
30 | using OpenSim.Region.ScriptEngine.Shared; | 29 | using System.Reflection; |
30 | using OpenSim.Framework; | ||
31 | using OpenSim.Region.Framework.Scenes; | 31 | using OpenSim.Region.Framework.Scenes; |
32 | using OpenSim.Region.Framework.Interfaces; | 32 | using OpenSim.Region.Framework.Interfaces; |
33 | using OpenMetaverse; | ||
34 | using Nini.Config; | ||
35 | using OpenSim.Region.ScriptEngine.Interfaces; | 33 | using OpenSim.Region.ScriptEngine.Interfaces; |
34 | using OpenSim.Region.ScriptEngine.Shared; | ||
36 | using Amib.Threading; | 35 | using Amib.Threading; |
37 | using OpenSim.Framework; | 36 | using log4net; |
37 | using Nini.Config; | ||
38 | using OpenMetaverse; | ||
38 | 39 | ||
39 | namespace OpenSim.Region.ScriptEngine.Interfaces | 40 | namespace OpenSim.Region.ScriptEngine.Interfaces |
40 | { | 41 | { |
@@ -76,6 +77,30 @@ namespace OpenSim.Region.ScriptEngine.Interfaces | |||
76 | IConfigSource ConfigSource { get; } | 77 | IConfigSource ConfigSource { get; } |
77 | string ScriptEngineName { get; } | 78 | string ScriptEngineName { get; } |
78 | string ScriptEnginePath { get; } | 79 | string ScriptEnginePath { get; } |
80 | |||
81 | /// <summary> | ||
82 | /// Return the name of the base class that will be used for all running scripts. | ||
83 | /// </summary> | ||
84 | string ScriptBaseClassName { get; } | ||
85 | |||
86 | /// <summary> | ||
87 | /// Assemblies that need to be referenced when compiling scripts. | ||
88 | /// </summary> | ||
89 | /// <remarks> | ||
90 | /// These are currently additional to those always referenced by the compiler, BUT THIS MAY CHANGE IN THE | ||
91 | /// FUTURE. | ||
92 | /// This can be null if there are no additional assemblies. | ||
93 | /// </remarks> | ||
94 | string[] ScriptReferencedAssemblies { get; } | ||
95 | |||
96 | /// <summary> | ||
97 | /// Parameters for the generated script's constructor. | ||
98 | /// </summary> | ||
99 | /// <remarks> | ||
100 | /// Can be null if there are no parameters | ||
101 | /// </remarks> | ||
102 | ParameterInfo[] ScriptBaseClassParameters { get; } | ||
103 | |||
79 | IScriptApi GetApi(UUID itemID, string name); | 104 | IScriptApi GetApi(UUID itemID, string name); |
80 | } | 105 | } |
81 | } | 106 | } |