aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Interfaces
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Interfaces')
-rw-r--r--OpenSim/Region/ScriptEngine/Interfaces/IScriptApi.cs15
-rw-r--r--OpenSim/Region/ScriptEngine/Interfaces/IScriptEngine.cs43
-rw-r--r--OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs66
3 files changed, 112 insertions, 12 deletions
diff --git a/OpenSim/Region/ScriptEngine/Interfaces/IScriptApi.cs b/OpenSim/Region/ScriptEngine/Interfaces/IScriptApi.cs
index 2027ca6..30e99b0 100644
--- a/OpenSim/Region/ScriptEngine/Interfaces/IScriptApi.cs
+++ b/OpenSim/Region/ScriptEngine/Interfaces/IScriptApi.cs
@@ -26,9 +26,11 @@
26 */ 26 */
27 27
28using System; 28using System;
29using System.Threading;
29using OpenMetaverse; 30using OpenMetaverse;
30using OpenSim.Framework; 31using OpenSim.Framework;
31using OpenSim.Region.Framework.Scenes; 32using OpenSim.Region.Framework.Scenes;
33using OpenSim.Region.ScriptEngine.Shared;
32 34
33namespace OpenSim.Region.ScriptEngine.Interfaces 35namespace OpenSim.Region.ScriptEngine.Interfaces
34{ 36{
@@ -38,11 +40,12 @@ namespace OpenSim.Region.ScriptEngine.Interfaces
38 /// Initialize the API 40 /// Initialize the API
39 /// </summary> 41 /// </summary>
40 /// <remarks> 42 /// <remarks>
41 /// Each API has an identifier, which is used to load the 43 /// Each API has an identifier, which is used to load the proper runtime assembly at load time.
42 /// proper runtime assembly at load time. 44 /// <param name='scriptEngine'>/param>
43 /// <param name='engine'>/param> 45 /// <param name='host'>/param>
44 /// <param name='part'></param> 46 /// <param name='item'>/param>
45 /// <param name='item'></param> 47 /// <param name='coopSleepHandle'>/param>
46 void Initialize(IScriptEngine engine, SceneObjectPart part, TaskInventoryItem item); 48 void Initialize(
49 IScriptEngine scriptEngine, SceneObjectPart host, TaskInventoryItem item, WaitHandle coopSleepHandle);
47 } 50 }
48} \ No newline at end of file 51} \ No newline at end of file
diff --git a/OpenSim/Region/ScriptEngine/Interfaces/IScriptEngine.cs b/OpenSim/Region/ScriptEngine/Interfaces/IScriptEngine.cs
index 17c2708..b8fdd01 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
28using log4net;
29using System; 28using System;
30using OpenSim.Region.ScriptEngine.Shared; 29using System.Reflection;
30using OpenSim.Framework;
31using OpenSim.Region.Framework.Scenes; 31using OpenSim.Region.Framework.Scenes;
32using OpenSim.Region.Framework.Interfaces; 32using OpenSim.Region.Framework.Interfaces;
33using OpenMetaverse;
34using Nini.Config;
35using OpenSim.Region.ScriptEngine.Interfaces; 33using OpenSim.Region.ScriptEngine.Interfaces;
34using OpenSim.Region.ScriptEngine.Shared;
36using Amib.Threading; 35using Amib.Threading;
37using OpenSim.Framework; 36using log4net;
37using Nini.Config;
38using OpenMetaverse;
38 39
39namespace OpenSim.Region.ScriptEngine.Interfaces 40namespace OpenSim.Region.ScriptEngine.Interfaces
40{ 41{
@@ -76,6 +77,38 @@ 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 class that will be used for all running scripts.
83 /// </summary>
84 /// <remarks>
85 /// Each class goes in its own assembly so we don't need to otherwise distinguish the class name.
86 /// </remarks>
87 string ScriptClassName { get; }
88
89 /// <summary>
90 /// Return the name of the base class that will be used for all running scripts.
91 /// </summary>
92 string ScriptBaseClassName { get; }
93
94 /// <summary>
95 /// Assemblies that need to be referenced when compiling scripts.
96 /// </summary>
97 /// <remarks>
98 /// These are currently additional to those always referenced by the compiler, BUT THIS MAY CHANGE IN THE
99 /// FUTURE.
100 /// This can be null if there are no additional assemblies.
101 /// </remarks>
102 string[] ScriptReferencedAssemblies { get; }
103
104 /// <summary>
105 /// Parameters for the generated script's constructor.
106 /// </summary>
107 /// <remarks>
108 /// Can be null if there are no parameters
109 /// </remarks>
110 ParameterInfo[] ScriptBaseClassParameters { get; }
111
79 IScriptApi GetApi(UUID itemID, string name); 112 IScriptApi GetApi(UUID itemID, string name);
80 } 113 }
81} 114}
diff --git a/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs b/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs
index b04f6b6..f68612c 100644
--- a/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs
+++ b/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs
@@ -28,9 +28,11 @@
28using System; 28using System;
29using System.Collections; 29using System.Collections;
30using System.Collections.Generic; 30using System.Collections.Generic;
31using System.Threading;
31using OpenMetaverse; 32using OpenMetaverse;
32using log4net; 33using log4net;
33using OpenSim.Framework; 34using OpenSim.Framework;
35using OpenSim.Region.Framework.Scenes;
34using OpenSim.Region.ScriptEngine.Shared; 36using OpenSim.Region.ScriptEngine.Shared;
35using OpenSim.Region.ScriptEngine.Interfaces; 37using OpenSim.Region.ScriptEngine.Interfaces;
36 38
@@ -59,6 +61,18 @@ namespace OpenSim.Region.ScriptEngine.Interfaces
59 public interface IScriptInstance 61 public interface IScriptInstance
60 { 62 {
61 /// <summary> 63 /// <summary>
64 /// Debug level for this script instance.
65 /// </summary>
66 /// <remarks>
67 /// Level == 0, no extra data is logged.
68 /// Level >= 1, state changes are logged.
69 /// Level >= 2, event firing is logged.
70 /// <value>
71 /// The debug level.
72 /// </value>
73 int DebugLevel { get; set; }
74
75 /// <summary>
62 /// Is the script currently running? 76 /// Is the script currently running?
63 /// </summary> 77 /// </summary>
64 bool Running { get; set; } 78 bool Running { get; set; }
@@ -93,6 +107,11 @@ namespace OpenSim.Region.ScriptEngine.Interfaces
93 /// </summary> 107 /// </summary>
94 long MeasurementPeriodExecutionTime { get; } 108 long MeasurementPeriodExecutionTime { get; }
95 109
110 /// <summary>
111 /// Scene part in which this script instance is contained.
112 /// </summary>
113 SceneObjectPart Part { get; }
114
96 IScriptEngine Engine { get; } 115 IScriptEngine Engine { get; }
97 UUID AppDomain { get; set; } 116 UUID AppDomain { get; set; }
98 string PrimName { get; } 117 string PrimName { get; }
@@ -112,8 +131,24 @@ namespace OpenSim.Region.ScriptEngine.Interfaces
112 131
113 uint LocalID { get; } 132 uint LocalID { get; }
114 UUID AssetID { get; } 133 UUID AssetID { get; }
134
135 /// <summary>
136 /// Inventory item containing the script used.
137 /// </summary>
138 TaskInventoryItem ScriptTask { get; }
139
115 Queue EventQueue { get; } 140 Queue EventQueue { get; }
116 141
142 /// <summary>
143 /// Number of events queued for processing.
144 /// </summary>
145 long EventsQueued { get; }
146
147 /// <summary>
148 /// Number of events processed by this script instance.
149 /// </summary>
150 long EventsProcessed { get; }
151
117 void ClearQueue(); 152 void ClearQueue();
118 int StartParam { get; set; } 153 int StartParam { get; set; }
119 154
@@ -125,7 +160,13 @@ namespace OpenSim.Region.ScriptEngine.Interfaces
125 /// <summary> 160 /// <summary>
126 /// Stop the script instance. 161 /// Stop the script instance.
127 /// </summary> 162 /// </summary>
163 /// <remarks>
164 /// This must not be called by a thread that is in the process of handling an event for this script. Otherwise
165 /// there is a danger that it will self-abort and not complete the reset.
166 /// </remarks>
128 /// <param name="timeout"></param> 167 /// <param name="timeout"></param>
168 /// How many milliseconds we will wait for an existing script event to finish before
169 /// forcibly aborting that event.
129 /// <returns>true if the script was successfully stopped, false otherwise</returns> 170 /// <returns>true if the script was successfully stopped, false otherwise</returns>
130 bool Stop(int timeout); 171 bool Stop(int timeout);
131 172
@@ -147,8 +188,31 @@ namespace OpenSim.Region.ScriptEngine.Interfaces
147 object EventProcessor(); 188 object EventProcessor();
148 189
149 int EventTime(); 190 int EventTime();
150 void ResetScript(); 191
192 /// <summary>
193 /// Reset the script.
194 /// </summary>
195 /// <remarks>
196 /// This must not be called by a thread that is in the process of handling an event for this script. Otherwise
197 /// there is a danger that it will self-abort and not complete the reset. Such a thread must call
198 /// ApiResetScript() instead.
199 /// </remarks>
200 /// <param name='timeout'>
201 /// How many milliseconds we will wait for an existing script event to finish before
202 /// forcibly aborting that event prior to script reset.
203 /// </param>
204 void ResetScript(int timeout);
205
206 /// <summary>
207 /// Reset the script.
208 /// </summary>
209 /// <remarks>
210 /// This must not be called by any thread other than the one executing the scripts current event. This is
211 /// because there is no wait or abort logic if another thread is in the middle of processing a script event.
212 /// Such an external thread should use ResetScript() instead.
213 /// </remarks>
151 void ApiResetScript(); 214 void ApiResetScript();
215
152 Dictionary<string, object> GetVars(); 216 Dictionary<string, object> GetVars();
153 void SetVars(Dictionary<string, object> vars); 217 void SetVars(Dictionary<string, object> vars);
154 DetectParams GetDetectParams(int idx); 218 DetectParams GetDetectParams(int idx);