Пример #1
0
        private void Timer_3_sec_Tick(object sender, EventArgs e)
        {
            if (sessionHasPaid == false)
            {
                loadExesFromSQL();
                foreach (string temp in programData.listOfExesRequiringCoins)
                {
                    ExeMethods.checkForAndKillProcess(temp);
                }
            }
            else
            {
                int numCoins = CoinMethods.getCoins(Environment.UserName);
                if (numCoins < 1)
                {
                    SqlMethods.writeToPointsLog("has stopped paying for games. " + numCoins + " Coins.");
                    timer_1_min.Enabled        = false;
                    button_payForGames.Enabled = false;
                    button_StartGames.Enabled  = true;
                    sessionHasPaid             = false;
                }
            }

            isSessionDisabled();

            label_numCoins.Text = CoinMethods.getCoins(Environment.UserName).ToString();
        }
Пример #2
0
        private void Button_payForGames_Click(object sender, EventArgs e)
        {
            int numCoins = CoinMethods.getCoins(Environment.UserName);

            SqlMethods.writeToPointsLog("has stop paying for games. " + numCoins + " Coins.");
            timer_1_min.Enabled        = false;
            button_payForGames.Enabled = false;
            button_StartGames.Enabled  = true;
            sessionHasPaid             = false;
        }
Пример #3
0
 private void Timer_1_min_Tick(object sender, EventArgs e)
 {
     if (sessionHasPaid == true)
     {
         int numCoins = CoinMethods.getCoins(Environment.UserName);
         if (numCoins >= 1)
         {
             CoinMethods.decreaseCoinsForExe(numCoins, 1);
         }
     }
 }
Пример #4
0
        private void Button_StartGames_Click(object sender, EventArgs e)
        {
            int numCoins = CoinMethods.getCoins(Environment.UserName);

            if (numCoins >= 1)
            //if(ExeMethods.payForExe(CoinMethods.getCoins(Environment.UserName), numCoinsRequiredToPlay, saveData.sessionLimit) == true)
            {
                SqlMethods.writeToPointsLog("has clicked pay for games. " + numCoins + " Coins.");
                timer_1_min.Enabled        = true;
                button_payForGames.Enabled = true;
                button_StartGames.Enabled  = false;
                sessionHasPaid             = true;
            }
        }
Пример #5
0
 private void isSessionDisabled()
 {
     saveData = (SaveData)StructMethods.LoadData();
     if (saveData.isSessionDisabled == 1)
     {
         int numCoins = CoinMethods.getCoins(Environment.UserName);
         //if(ExeMethods.payForExe(CoinMethods.getCoins(Environment.UserName), numCoinsRequiredToPlay, saveData.sessionLimit) == true)
         {
             //SqlMethods.writeToPointsLog("has stopped paying for games. " + numCoins + " Coins.");
             timer_1_min.Enabled        = false;
             button_payForGames.Enabled = false;
             button_StartGames.Enabled  = true;
             sessionHasPaid             = false;
         }
     }
 }