private void ReStartSboBet(object obj) { SboEngine s = obj as SboEngine; UpdateLogText(string.Format("Mất kết nối tài khoản [{0}] đang thực hiện kết nối lại....", s.UserName), eLogTextType.Error); s.OnExceptionEvent -= SboBetOnOnExceptionEvent; s.LogOff(); if (s.ReLogin()) { s.OnExceptionEvent += SboBetOnOnExceptionEvent; s.StartBetRunEngine(scanType, true); UpdateLogText(string.Format("Kết nối tài khoản [{0}] thành công!", s.UserName), eLogTextType.Warning); } }
public void Stop() { Pause(); SboEn.LogOff(); IbetEn.LogOff(); //foreach (var engine in BetEngine) //{ // engine.Dispose(); //} //BetEngine.Clear(); Status = eServiceStatus.Stopped; UpdateWriteTextLog(string.Format("DỪNG QUÉT THÀNH CÔNG!"), eLogTextType.Highlight); }
private void ReStartSbo(object obj) { SboEngine s = obj as SboEngine; s.OnExceptionEvent -= sboScan_OnExceptionEvent; s.UpdateLiveDataChange -= sboScan_UpdateLiveDataChange; s.UpdateNonLiveDataChange -= sboScan_UpdateLiveDataChange; s.LogOff(); if (s.ReLogin()) { s.UpdateLiveDataChange += sboScan_UpdateLiveDataChange; s.UpdateNonLiveDataChange += sboScan_UpdateLiveDataChange; s.OnExceptionEvent += sboScan_OnExceptionEvent; s.StartBetRunEngine(scanType, false); } }
private void ReStartSbo(object obj) { SboEngine s = obj as SboEngine; Logger.Info("TAM DUNG SBO SCAN<<<<<<<<<<<<<<<<<<"); s.OnExceptionEvent -= OnExceptionEvent; s.UpdateLiveDataChange -= sbobetUpdateChange_Event; s.LogOff(); if (s.ReLogin()) { s.UpdateLiveDataChange += sbobetUpdateChange_Event; s.OnExceptionEvent += OnExceptionEvent; s.StartScanLiveDriver(); s.StartUpdateLiveDriver(); } }
private void SboScan_OnExceptionEvent(ExceptionMessage logMsg, eServerType serverType, object obj) { SboEngine engine = obj as SboEngine; engine.OnExceptionEvent -= SboScan_OnExceptionEvent; engine.LogOff(); while (engine.AccountStatus == eAccountStatus.Offline) { if (engine.ReLogin()) { engine.StartScanEngine(eScanType.Live); engine.OnExceptionEvent += SboScan_OnExceptionEvent; break; } Thread.Sleep(15000); } }
void PingManage(object sender, ElapsedEventArgs e) { try { if (_manageService.PingBet(SelfInfo.Username, SelfInfo.MacAddress, keyPing) != 1) { timerPing.Stop(); sboScan.LogOff(); foreach (var buyEngine in buyAccEngines) { if (buyEngine.AccountStatus == eAccountStatus.Online) { buyEngine.LogOff(); } } foreach (var sellEn in sellAccEngines) { if (sellEn.AccountStatus == eAccountStatus.Online) { sellEn.LogOff(); } } buyAccEngines.Clear(); sellAccEngines.Clear(); MessageBox.Show("Tài khoản này hiện đang login tại một nơi khác, vui lòng kiểm tra lại!", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Warning); this.Dispose(); Application.Exit(); } } catch (Exception ex) { Logger.Error(ex); //ConnectManage(); //throw; } }
private void ReStartSbo(object obj) { try { 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; } } } catch (Exception ex) { Logger.Fatal("BIG BUG", ex); } }