コード例 #1
0
 /// <summary>
 /// End Bankheist Timer tick
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void BankheistEndTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
 {
     StopListining();
     NewBankheistTimer.Start();
     CurrentBankheist.PayOut();
     IsOnCooldown = true;
 }
コード例 #2
0
        /// <summary>
        /// Chat command received
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public void OnChatCommandReceived(object sender, OnChatCommandReceivedArgs e)
        {
            if ((String.Compare(e.Command.Command, Config.Instance["Bankheist"]["Command"])) == 0)
            {
                if (!IsOnCooldown)
                {
                    if (CurrentBankheist == null)
                    {
                        CurrentBankheist = new Bankheist(InitModel);

                        // write start in chat
                        WriteStartInChat();

                        // start bankheist end timer
                        BankheistEndTimer.Start();
                    }

                    CurrentBankheist.AddUserToBankheist(e.Command.ChatMessage.Username,
                                                        e.Command.ChatMessage.UserId, e.Command.ArgumentsAsString);
                }
                else
                {
                    AivaClient.Instance.AivaTwitchClient.SendMessage("Bankheist is on Cooldown!");
                }
            }
        }