Ejemplo n.º 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();
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 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);
         }
     }
 }
Ejemplo n.º 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;
            }
        }
Ejemplo n.º 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;
         }
     }
 }