コード例 #1
0
ファイル: RideProcessor.cs プロジェクト: Cycli/Cycli
        public RideProcessor(string userId)
        {
            _outputLock = new ReaderWriterLockSlim();
            UserId = userId;
            // load the turbo
            _spotData = new Spot();
            _lastSpotData = null;

            // Set-up the lease

            LeaseId = GenerateLease(12);

            // Set the initial timeout
            LastUpdateTimestamp = DateTime.UtcNow;

            _messageQueue = new Queue<InterfaceDatum>(QUEUE_CAPACITY);
            _queueLock = new ReaderWriterLockSlim();
            _zeroingTimer = new Timer(CheckZeroing, null, 1000, 4000);

            _Rider = Rider.LoadAny(userId);

            // will load either a real or virtual rider
            if (_Rider != null)
            {
                _Turbo = TurboTrainer.Load(UserId, _Rider.CurrentTurbo, _Rider.TurboIsCalibrated);
            }
        }
コード例 #2
0
ファイル: DataHub.cs プロジェクト: Cycli/Cycli
 public void SetTurboDetails(TurboTrainer turbo)
 {
     string userId = Context.User.Identity.Name;
       turbo.Save(userId);
 }
コード例 #3
0
ファイル: DataHub.cs プロジェクト: Cycli/Cycli
 public void SetRiderEquipment(UserRider rider, TurboTrainer turbo)
 {
     string userId = Context.User.Identity.Name;
     rider.SaveEquipment(userId);
     if (turbo != null)
     {
     turbo.Save(userId);
     }
     // This may have changed the configuration - kill the existing processor
     CycliManager.Instance.Kill(userId);
 }