Example #1
0
        private void CheckForExpiredScripts()
        {
            lock (_scriptChangeLock)
            {
                while (_delayQueue.Count > 0)
                {
                    KeyValuePair <UUID, DateTime> kvp = _delayQueue.FindMinItemAndIndex();
                    if (kvp.Value <= DateTime.Now)
                    {
                        _delayQueue.Remove(kvp.Key);

                        if (_dirtyScripts.ContainsKey(kvp.Key))
                        {
                            //if this script is dirty and its wait is expired, we can request a save for it now
                            _delayQueue.Add(kvp.Key, DateTime.Now + SAVE_INTERVAL);
                            _scheduler.RequestStateData(new StateDataRequest(kvp.Key, this.StateAvailable));
                        }

                        //else, this script is expired, but not dirty. just removing it is fine
                    }
                    else
                    {
                        break;
                    }
                }
            }
        }
Example #2
0
 private void FlushExpiredDeletes()
 {
     while (_pastDeletes.Count > 0)
     {
         KeyValuePair <long, DateTime> kvp = _pastDeletes.FindMinItemAndIndex();
         if (kvp.Value <= DateTime.Now)
         {
             // m_log.WarnFormat("[REST COMMS]: Expiring deleted object nonce ID nonce ID {0}", kvp.Key);
             _pastDeletes.DeleteMin();
         }
         else
         {
             break;
         }
     }
 }
        /// <summary>
        /// Checks for kinematics that have not been updated in KINEMATIC_TRANSITION_TIME - WINDOW and
        /// changes them to statics if appropriate
        /// </summary>
        public void CheckForExipiredKinematics()
        {
            ulong currentTickCount = Util.GetLongTickCount();

            while (_trackedObjects.Count > 0)
            {
                var lastUpdatedOn = _trackedObjects.FindMinItemAndIndex();
                if (currentTickCount > lastUpdatedOn.Value && currentTickCount - lastUpdatedOn.Value > KINEMATIC_TRANSITION_WINDOW)
                {
                    _trackedObjects.DeleteMin();
                    this.TransitionKinematic(lastUpdatedOn.Key);
                }
                else
                {
                    break;
                }
            }
        }