Ejemplo n.º 1
0
 private void tmrSimulation_Tick(object sender, EventArgs e)
 {
     if (!RunningSimulation)
     {
         tmrSimulation.Enabled = false;
         SimWindow.lblSimRun.ForeColor = Color.Green;
         SimWindow.lblSimRun.Text = "Simulation Completed";
         lastsim = tempsim;
     }
 }
Ejemplo n.º 2
0
        void runsim()
        {
            tmpbalance = PreviousBalance;
            tmpwins = Wins;
            tmplosses = Losses;
            tmpStartBalance = StartBalance;
            tmpprofit = profit;
            StartBalance = dPreviousBalance = (double)SimWindow.nudSimBalance.Value;
            Wins = Losses = 0;
            profit = 0;

            string chars = "0123456789abcdef";
            if (! (CurrentSite is dice999))
            {
                chars += "ghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ._";
            }
            server = "";

            for (int i = 0; i < 64; i++)
            {
                server += (chars[rand.Next(0, chars.Length)]);
            }
            client = "";
            if (CurrentSite is dice999)
            {
                client = rand.Next(0, int.MaxValue).ToString();
            }
            else
            for (int i = 0; i < 24; i++)
            {
                client += rand.Next(0, 10).ToString();
            }

            string sserver = "";
            foreach (byte b in server)
            {
                sserver += Convert.ToChar(b);
            }

            tempsim = new Simulation(dPreviousBalance.ToString("0.00000000"), (Wins+Losses).ToString(), sserver, client);
            RunningSimulation = true;
            stop = false;
            Lastbet = MinBet;
            Start(false);
        }