aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/YEngine/XMRInstRun.cs
diff options
context:
space:
mode:
authorUbitUmarov2019-11-11 12:51:09 +0000
committerUbitUmarov2019-11-11 12:51:09 +0000
commite87dfd48bf501a16ffd418138a5fff10e7de7c53 (patch)
tree4106605e12e924b80da1787c7a37fde3c62a64dd /OpenSim/Region/ScriptEngine/YEngine/XMRInstRun.cs
parentterraforming changes: try recover llmodifyland previus behaviur (diff)
downloadopensim-SC-e87dfd48bf501a16ffd418138a5fff10e7de7c53.zip
opensim-SC-e87dfd48bf501a16ffd418138a5fff10e7de7c53.tar.gz
opensim-SC-e87dfd48bf501a16ffd418138a5fff10e7de7c53.tar.bz2
opensim-SC-e87dfd48bf501a16ffd418138a5fff10e7de7c53.tar.xz
Yengine: we also need to cancel timer events in queue, because some bad scripts that do work on X
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/ScriptEngine/YEngine/XMRInstRun.cs31
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.