minor fix on sensorrepeat
parent
19d141c9a5
commit
a932f24ba4
|
@ -160,7 +160,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
|
||||||
ts.arc = arc;
|
ts.arc = arc;
|
||||||
ts.host = host;
|
ts.host = host;
|
||||||
|
|
||||||
ts.next = DateTime.Now.ToUniversalTime().AddSeconds(ts.interval);
|
ts.next = DateTime.UtcNow.AddSeconds(ts.interval);
|
||||||
|
|
||||||
AddSenseRepeater(ts);
|
AddSenseRepeater(ts);
|
||||||
}
|
}
|
||||||
|
@ -196,14 +196,20 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
|
||||||
public void CheckSenseRepeaterEvents()
|
public void CheckSenseRepeaterEvents()
|
||||||
{
|
{
|
||||||
// Go through all timers
|
// Go through all timers
|
||||||
foreach (SensorInfo ts in SenseRepeaters)
|
|
||||||
|
List<SensorInfo> curSensors;
|
||||||
|
lock(SenseRepeatListLock)
|
||||||
|
curSensors = SenseRepeaters;
|
||||||
|
|
||||||
|
DateTime now = DateTime.UtcNow;
|
||||||
|
foreach (SensorInfo ts in curSensors)
|
||||||
{
|
{
|
||||||
// Time has passed?
|
// Time has passed?
|
||||||
if (ts.next.ToUniversalTime() < DateTime.Now.ToUniversalTime())
|
if (ts.next < now)
|
||||||
{
|
{
|
||||||
SensorSweep(ts);
|
SensorSweep(ts);
|
||||||
// set next interval
|
// set next interval
|
||||||
ts.next = DateTime.Now.ToUniversalTime().AddSeconds(ts.interval);
|
ts.next = now.AddSeconds(ts.interval);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue