Example #1
0
        public void StartLoginSbo()
        {
            int i           = 0;
            int countServer = DataContainer.SboServers.Count();
            int countIp     = 0;

            if (_useRealIp)
            {
                countIp = ScanData.IpAddress.Count;
            }

            Parallel.ForEach(ScanData.ScanAccount.SboAccounts, sboAcc =>
            {
                try
                {
                    Random r = new Random();
                    var url  = DataContainer.SboServers[r.Next(countServer)];

                    SboEngine sbo1 = new SboEngine();

                    if (_useRealIp)
                    {
                        var ip             = ScanData.IpAddress[r.Next(countIp)];
                        sbo1.RealIpAddress = ip;
                    }

                    if (ScanData.HasFakeIpSbo)
                    {
                        sbo1.IpFake = IpHelper.GetRandomIp();
                    }

                    sbo1.OnFakeRequest += OnFakeRequest;

                    sbo1.TryLogin(url, sboAcc.Username, sboAcc.Password);

                    if (sbo1.AccountStatus == eAccountStatus.Online)
                    {
                        i++;
                        SboScanEngines.Add(sbo1);
                        Logger.Info("SBO COUNT = " + i);
                    }
                }
                catch (Exception ex)
                {
                    Logger.Error(ex);
                }
            });

            //foreach (var sboAcc in ScanData.ScanAccount.SboAccounts)
            //{

            //}

            Logger.Info("LOGIN SBO SCAN THANH CONG @@@@@@@@@@@@@@@@@@@ TONG ACC: " + SboScanEngines.Count);
        }
Example #2
0
        public void StartSbo(string url)
        {
            var sboScanAccs = System.IO.File.ReadAllLines(@"Config/SboScanAccs.txt");
            Dictionary <string, string> sboAccdics = new Dictionary <string, string>();

            foreach (var sboScanAcc in sboScanAccs)
            {
                var leagues = sboScanAcc.Split(new[] { "<>" }, StringSplitOptions.None);
                sboAccdics[leagues[0]] = leagues[1];
            }

            //sboAccdics.AsParallel().ForAll(item =>
            //{

            //});

            foreach (var sboAcc in sboAccdics)
            {
                SboEngine sbo1 = new SboEngine();
                sbo1.OnFakeRequest += OnFakeRequest;

                while (sbo1.AccountStatus == eAccountStatus.Offline)
                {
                    sbo1.TryLogin(url, sboAcc.Key, sboAcc.Value);
                }

                sbo1.UpdateLiveDataChange += sbobetUpdateChange_Event;
                sbo1.OnExceptionEvent     += OnExceptionEvent;
                sbo1.StartScanLiveDriver();
                SboScanEngines.Add(sbo1);
            }

            var timeSboLiveSleep = SystemConfig.TIME_GET_UPDATE_LIVE_SBOBET / sboAccdics.Count;
            int oType            = 0;

            foreach (var sboScanEngine in SboScanEngines)
            {
                sboScanEngine.TypeGetScan = oType;
                sboScanEngine.StartUpdateLiveDriver();
                //Thread.Sleep(1000);
                Thread.Sleep(timeSboLiveSleep);

                oType = oType == 0 ? 1 : 0;
            }

            Logger.Info("START SBO SCAN THANH CONG>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
        }