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>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"); }
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>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"); }