示例#1
0
        private void ReStartSbo(object obj)
        {
            SboEngine s = obj as SboEngine;

            Logger.Info("TAM DUNG SBO SCAN<<<<<<<<<<<<<<<<<<");
            s.OnExceptionEvent        -= OnExceptionEvent;
            s.UpdateLiveDataChange    -= sbobetUpdateChange_Event;
            s.UpdateNonLiveDataChange -= sbobetUpdateChange_Event;
            s.LogOff();

            if (s.ReLogin())
            {
                s.UpdateLiveDataChange    += sbobetUpdateChange_Event;
                s.UpdateNonLiveDataChange += sbobetUpdateChange_Event;
                s.OnExceptionEvent        += OnExceptionEvent;
                s.StartScanDriver(ScanType);

                switch (ScanType)
                {
                case eScanType.Live:
                    s.StartUpdateLiveDriver();
                    break;

                case eScanType.NonLive:
                    s.StartUpdateNonLiveDriver();
                    break;

                case eScanType.All:
                    s.StartUpdateLiveDriver();
                    s.StartUpdateNonLiveDriver();
                    break;
                }
            }
        }
示例#2
0
        public void StartSbo()
        {
            int sboCount = DataContainer.SboScanAccounts.Count;

            foreach (var sboAcc in DataContainer.SboScanAccounts)
            {
                Random r   = new Random();
                string url = DataContainer.SboScanServers[r.Next(DataContainer.SboScanServers.Count())];

                SboEngine sbo1 = new SboEngine();
                //sbo1.IpFake = IpHelper.GetRandomIp();

                sbo1.TryLoginScan(url, sboAcc.Username, sboAcc.Password);
                if (sbo1.AccountStatus == eAccountStatus.Online)
                {
                    sbo1.UpdateLiveDataChange += sbobetUpdateChange_Event;
                    sbo1.OnExceptionEvent     += OnExceptionEvent;
                    sbo1.StartScanDriver(eScanType.Live);
                    SboScanEngines.Add(sbo1);
                }
            }
            var timeSboLiveSleep = TimeSboLiveScan / sboCount;
            int oType            = 0;

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

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

            Logger.Info("START SBO SCAN THANH CONG>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
        }
示例#3
0
        public void StartSbo()
        {
            int sboCount = DataContainer.SboScanAccounts.Count;

            foreach (var sboAcc in DataContainer.SboScanAccounts)
            {
                Random r   = new Random();
                string url = DataContainer.SboScanServers[r.Next(DataContainer.SboScanServers.Count())];

                SboEngine sbo1 = new SboEngine();
                //sbo1.IpFake = IpHelper.GetRandomIp();
                sbo1.OnFakeRequest += OnFakeRequest;

                sbo1.TryLoginScan(url, sboAcc.Username, sboAcc.Password);
                if (sbo1.AccountStatus == eAccountStatus.Online)
                {
                    sbo1.UpdateLiveDataChange    += sbobetUpdateChange_Event;
                    sbo1.UpdateNonLiveDataChange += sbobetUpdateChange_Event;
                    sbo1.OnExceptionEvent        += OnExceptionEvent;
                    sbo1.StartScanDriver(ScanType);
                    SboScanEngines.Add(sbo1);
                }
            }

            switch (ScanType)
            {
            case eScanType.Live:
                StartUpdateSboLiveDriver();
                break;

            case eScanType.NonLive:
                StartUpdateSboNonLiveDriver();
                break;

            case eScanType.All:
                StartUpdateSboLiveDriver();
                StartUpdateSboNonLiveDriver();
                break;
            }
            //var timeSboLiveSleep = SystemConfig.TIME_GET_UPDATE_LIVE_SBOBET / sboCount;
            //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>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
        }