private async void _lockTrackerService_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
        {
            if (QueueList.Any())
            {
                var chatId = QueueList[0].ChatId;
                if (_lockTrackerService.IsRoomFree)
                {
                    InitializeRoomDequeue();

                    _menuLoader.LoadStateMenu(chatId, UserState.InMainMenu);
                }
                else
                {
                    CancelInBetweenTimer(toTheRoom: true);


                    _menuLoader.LoadStateMenu(chatId, UserState.InTheRoom);


                    _LogHelper.Log("LLN435N43FDGFDGFD879", $"About to delete a notification for {chatId}", chatId, LogLevel.Information);
                }
            }
            else
            {
                _LogHelper.Log("NBN75KJ6U55Y", "Adding user0 to the EMPTY queue", LogLevel.Information);
                var slot = new QueueSlot(0, 5);
                QueueList.Add(slot);

                ProcessUserInTheRoom();
            }
        }
Exemple #2
0
        public async Task Refresh_Works_NoEvent(FFXIVRole role)
        {
            var queue        = new TestQueue();
            var enqueuedSlot = new QueueSlot(UserId, "", new List <ulong>())
            {
                QueueTime = DateTime.UtcNow.AddHours(-4).AddMinutes(-45),
            };

            queue.AddSlot(enqueuedSlot, role);
            await Task.Delay(1000);

            var now = DateTime.UtcNow;

            queue.Refresh(UserId);
            var dequeuedSlot = queue.GetAllSlots().First();

            Assert.AreEqual(now.Hour, dequeuedSlot.QueueTime.Hour);
            Assert.AreEqual(now.Minute, dequeuedSlot.QueueTime.Minute);
        }
Exemple #3
0
        public void AddSlot(QueueSlot slot, FFXIVRole role)
        {
            var queue = GetQueue(role);

            queue.Add(slot);
        }