Esempio n. 1
0
        public override void GetTicketAndBet(AgentToClientBet bet1, EnumCollection.eBetFollowMethod method1)
        {
            try
            {
                if (base._isAutoBetting)
                {
                    if (!base._isBetting)
                    {
                        if (!this.IsWaitingBetCoolDown())
                        {
                            int num = 0;
                            if (!base._isPerMatchLimitEnabled | (base._isPerMatchLimitEnabled & base._objPerMatchLimitList.IsCanBet(bet1.get_SourceAgentMemberBet(), ref num)))
                            {
                                bool flag = false;
                                MatchBetNew new2 = new MatchBetNew();
                                new2 = bet1.get_SourceAgentMemberBet().Clone();
                                EnumCollection.eBetTarget target = bet1.get_SourceAgentMemberBet().get_BetTarget();
                                switch (new2.get_BetTarget())
                                {
                                    case EnumCollection.eBetTarget.FT_Home:
                                    case EnumCollection.eBetTarget.FT_Over:
                                    case EnumCollection.eBetTarget.Half_Home:
                                    case EnumCollection.eBetTarget.Half_Under:
                                        flag = true;
                                        break;

                                    default:
                                        flag = false;
                                        break;
                                }
                                if (method1 == EnumCollection.eBetFollowMethod.Opposite)
                                {
                                    target = SpiderFunction.ConvertBetFollowMethodToOpposite(target);
                                }
                                this.GetTicketAndBetFromAgent(bet1.get_SourceAgentMemberBet(), bet1.get_TargetClientMatch(), target, bet1.get_TargetAmount() - bet1.get_BettedAmount(), bet1.CloneObject());
                            }
                            else
                            {
                                bet1.get_SourceAgentMemberBet().set_Description("Exceed Per Match Limit!");
                                base._objBetListFailed.Add(bet1.get_SourceAgentMemberBet());
                                this.get__objBetQueueMonitor().UpdateMatchStatus(bet1.get_SourceAgentMemberBet().get_ID(), "Exceed Per Match Limit!");
                                this.WriteProgramLogger("Exceed Per Match Limit!");
                            }
                        }
                        else
                        {
                            this.WriteProgramLogger("Please wait, program is waiting bet cool down...");
                        }
                    }
                    else
                    {
                        this.WriteProgramLogger("Please wait, program is betting other match...");
                    }
                }
                else
                {
                    bet1.get_SourceAgentMemberBet().set_Description("Auto Bet OFF.");
                    base._objBetListFailed.Add(bet1.get_SourceAgentMemberBet());
                    this.get__objBetQueueMonitor().UpdateMatchStatus(bet1.get_SourceAgentMemberBet().get_ID(), "Auto Bet OFF");
                    this.WriteProgramLogger("Auto Bet OFF.");
                }
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                base._objErrorLogger.write(base._strName + ": EXCEPTION IN GetTicketAndBet: " + exception.Message);
                this.WriteProgramLogger(base._strName + ": EXCEPTION IN GetTicketAndBet: " + exception.Message);
                ProjectData.ClearProjectError();
            }
        }
Esempio n. 2
0
        /// <summary>
        ///  当投注额大于单场赛事限制投注额时,进行二分法投注
        /// </summary>
        /// <param name="gamerSite">博彩网</param>
        /// <param name="message">下注消息</param>
        /// <param name="currentBet">当前下注对象</param>
        private void TryBetAgain(WebSiteAbstractClass gamerSite, string message, AgentToClientBet currentBet)
        {
            if (message.Contains(IBC_STAKE_DESC) ||
                message.Contains(SBO_STAKE_DESC) ||
                message.Contains(IBC_BETCREDIT_DESC) ||
                message.Contains(SBO_BETCREDIT_DESC) ||
                currentBet.get_SourceAgentMemberBet().BetFailCount > ConstUtil.BET_FAIL_COUNT)
            {
                PlayerBetLog log = setBetLogMessage(message);
                DataServiceAdapter.SavePlayerBetLog(log);
                currentBet.set_IsRemoved(true);
            }
            else if (message.Contains(IBC_PERLIMIT) || message.Contains(SBO_PERLIMIT))
            {
                int betAmount = currentBet.get_TargetAmount();
                String[] arrays = message.Split(SPLIT);
                // 当单场赛事投注达到限制投注额时,将赌注降低为原来的一半进行下注
                if (arrays.Length == 2)
                {
                    betAmount = Conversions.ToInteger(arrays[1]) / 2;
                }
                currentBet.set_TargetAmount(betAmount);
                currentBet.set_BetAmountValue(MARK_VALUE);

                if (!gamerSite.get_IsGettingFullOdds())
                {
                    gamerSite.GetOddsFromServer();
                }
                List<MatchNew> newMatchNews = gamerSite.get_MatchListFull();
                MatchNew oldMatchNew = currentBet.get_TargetClientMatch();
                foreach (var newMatchNew in newMatchNews)
                {
                    // 取最新的赛事数据
                    if (oldMatchNew.get_FT_ID() == newMatchNew.get_FT_ID())
                    {
                        currentBet.set_TargetClientMatch(newMatchNew);
                        break;
                    }
                }
            }
            gamerSite.get_BetQueueList().UpdateBetMatchInfo(currentBet);
        }