diff options
author | UbitUmarov | 2019-02-20 20:12:13 +0000 |
---|---|---|
committer | UbitUmarov | 2019-02-20 20:12:13 +0000 |
commit | 72c472f98858a6609d12ad36791fe497cd9f21d5 (patch) | |
tree | 8f665b1703f5c21a9d96654dad4c0b5958d013af /OpenSim/Region/ScriptEngine | |
parent | Xengine: exclude a few more events from mineventdelay (diff) | |
download | opensim-SC-72c472f98858a6609d12ad36791fe497cd9f21d5.zip opensim-SC-72c472f98858a6609d12ad36791fe497cd9f21d5.tar.gz opensim-SC-72c472f98858a6609d12ad36791fe497cd9f21d5.tar.bz2 opensim-SC-72c472f98858a6609d12ad36791fe497cd9f21d5.tar.xz |
Yengine: let llminEventDelay do something: it just ignores a more limited set of events than Xengine (neither do as SL)
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
6 files changed, 62 insertions, 17 deletions
diff --git a/OpenSim/Region/ScriptEngine/YEngine/MMRScriptEventCode.cs b/OpenSim/Region/ScriptEngine/YEngine/MMRScriptEventCode.cs index c00e8d4..3539fa1 100644 --- a/OpenSim/Region/ScriptEngine/YEngine/MMRScriptEventCode.cs +++ b/OpenSim/Region/ScriptEngine/YEngine/MMRScriptEventCode.cs | |||
@@ -88,10 +88,7 @@ namespace OpenSim.Region.ScriptEngine.Yengine | |||
88 | 88 | ||
89 | path_update = 40, | 89 | path_update = 40, |
90 | 90 | ||
91 | // XMRE specific | ||
92 | region_cross = 63, | ||
93 | |||
94 | // marks highest numbered event, ie, number of columns in seht. | 91 | // marks highest numbered event, ie, number of columns in seht. |
95 | Size = 64 | 92 | Size = 41 |
96 | } | 93 | } |
97 | } | 94 | } |
diff --git a/OpenSim/Region/ScriptEngine/YEngine/XMREngine.cs b/OpenSim/Region/ScriptEngine/YEngine/XMREngine.cs index 017b294..6acc293 100644 --- a/OpenSim/Region/ScriptEngine/YEngine/XMREngine.cs +++ b/OpenSim/Region/ScriptEngine/YEngine/XMREngine.cs | |||
@@ -930,12 +930,15 @@ namespace OpenSim.Region.ScriptEngine.Yengine | |||
930 | 930 | ||
931 | public void SetMinEventDelay(UUID itemID, double delay) | 931 | public void SetMinEventDelay(UUID itemID, double delay) |
932 | { | 932 | { |
933 | XMRInstance instance = GetInstance(itemID); | ||
934 | if (instance != null) | ||
935 | instance.MinEventDelay = delay; | ||
933 | } | 936 | } |
934 | 937 | ||
935 | public int GetStartParameter(UUID itemID) | 938 | public int GetStartParameter(UUID itemID) |
936 | { | 939 | { |
937 | XMRInstance instance = GetInstance(itemID); | 940 | XMRInstance instance = GetInstance(itemID); |
938 | if(instance == null) | 941 | if (instance == null) |
939 | return 0; | 942 | return 0; |
940 | return instance.StartParam; | 943 | return instance.StartParam; |
941 | } | 944 | } |
diff --git a/OpenSim/Region/ScriptEngine/YEngine/XMRInstBackend.cs b/OpenSim/Region/ScriptEngine/YEngine/XMRInstBackend.cs index 6fe11d8..7fc97e9 100644 --- a/OpenSim/Region/ScriptEngine/YEngine/XMRInstBackend.cs +++ b/OpenSim/Region/ScriptEngine/YEngine/XMRInstBackend.cs | |||
@@ -422,9 +422,9 @@ namespace OpenSim.Region.ScriptEngine.Yengine | |||
422 | object[] saveEHArgs = this.ehArgs; | 422 | object[] saveEHArgs = this.ehArgs; |
423 | ScriptEventCode saveEventCode = this.eventCode; | 423 | ScriptEventCode saveEventCode = this.eventCode; |
424 | 424 | ||
425 | this.m_DetectParams = evt.DetectParams; | 425 | m_DetectParams = evt.DetectParams; |
426 | this.ehArgs = evt.Params; | 426 | ehArgs = evt.Params; |
427 | this.eventCode = evc; | 427 | eventCode = evc; |
428 | 428 | ||
429 | try | 429 | try |
430 | { | 430 | { |
@@ -432,9 +432,9 @@ namespace OpenSim.Region.ScriptEngine.Yengine | |||
432 | } | 432 | } |
433 | finally | 433 | finally |
434 | { | 434 | { |
435 | this.m_DetectParams = saveDetParams; | 435 | m_DetectParams = saveDetParams; |
436 | this.ehArgs = saveEHArgs; | 436 | ehArgs = saveEHArgs; |
437 | this.eventCode = saveEventCode; | 437 | eventCode = saveEventCode; |
438 | } | 438 | } |
439 | 439 | ||
440 | // Keep waiting until we find a returnable event or timeout. | 440 | // Keep waiting until we find a returnable event or timeout. |
diff --git a/OpenSim/Region/ScriptEngine/YEngine/XMRInstMain.cs b/OpenSim/Region/ScriptEngine/YEngine/XMRInstMain.cs index 3c0040c..def06b2 100644 --- a/OpenSim/Region/ScriptEngine/YEngine/XMRInstMain.cs +++ b/OpenSim/Region/ScriptEngine/YEngine/XMRInstMain.cs | |||
@@ -215,5 +215,9 @@ namespace OpenSim.Region.ScriptEngine.Yengine | |||
215 | // It's born ready, but will be reset when the detach is posted. | 215 | // It's born ready, but will be reset when the detach is posted. |
216 | // It will then be set again on suspend/completion | 216 | // It will then be set again on suspend/completion |
217 | private ManualResetEvent m_DetachReady = new ManualResetEvent(true); | 217 | private ManualResetEvent m_DetachReady = new ManualResetEvent(true); |
218 | |||
219 | // llmineventdelay support | ||
220 | double m_minEventDelay = 0.0; | ||
221 | double m_nextEventTime = 0.0; | ||
218 | } | 222 | } |
219 | } | 223 | } |
diff --git a/OpenSim/Region/ScriptEngine/YEngine/XMRInstMisc.cs b/OpenSim/Region/ScriptEngine/YEngine/XMRInstMisc.cs index 0af3d37..12feb7b 100644 --- a/OpenSim/Region/ScriptEngine/YEngine/XMRInstMisc.cs +++ b/OpenSim/Region/ScriptEngine/YEngine/XMRInstMisc.cs | |||
@@ -298,6 +298,24 @@ namespace OpenSim.Region.ScriptEngine.Yengine | |||
298 | } | 298 | } |
299 | } | 299 | } |
300 | 300 | ||
301 | public double MinEventDelay | ||
302 | { | ||
303 | get | ||
304 | { | ||
305 | return m_minEventDelay; | ||
306 | } | ||
307 | set | ||
308 | { | ||
309 | if (value > 0.001) | ||
310 | m_minEventDelay = value; | ||
311 | else | ||
312 | m_minEventDelay = 0.0; | ||
313 | |||
314 | m_nextEventTime = 0.0; // reset it | ||
315 | } | ||
316 | } | ||
317 | |||
318 | |||
301 | public SceneObjectPart SceneObject | 319 | public SceneObjectPart SceneObject |
302 | { | 320 | { |
303 | get | 321 | get |
diff --git a/OpenSim/Region/ScriptEngine/YEngine/XMRInstRun.cs b/OpenSim/Region/ScriptEngine/YEngine/XMRInstRun.cs index 6c969dc..9d73a7f 100644 --- a/OpenSim/Region/ScriptEngine/YEngine/XMRInstRun.cs +++ b/OpenSim/Region/ScriptEngine/YEngine/XMRInstRun.cs | |||
@@ -63,8 +63,7 @@ namespace OpenSim.Region.ScriptEngine.Yengine | |||
63 | */ | 63 | */ |
64 | public void PostEvent(EventParams evt) | 64 | public void PostEvent(EventParams evt) |
65 | { | 65 | { |
66 | ScriptEventCode evc = (ScriptEventCode)Enum.Parse(typeof(ScriptEventCode), | 66 | ScriptEventCode evc = (ScriptEventCode)Enum.Parse(typeof(ScriptEventCode), evt.EventName); |
67 | evt.EventName); | ||
68 | 67 | ||
69 | // Put event on end of event queue. | 68 | // Put event on end of event queue. |
70 | bool startIt = false; | 69 | bool startIt = false; |
@@ -86,6 +85,32 @@ namespace OpenSim.Region.ScriptEngine.Yengine | |||
86 | if(!m_Running && !construct) | 85 | if(!m_Running && !construct) |
87 | return; | 86 | return; |
88 | 87 | ||
88 | if(m_minEventDelay != 0) | ||
89 | { | ||
90 | switch (evc) | ||
91 | { | ||
92 | // ignore some events by time set by llMinEventDelay | ||
93 | case ScriptEventCode.collision: | ||
94 | case ScriptEventCode.land_collision: | ||
95 | case ScriptEventCode.listen: | ||
96 | case ScriptEventCode.not_at_target: | ||
97 | case ScriptEventCode.not_at_rot_target: | ||
98 | case ScriptEventCode.no_sensor: | ||
99 | case ScriptEventCode.sensor: | ||
100 | case ScriptEventCode.timer: | ||
101 | case ScriptEventCode.touch: | ||
102 | { | ||
103 | double now = Util.GetTimeStamp(); | ||
104 | if (now < m_nextEventTime) | ||
105 | return; | ||
106 | m_nextEventTime = now + m_minEventDelay; | ||
107 | break; | ||
108 | } | ||
109 | default: | ||
110 | break; | ||
111 | } | ||
112 | } | ||
113 | |||
89 | // Only so many of each event type allowed to queue. | 114 | // Only so many of each event type allowed to queue. |
90 | if((uint)evc < (uint)m_EventCounts.Length) | 115 | if((uint)evc < (uint)m_EventCounts.Length) |
91 | { | 116 | { |
@@ -124,10 +149,8 @@ namespace OpenSim.Region.ScriptEngine.Yengine | |||
124 | for(lln2 = m_EventQueue.First; lln2 != null; lln2 = lln2.Next) | 149 | for(lln2 = m_EventQueue.First; lln2 != null; lln2 = lln2.Next) |
125 | { | 150 | { |
126 | EventParams evt2 = lln2.Value; | 151 | EventParams evt2 = lln2.Value; |
127 | ScriptEventCode evc2 = (ScriptEventCode)Enum.Parse(typeof(ScriptEventCode), | 152 | ScriptEventCode evc2 = (ScriptEventCode)Enum.Parse(typeof(ScriptEventCode), evt2.EventName); |
128 | evt2.EventName); | 153 | if((evc2 != ScriptEventCode.state_entry) && (evc2 != ScriptEventCode.attach)) |
129 | if((evc2 != ScriptEventCode.state_entry) && | ||
130 | (evc2 != ScriptEventCode.attach)) | ||
131 | break; | 154 | break; |
132 | } | 155 | } |
133 | if(lln2 == null) | 156 | if(lln2 == null) |