Esempio n. 1
0
 private void OnTurnCancel(TwitchUser user)
 {
     if (user == null)
     {
         return;
     }
     if (_queuedUsers.Contains(user))
     {
         Console.WriteLine($"{user.UserName} cancelled waiting for turn");
         _queuedUsers.Remove(user);
         if (_queuedUsers.Count == 0)
         {
             // No other users, user gets unlimited time
             _expirationTime = -1;
             _turnLength     = -1;
             Broadcast($"CLIENT_ACTIVE {_activeUser.UserId} {_activeUser.UserName} {_activeUser.Picture} {_expirationTime} {_turnLength}");
         }
     }
     else if (user.Equals(_activeUser))
     {
         Console.WriteLine($"{user.UserName} cancelled their active turn, picking next player");
         _turnExpirationTimer.Enabled = false;
         _activeUser = null;
         OnNextTurn();
     }
 }
Esempio n. 2
0
 private void OnInputFrame(TwitchUser user, string frame)
 {
     if (_activeUser.Equals(user))
     {
         _sink.Update(InputFrame.ParseInputString(frame));
     }
 }