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
        private void setBetAmount(AgentToClientBet bet)
        {
            // 玩家赌注
            int newBetAmount = decimal.ToInt32(playerConvert.Member.get_BetCredit());
            // 该场比赛玩家首次下注
            int gamerBetAmount = System.Convert.ToInt32(playerConvert.Player.PerMatchTarget) - bet.get_BettedAmount();
            if (newBetAmount > gamerBetAmount)
            {
                newBetAmount = gamerBetAmount;
            }

            bet.set_TargetAmount(newBetAmount);
        }