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/YEngine/XMRInstRun.cs | |
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 '')
-rw-r--r-- | OpenSim/Region/ScriptEngine/YEngine/XMRInstRun.cs | 35 |
1 files changed, 29 insertions, 6 deletions
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) |