public eServiceStatus Start(eScanType scanType) { CompareValueDifferent = ProcessorConfigInfo.CompareValue; ScanType = scanType; CountBet = 1; MaxCountBet = ProcessorConfigInfo.MaxCountBet; LastBetTime = DateTime.Now.AddMinutes(-10); LastBetIbetSuccess = DateTime.Now.AddMinutes(-10); BetStakeType = ProcessorConfigInfo.BetStakeType; BetStake = ProcessorConfigInfo.BetStake; TimeOffStakeOdds = ProcessorConfigInfo.TimeOffStakeOdds; MinOddDefBet = ProcessorConfigInfo.MinOddDefBet; MinTimeToBet = ProcessorConfigInfo.MinTimeToBet; BetAgainstIbet = ProcessorConfigInfo.RebetIbet; WaitingTimeRebetIbet = ProcessorConfigInfo.WaitingTimeRebetIbet; AcceptMinLossIbet = ProcessorConfigInfo.AcceptMinLossIbet; if (ProcessorConfigInfo.AccountFirst.ServerType == eServerType.Ibet) { IbetMaxStakeMatch = ProcessorConfigInfo.AccountFirst.MaxStake; IbetRateExchange = ProcessorConfigInfo.AccountFirst.RateExchange; SboMaxStakeMatch = ProcessorConfigInfo.AccountSecond.MaxStake; SboRateExchange = ProcessorConfigInfo.AccountSecond.RateExchange; } else { IbetMaxStakeMatch = ProcessorConfigInfo.AccountSecond.MaxStake; IbetRateExchange = ProcessorConfigInfo.AccountSecond.RateExchange; SboMaxStakeMatch = ProcessorConfigInfo.AccountFirst.MaxStake; SboRateExchange = ProcessorConfigInfo.AccountFirst.RateExchange; } try { Initialize(); ProcessorName = IbetEngine.UserName + " - " + SboEngine.UserName; //EngineLogger engineLogger = new EngineLogger(engineName); //if (SboEngine.CheckLogin() && IbetEngine.CheckLogin()) //{ SboEngine.EngineName = ProcessorName; //SboEngine.EngineLogger = engineLogger; SboEngine.Rebet = ProcessorConfigInfo.RebetSbo; //SboEngine.InitEngine(); SboEngine.UpdateAvailabeCredit(); SboEngine.StartScanEngine(scanType); //IbetEngine.InitEngine(); IbetEngine.EngineName = ProcessorName; //IbetEngine.EngineLogger = engineLogger; IbetEngine.UpdateAvailabeCredit(); IbetEngine.StartScanEngine(scanType); objUpdateCreditTimer = new Timer(WaitUpdateCreditCallback, null, 60000 * 5, 60000 * 5); StartFailCount = 0; //IbetSboDriver.OnSboScanUpdate += IbetSboDriverOnUpdateScan; ServerCallback.OnSboScanUpdate += OnSboUpdateScan; ServerCallback.OnIbetScanUpdate += OnIbetUpdateScan; FireProcessStateChange(eServiceStatus.Started, ProcessorName); Status = eServiceStatus.Started; //} // return eServiceStatus.Unknown; } catch (Exception ex) { Logger.Error("Start Processor Fail !", ex); StartFailCount++; SboEngine.Dispose(); SboEngine.Dispose(); Status = eServiceStatus.Unknown; } return(Status); }
public eServiceStatus Start(eScanType scanType) { Random r = new Random(); CompareValueDifferent = ProcessorConfigInfo.CompareValue + AddToCompare[r.Next(AddToCompare.Count)]; ScanType = scanType; CountBet = 1; MaxCountBet = ProcessorConfigInfo.MaxCountBet; LastBetTime = DateTime.Now.AddMinutes(-10); BetStakeType = ProcessorConfigInfo.BetStakeType; Stake = ProcessorConfigInfo.BetStake; BetStake = new List <int>(); var stak = Stake.Split(new[] { '#' }); foreach (var s in stak) { if (!string.IsNullOrEmpty(s)) { int stake; int.TryParse(s, out stake); if (stake != 0) { //Logger.Info("STAKE " + stake); BetStake.Add(stake); } } } BetStake.Shuffle(); TimeOffStakeOdds = ProcessorConfigInfo.TimeOffStakeOdds; MinOddDefBet = ProcessorConfigInfo.MinOddDefBet; MinTimeToBet = ProcessorConfigInfo.MinTimeToBet; BetAgainstIbet = ProcessorConfigInfo.RebetIbet; AcceptMinLossIbet = ProcessorConfigInfo.AcceptMinLossIbet; if (ProcessorConfigInfo.AccountFirst.ServerType == eServerType.Sbo) { IbetMaxStakeMatch = ProcessorConfigInfo.AccountSecond.MaxStake; IbetRateExchange = ProcessorConfigInfo.AccountSecond.RateExchange; SboMaxStakeMatch = ProcessorConfigInfo.AccountFirst.MaxStake; SboRateExchange = ProcessorConfigInfo.AccountFirst.RateExchange; } else { IbetMaxStakeMatch = ProcessorConfigInfo.AccountFirst.MaxStake; IbetRateExchange = ProcessorConfigInfo.AccountFirst.RateExchange; SboMaxStakeMatch = ProcessorConfigInfo.AccountSecond.MaxStake; SboRateExchange = ProcessorConfigInfo.AccountSecond.RateExchange; } try { Initialize(); ProcessorName = PiEngine.UserName + " - " + SboEngine.UserName; SboEngine.EngineName = ProcessorName; SboEngine.Rebet = ProcessorConfigInfo.RebetSbo; SboEngine.UpdateAvailabeCredit(); SboEngine.StartScanEngine(scanType); PiEngine.EngineName = ProcessorName; PiEngine.UpdateAvailabeCredit(); PiEngine.StartScanEngine(scanType); objUpdateCreditTimer = new Timer(WaitUpdateCreditCallback, null, 60000 * 5, 60000 * 5); StartFailCount = 0; SboEngine.UpdateLiveDataChange += OnSboUpdateScan; PiSboDriver.OnSboScanUpdate += PiSboDriver_OnSboScanUpdate; //_driver.OnSboScanUpdate += OnSboUpdateScan; FireProcessStateChange(eServiceStatus.Started, ProcessorName); Status = eServiceStatus.Started; } catch (Exception ex) { Logger.Error("Start Processor Fail !", ex); StartFailCount++; PiEngine.Dispose(); SboEngine.Dispose(); SboEngine.Dispose(); Status = eServiceStatus.Unknown; } return(Status); }
public eServiceStatus Start(eScanType scanType) { CompareValueDifferent = ProcessorConfigInfo.CompareValue; ScanType = scanType; CountBet = 1; MaxCountBet = ProcessorConfigInfo.MaxCountBet; LastBetTime = DateTime.Now.AddMinutes(-10); LastBetIbetSuccess = DateTime.Now.AddMinutes(-10); BetStakeType = ProcessorConfigInfo.BetStakeType; Stake = ProcessorConfigInfo.BetStake; BetStake = new List <int>(); var stak = Stake.Split(new[] { '#' }); foreach (var s in stak) { if (!string.IsNullOrEmpty(s)) { int stake; int.TryParse(s, out stake); if (stake != 0) { //Logger.Info("STAKE " + stake); BetStake.Add(stake); } } } BetStake.Shuffle(); TimeOffStakeOdds = ProcessorConfigInfo.TimeOffStakeOdds; MinOddDefBet = ProcessorConfigInfo.MinOddDefBet; MinTimeToBet = ProcessorConfigInfo.MinTimeToBet; BetAgainstIbet = ProcessorConfigInfo.RebetIbet; //WaitingTimeRebetIbet = ProcessorConfigInfo.WaitingTimeRebetIbet; AcceptMinLossIbet = ProcessorConfigInfo.AcceptMinLossIbet; if (ProcessorConfigInfo.AccountFirst.ServerType == eServerType.Ibet) { IbetMaxStakeMatch = ProcessorConfigInfo.AccountFirst.MaxStake; IbetRateExchange = ProcessorConfigInfo.AccountFirst.RateExchange; SboMaxStakeMatch = ProcessorConfigInfo.AccountSecond.MaxStake; SboRateExchange = ProcessorConfigInfo.AccountSecond.RateExchange; } else { IbetMaxStakeMatch = ProcessorConfigInfo.AccountSecond.MaxStake; IbetRateExchange = ProcessorConfigInfo.AccountSecond.RateExchange; SboMaxStakeMatch = ProcessorConfigInfo.AccountFirst.MaxStake; SboRateExchange = ProcessorConfigInfo.AccountFirst.RateExchange; } try { Initialize(); ProcessorName = IbetEngine.UserName + " - " + SboEngine.UserName; //EngineLogger engineLogger = new EngineLogger(engineName); //if (SboEngine.CheckLogin() && PiEngine.CheckLogin()) //{ SboEngine.EngineName = ProcessorName; //SboEngine.EngineLogger = engineLogger; SboEngine.Rebet = ProcessorConfigInfo.RebetSbo; //SboEngine.InitEngine(); SboEngine.UpdateAvailabeCredit(); SboEngine.StartScanEngine(scanType); //PiEngine.InitEngine(); IbetEngine.EngineName = ProcessorName; //PiEngine.EngineLogger = engineLogger; IbetEngine.UpdateAvailabeCredit(); IbetEngine.StartScanEngine(scanType); objUpdateCreditTimer = new Timer(WaitUpdateCreditCallback, null, 60000 * 5, 60000 * 5); StartFailCount = 0; _driver.OnSboScanUpdate += OnSboUpdateScan; //SboEngine.UpdateLiveDataChange += SboEngineOnUpdateLiveDataChange; //IbetSboDriver.OnSboScanUpdate += OnSboUpdateScan; //ServerCallback.OnSboScanUpdate += OnSboUpdateScan; //ServerCallback.OnIbetScanUpdate += OnIbetUpdateScan; ServerCallback.OnTransactionStatic += ServerCallback_OnTransaction; FireProcessStateChange(eServiceStatus.Started, ProcessorName); Status = eServiceStatus.Started; //List<TransactionDTO> transactionDtos; //while (TransactionQueue.TryDequeue(out transactionDtos)) //{ // // do nothing //} //processBetThread = new Thread(DoBetTransaction); //processBetThread.Start(); //} // return eServiceStatus.Unknown; } catch (Exception ex) { Logger.Error("Start Processor Fail !", ex); StartFailCount++; SboEngine.Dispose(); SboEngine.Dispose(); Status = eServiceStatus.Unknown; } return(Status); }
public eServiceStatus Start(eScanType scanType) { CompareValueDifferent = ProcessorConfigInfo.CompareValue; CountBet = 1; MaxCountBet = ProcessorConfigInfo.MaxCountBet; LastBetTime = DateTime.Now; BetStakeType = ProcessorConfigInfo.BetStakeType; BetStake = ProcessorConfigInfo.BetStake; TimeOffStakeOdds = ProcessorConfigInfo.TimeOffStakeOdds; if (ProcessorConfigInfo.AccountFirst.ServerType == eServerType.Ibet) { IbetMaxStakeMatch = ProcessorConfigInfo.AccountFirst.MaxStake; IbetRateExchange = ProcessorConfigInfo.AccountFirst.RateExchange; SboMaxStakeMatch = ProcessorConfigInfo.AccountSecond.MaxStake; SboRateExchange = ProcessorConfigInfo.AccountSecond.RateExchange; } else { IbetMaxStakeMatch = ProcessorConfigInfo.AccountSecond.MaxStake; IbetRateExchange = ProcessorConfigInfo.AccountSecond.RateExchange; SboMaxStakeMatch = ProcessorConfigInfo.AccountFirst.MaxStake; SboRateExchange = ProcessorConfigInfo.AccountFirst.RateExchange; } try { Initialize(); var engineName = IbetEngine.UserName + " - " + SboEngine.UserName; //EngineLogger engineLogger = new EngineLogger(engineName); //if (SboEngine.CheckLogin() && IbetEngine.CheckLogin()) //{ SboEngine.EngineName = engineName; //SboEngine.EngineLogger = engineLogger; SboEngine.Rebet = ProcessorConfigInfo.RebetSbo; //SboEngine.InitEngine(); SboEngine.UpdateAvailabeCredit(); SboEngine.StartScanEngine(scanType); //IbetEngine.InitEngine(); IbetEngine.EngineName = engineName; //IbetEngine.EngineLogger = engineLogger; IbetEngine.UpdateAvailabeCredit(); IbetEngine.StartScanEngine(scanType); objUpdateCreditTimer = new Timer(WaitUpdateCreditCallback, null, 60000 * 5, 60000 * 5); StartFailCount = 0; Status = eServiceStatus.Started; //} // return eServiceStatus.Unknown; } catch (Exception ex) { Logger.Error("Start Processor Fail !", ex); StartFailCount++; SboEngine.Dispose(); SboEngine.Dispose(); Status = eServiceStatus.Unknown; } return(Status); //else //{ // StartServerFault startServerFault = new StartServerFault(); // startServerFault.ServerID = IbetEngine.Account.GuidID; // startServerFault.Message = "Login Fail !"; // throw new FaultException<StartServerFault>(startServerFault); //} }