diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs | 66 |
1 files changed, 65 insertions, 1 deletions
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 @@ | |||
28 | using System; | 28 | using System; |
29 | using System.Collections; | 29 | using System.Collections; |
30 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
31 | using System.Threading; | ||
31 | using OpenMetaverse; | 32 | using OpenMetaverse; |
32 | using log4net; | 33 | using log4net; |
33 | using OpenSim.Framework; | 34 | using OpenSim.Framework; |
35 | using OpenSim.Region.Framework.Scenes; | ||
34 | using OpenSim.Region.ScriptEngine.Shared; | 36 | using OpenSim.Region.ScriptEngine.Shared; |
35 | using OpenSim.Region.ScriptEngine.Interfaces; | 37 | using 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); |