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/IScriptInstance.cs66
2 files changed, 74 insertions, 7 deletions
diff --git a/OpenSim/Region/ScriptEngine/Interfaces/IScriptApi.cs b/OpenSim/Region/ScriptEngine/Interfaces/IScriptApi.cs
index 2027ca6..d2323f5 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, EventWaitHandle coopSleepHandle);
47 } 50 }
48} \ No newline at end of file 51} \ No newline at end of file
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);