private SboEngine InitLoginSbo(string domain, string username, string pass, object ipFake, int rate) { UpdateLogText(string.Format("Bắt đầu đăng nhập tài khoản SBO [{0}]......", username), eLogTextType.Warning); SboEngine sboEngine = new SboEngine(); if (ipFake != null) { if (!string.IsNullOrEmpty(ipFake.ToString())) { sboEngine.IpFake = ipFake.ToString(); } } if (sboEngine.Login(domain, username, pass)) { sboEngine.EngineId = Guid.NewGuid().ToString(); sboEngine.ExchangeRate = rate * 10; sboEngine.StartScanEngine(eScanType.Live); UpdateLogText(string.Format("Đăng nhập [{0}] thành công! Số dư khả dụng là {1}", username, sboEngine.UpdateAvailabeCredit())); return(sboEngine); } else { UpdateLogText(string.Format("Đăng nhập sbo [{0}] không thành công!", username), eLogTextType.Error); return(null); } }
public void StartScanBroker() { SellMatchs = new BlockingCollection <BrokerTransaction>(); ScoredMatchs = new BlockingCollection <MatchBrokerDTO>(); lock (LockSellTrans) { SellTrans.Clear(); } IbetEn.ScoreEventChanged += IbetEnScoreEventChanged; SboEn.UpdateLiveDataChange += SboEnOnUpdateLiveDataChange; SboEn.OnExceptionEvent += SboScan_OnExceptionEvent; IbetEn.OnExceptionEvent += IbetScan_OnExceptionEvent; SboEnScan.OnExceptionEvent += SboScan_OnExceptionEvent; IbetEnScan.OnExceptionEvent += IbetScan_OnExceptionEvent; int inputStakeBuy = StakeBuy; StakeBuy = (inputStakeBuy * MainRate * 10) / 1000; MaxPointCheck = (50 * StakeBuy) / inputStakeBuy; SboEnScan.StartScanEngine(eScanType.Live); IbetEnScan.StartScanEngine(eScanType.Live); IbetEn.StartScanEngine(eScanType.Live); SboEn.StartScanEngine(eScanType.Live); Status = eServiceStatus.Started; UpdateWriteTextLog(string.Format("KHỞI ĐỘNG THÀNH CÔNG!"), eLogTextType.Highlight); }
public void StartScanBroker() { lock (LockSellMatch) { SellMatchs.Clear(); } lock (LockScoredMatch) { ScoredMatchs = new List <MatchBrokerDTO>(); } lock (LockSellTrans) { SellTrans.Clear(); } IbetEn.ScoreEventChanged += IbetEnScoreEventChanged; SboEn.UpdateLiveDataChange += SboEnOnUpdateLiveDataChange; IbetEn.UpdateLiveDataChange += IbetEnOnUpdateLiveDataChange; StakeBuy = (StakeBuy * MainRate * 10) / 1000; IbetEn.StartScanEngine(eScanType.Live); SboEn.StartScanEngine(eScanType.Live); Status = eServiceStatus.Started; UpdateWriteTextLog(string.Format("KHỞI ĐỘNG THÀNH CÔNG!"), eLogTextType.Highlight); }
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); } }