diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/YEngine/XMRInstRun.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/YEngine/XMRInstRun.cs | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/OpenSim/Region/ScriptEngine/YEngine/XMRInstRun.cs b/OpenSim/Region/ScriptEngine/YEngine/XMRInstRun.cs index 30e397b..57b9e2d 100644 --- a/OpenSim/Region/ScriptEngine/YEngine/XMRInstRun.cs +++ b/OpenSim/Region/ScriptEngine/YEngine/XMRInstRun.cs | |||
@@ -237,6 +237,37 @@ namespace OpenSim.Region.ScriptEngine.Yengine | |||
237 | } | 237 | } |
238 | } | 238 | } |
239 | 239 | ||
240 | public void CancelEvent(string eventName) | ||
241 | { | ||
242 | ScriptEventCode evc; | ||
243 | try | ||
244 | { | ||
245 | evc = (ScriptEventCode)Enum.Parse(typeof(ScriptEventCode), eventName); | ||
246 | } | ||
247 | catch | ||
248 | { | ||
249 | return; | ||
250 | } | ||
251 | |||
252 | lock (m_QueueLock) | ||
253 | { | ||
254 | if(m_EventQueue.Count == 0) | ||
255 | return; | ||
256 | |||
257 | LinkedListNode<EventParams> lln2 = null; | ||
258 | for (lln2 = m_EventQueue.First; lln2 != null; lln2 = lln2.Next) | ||
259 | { | ||
260 | EventParams evt2 = lln2.Value; | ||
261 | if(evt2.EventName.Equals(eventName)) | ||
262 | { | ||
263 | m_EventQueue.Remove(lln2); | ||
264 | if (evc >= 0 && m_EventCounts[(int)evc] > 0) | ||
265 | m_EventCounts[(int)evc]--; | ||
266 | } | ||
267 | } | ||
268 | } | ||
269 | } | ||
270 | |||
240 | // This is called in the script thread to step script until it calls | 271 | // This is called in the script thread to step script until it calls |
241 | // CheckRun(). It returns what the instance's next state should be, | 272 | // CheckRun(). It returns what the instance's next state should be, |
242 | // ONSLEEPQ, ONYIELDQ, SUSPENDED or FINISHED. | 273 | // ONSLEEPQ, ONYIELDQ, SUSPENDED or FINISHED. |