示例#1
0
        public MainWindow()
        {
            InitializeComponent();

            dbConn = new DatabaseConnection();

            var settings = new CefSettings();

            settings.WindowlessRenderingEnabled = true;
#if !DEBUG
            // Disable packloading in release build
            settings.PackLoadingDisabled = true;
            // Disable logs in release build
            settings.LogSeverity = LogSeverity.Disable;
#endif
            // Initialize Cef with provided settings
            Cef.Initialize(settings);
            browser = new ChromiumWebBrowser("http://saltybet.com");
            // this.pMain.Controls.Add(browser);
            // browser.Dock = DockStyle.Fill;

            dataExtractor = new DataExtractor(browser);
            matchTracker  = new MatchTracker();

            Account account = new Account(browser);
            account.Login();

            FillDataView();

            refreshThread = new Thread(refreshLoop);
            refreshThread.Start();
        }
示例#2
0
        /// <summary>
        /// Updates all the match stats with data from the browser window.
        /// </summary>
        /// <param name="dataExtractor"></param>
        public void Update(DataExtractor dataExtractor)
        {
            // Set call's stats to the Last
            LastPlayer1     = Player1;
            LastPlayer2     = Player2;
            LastPotPlayer1  = PotPlayer1;
            LastPotPlayer2  = PotPlayer2;
            LastOddsPlayer1 = OddsPlayer1;
            LastOddsPlayer2 = OddsPlayer2;

            // Check if a winner was announced.
            StatusMessage = dataExtractor.GetStatusText();
            if (StatusMessage.Contains(LastPlayer1))
            {
                LastWinner = LastPlayer1;
            }
            if (StatusMessage.Contains(LastPlayer2))
            {
                LastWinner = LastPlayer2;
            }

            // Get new player names, if applicable.
            Player1 = dataExtractor.GetRedName();
            Player2 = dataExtractor.GetBlueName();
            // Get new pots
            PotPlayer1 = dataExtractor.GetRedPotNum();
            PotPlayer2 = dataExtractor.GetBluePotNum();
            // Get new odds
            OddsPlayer1 = dataExtractor.GetRedOdds();
            OddsPlayer2 = dataExtractor.GetBlueOdds();
        }