private bool UpdateActivityState(DateTime now)
{
var lastInterval = now - ActivityState.LastActivity.Value;
// ignore past updates
if (lastInterval > SessionInterval) { return false; }
ActivityState.LastActivity = now;
if (lastInterval.Ticks < 0)
{
Logger.Error("Time Travel!");
}
else
{
ActivityState.SessionLenght += lastInterval;
ActivityState.TimeSpent += lastInterval;
}
return true;
}