Beispiel #1
0
        public void AddPlayerToQueue(string usr)
        {
            this.Invoke(new Action(() => {
                if (!string.IsNullOrEmpty(usr))
                {
                    Player player = queue.QueuePlayer(string.Concat(usr.Where(char.IsLetterOrDigit)));
                    if (!string.IsNullOrEmpty(player.playerName))
                    {
                        QueueList.Items.Add(usr);

                        if (QueueList.Items.Count == 1)
                        {
                            twitchBot.SendMsg("@" + usr + " - You have the next spot.");
                        }
                        else
                        {
                            twitchBot.SendMsg("@" + usr + " - You have spot " + QueueList.Items.Count.ToString() + " in list.");
                        }
                    }
                }
            }));
        }