Yengine: let llminEventDelay do something: it just ignores a more limited set of events than Xengine (neither do as SL)

This commit is contained in:
UbitUmarov
2019-02-20 20:12:13 +00:00
parent ac651a168a
commit 72c472f988
6 changed files with 62 additions and 17 deletions

View File

@@ -63,8 +63,7 @@ namespace OpenSim.Region.ScriptEngine.Yengine
*/
public void PostEvent(EventParams evt)
{
ScriptEventCode evc = (ScriptEventCode)Enum.Parse(typeof(ScriptEventCode),
evt.EventName);
ScriptEventCode evc = (ScriptEventCode)Enum.Parse(typeof(ScriptEventCode), evt.EventName);
// Put event on end of event queue.
bool startIt = false;
@@ -86,6 +85,32 @@ namespace OpenSim.Region.ScriptEngine.Yengine
if(!m_Running && !construct)
return;
if(m_minEventDelay != 0)
{
switch (evc)
{
// ignore some events by time set by llMinEventDelay
case ScriptEventCode.collision:
case ScriptEventCode.land_collision:
case ScriptEventCode.listen:
case ScriptEventCode.not_at_target:
case ScriptEventCode.not_at_rot_target:
case ScriptEventCode.no_sensor:
case ScriptEventCode.sensor:
case ScriptEventCode.timer:
case ScriptEventCode.touch:
{
double now = Util.GetTimeStamp();
if (now < m_nextEventTime)
return;
m_nextEventTime = now + m_minEventDelay;
break;
}
default:
break;
}
}
// Only so many of each event type allowed to queue.
if((uint)evc < (uint)m_EventCounts.Length)
{
@@ -124,10 +149,8 @@ namespace OpenSim.Region.ScriptEngine.Yengine
for(lln2 = m_EventQueue.First; lln2 != null; lln2 = lln2.Next)
{
EventParams evt2 = lln2.Value;
ScriptEventCode evc2 = (ScriptEventCode)Enum.Parse(typeof(ScriptEventCode),
evt2.EventName);
if((evc2 != ScriptEventCode.state_entry) &&
(evc2 != ScriptEventCode.attach))
ScriptEventCode evc2 = (ScriptEventCode)Enum.Parse(typeof(ScriptEventCode), evt2.EventName);
if((evc2 != ScriptEventCode.state_entry) && (evc2 != ScriptEventCode.attach))
break;
}
if(lln2 == null)