Add a MinTimerInterval, defaulted at 0.5s, to the scripting configuration

0.6.1-post-fixes
Melanie Thielker 2008-11-10 05:33:36 +00:00
parent fc6f3edec6
commit dd688e95e0
1 changed files with 5 additions and 0 deletions

View File

@ -74,6 +74,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
protected AsyncCommandManager AsyncCommands = null; protected AsyncCommandManager AsyncCommands = null;
protected float m_ScriptDelayFactor = 1.0f; protected float m_ScriptDelayFactor = 1.0f;
protected float m_ScriptDistanceFactor = 1.0f; protected float m_ScriptDistanceFactor = 1.0f;
protected float m_MinTimerInterval = 0.5f;
private DateTime m_timer = DateTime.Now; private DateTime m_timer = DateTime.Now;
private bool m_waitingForScriptAnswer=false; private bool m_waitingForScriptAnswer=false;
@ -91,6 +92,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
m_ScriptEngine.Config.GetFloat("ScriptDelayFactor", 1.0f); m_ScriptEngine.Config.GetFloat("ScriptDelayFactor", 1.0f);
m_ScriptDistanceFactor = m_ScriptDistanceFactor =
m_ScriptEngine.Config.GetFloat("ScriptDistanceLimitFactor", 1.0f); m_ScriptEngine.Config.GetFloat("ScriptDistanceLimitFactor", 1.0f);
m_MinTimerInterval =
m_ScriptEngine.Config.GetFloat("MinTimerInterval", 0.5f);
AsyncCommands = new AsyncCommandManager(ScriptEngine); AsyncCommands = new AsyncCommandManager(ScriptEngine);
} }
@ -2464,6 +2467,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public void llSetTimerEvent(double sec) public void llSetTimerEvent(double sec)
{ {
if (sec < m_MinTimerInterval)
sec = m_MinTimerInterval;
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
// Setting timer repeat // Setting timer repeat
AsyncCommands.TimerPlugin.SetTimerEvent(m_localID, m_itemID, sec); AsyncCommands.TimerPlugin.SetTimerEvent(m_localID, m_itemID, sec);