Ejemplo n.º 1
0
        public static string GenerateDetailedMatchInfo(MatchNew new1, MatchBetNew new3, MatchBetNew new2, EnumCollection.eBetTarget target1, string text1, string text2)
        {
            string str4 = "";
            string str3 = "";
            double num = 0.0;
            switch (target1)
            {
                case EnumCollection.eBetTarget.FT_Home:
                    str3 = new1.get_FTHDP();
                    str4 = new1.get_FT_AwayOddsString();
                    num = new1.get_FTHDP_Commission();
                    break;

                case EnumCollection.eBetTarget.FT_Away:
                    str3 = new1.get_FTHDP();
                    str4 = new1.get_FT_HomeOddsString();
                    num = new1.get_FTHDP_Commission();
                    break;

                case EnumCollection.eBetTarget.FT_Over:
                    str3 = new1.get_FTOU();
                    str4 = new1.get_FT_UnderOddsString();
                    num = new1.get_FTOU_Commission();
                    break;

                case EnumCollection.eBetTarget.FT_Under:
                    str3 = new1.get_FTOU();
                    str4 = new1.get_FT_OverOddsString();
                    num = new1.get_FTOU_Commission();
                    break;

                case EnumCollection.eBetTarget.Half_Home:
                    str3 = new1.get_HalfHDP();
                    str4 = new1.get_Half_AwayOddsString();
                    num = new1.get_HalfHDP_Commission();
                    break;

                case EnumCollection.eBetTarget.Half_Away:
                    str3 = new1.get_HalfHDP();
                    str4 = new1.get_Half_HomeOddsString();
                    num = new1.get_HalfHDP_Commission();
                    break;

                case EnumCollection.eBetTarget.Half_Over:
                    str3 = new1.get_HalfOU();
                    str4 = new1.get_Half_UnderOddsString();
                    num = new1.get_HalfOU_Commission();
                    break;

                case EnumCollection.eBetTarget.Half_Under:
                    str3 = new1.get_HalfOU();
                    str4 = new1.get_Half_OverOddsString();
                    num = new1.get_HalfOU_Commission();
                    num = new1.get_HalfOU_Commission();
                    break;
            }
            return ("\r\n============================================================\r\n" + text1 + "\r\n============================================================\r\nLeague: " + new2.get_League() + "\r\nHome: " + new3.get_HomeName() + "\r\nAway: " + new3.get_AwayName() + "\r\nBet: " + new3.get_SelectedMatch() + "\r\nHDP: " + new3.get_HDP() + "\r\nOdd: " + new3.get_OddsString() + "\r\nNew HDP: " + new2.get_HDP() + "\r\nNew Odd: " + new2.get_OddsString() + "\r\n" + text2 + " HDP: " + str3 + "\r\n" + text2 + " Opponent Odd: " + str4 + "\r\n" + text2 + " Commission: " + num.ToString() + "\r\nAmount: " + new2.get_BetAmount() + "\r\n============================================================");
        }
Ejemplo n.º 2
0
        private void RequestCompleteTicketFromAgent(IAsyncResult result1)
        {
            try
            {
                // Michael
                // EnumCollection.eBetType type;
                EnumCollection.eBetType type = EnumCollection.eBetType.HDP;
                int num4 = 0;
                int num = 0;
                string str4 = "";
                string str = "";
                string str10 = "";
                string str8 = "";
                string str3 = "";
                string inputStr = "";
                string str7 = "";
                string str5 = "";
                string str12 = "";
                ArrayList list = new ArrayList();
                string str13 = "";
                int num3 = 0;
                int num2 = 0;
                WebRequestStateEx2 asyncState = (WebRequestStateEx2)result1.AsyncState;
                int num5 = 0;
                string str14 = null;
                str12 = CommonFunction.ConvertWebRequestToString(asyncState.get_Request(), ref num5, ref str14);
                this.WriteProgramLogger("Get SBOBet Ticket Complete. (" + DateTime.Now.Subtract(base._datTicketStart).TotalMilliseconds.ToString() + "ms)");
                this.WriteBetlistLogger("Ticket: " + str12);
                this.WriteProgramLogger("Ticket: " + str12);
                if(string.IsNullOrEmpty(str12) || this.IsLoggedOut(ref str12))
                {
                    throw new Exception(this._strAccountID + " has getted ticket fail.");
                }
                this.ExtractInfoFromTicket(str12, ref str4, ref str, ref str10, ref str5, ref type, ref str3, ref str8, ref inputStr, ref str7, ref num4, ref num, ref num2);
                this.WriteProgramLogger("Odds : " + str8);
                MatchBetNew item = new MatchBetNew();
                item.set_Company(asyncState.get_MatchBetParentSite().get_Company());
                item.set_League(str5);
                item.set_HomeName(str4);
                item.set_AwayName(str);
                item.set_SelectedMatch(asyncState.get_MatchBetParentSite().get_SelectedMatch());
                item.HDPValue = str3;
                if (!string.IsNullOrEmpty(str3))
                {
                    string HDP_id = this.ConvertHDPTypeSBO(str3);
                    item.set_HDP(HDP_id);
                }
                item.set_OddsString(str8);
                item.set_MaxBetAmount(inputStr);
                item.set_SportType(asyncState.get_MatchBetParentSite().get_SportType());
                item.set_HomeColor(asyncState.get_MatchBetParentSite().get_HomeColor());
                item.set_AwayColor(asyncState.get_MatchBetParentSite().get_AwayColor());
                item.set_BetCoverage(asyncState.get_MatchBetParentSite().get_BetCoverage());
                item.set_BetType(asyncState.get_BetType());
                item.set_BetTarget(asyncState.get_BetTarget());
                item.set_BetFollowMethod(asyncState.get_MatchBetParentSite().get_BetFollowMethod());
                item.set_ID(asyncState.get_MatchBetParentSite().get_ID());
                item.set_MemberName(asyncState.get_MatchBetParentSite().get_MemberName());
                item.set_HomeScore(num4);
                item.set_AwayScore(num);
                item.set_MatchType(asyncState.get_MatchBetParentSite().get_MatchType());
                item.set_MatchDate(asyncState.get_MatchBetChildSite().get_MatchDate());
                item.set_OddsType(base._objBetOddsType);
                item.set_GameType(asyncState.get_MatchBetParentSite().get_GameType());
                item.set_RunningStatus(asyncState.get_MatchBetParentSite().get_RunningStatus());

                if (asyncState.get_BetAmount() == Conversions.ToDouble("-1"))
                {
                    item.set_BetAmount(inputStr);
                }
                else
                {
                    item.set_BetAmount(Conversions.ToString(asyncState.get_BetAmount()));
                }

                if (Conversion.Val(item.get_BetAmount()) > Conversion.Val(inputStr))
                {
                    item.set_BetAmount(inputStr);
                }

                /*** start Aorta
                if (Conversion.Val(item.get_BetAmount()) > base._intMaxBetLimiter)
                {
                    item.set_BetAmount(Conversions.ToString(base._intMaxBetLimiter));
                }
                if (base._isAutoAdjustToMinBetAmount && (Conversion.Val(item.get_BetAmount()) < Conversion.Val(str7)))
                {
                    item.set_BetAmount(str7);
                }***/

                item.set_BetAmount(Conversions.ToString(Conversion.Int(Conversion.Val(item.get_BetAmount()))));

                if (str12.Contains(".showTicket(0)"))
                {
                    throw new Exception("Odds are closed or temporary not available.");
                }
                if ((asyncState.get_AgentToClientBetObj() != null) && (asyncState.get_AgentToClientBetObj().get_FollowOddsOpt() != null))
                {
                    if (asyncState.get_AgentToClientBetObj().get_FollowOddsOpt().get_FollowOddsOption() == EnumCollection.eFollowOddsOption.HaltIfOddsLessThan)
                    {
                        if (SpiderFunction.IsOddsALessThanOddsB(item.get_Odds(), asyncState.get_AgentToClientBetObj().get_FollowOddsOpt().get_OddsValue()))
                        {
                            item.set_Description(string.Format("Odds Too Less ([{0}] < [{1}])", item.get_OddsString(), asyncState.get_MatchBetParentSite().get_OddsString()));
                            this.WriteProgramLogger(item.get_Description());
                            base._objBetListFailed.Add(item);
                            this.get__objBetQueueMonitor().UpdateMatchStatus(asyncState.get_MatchBetParentSite().get_ID(), item.get_Description());
                            this.get__objBetQueueMonitor().SaveBetInfo(item.get_Description(), asyncState.get_MatchBetParentSite());
                            base._isBetting = false;
                            this.RaiseEventGetTicketComplete(base._strName, false, asyncState.get_BetTarget(), asyncState.get_MatchParentSite(), asyncState.get_MatchBetParentSite(), asyncState.get_MatchChildSite(), asyncState.get_MatchBetChildSite(), null);
                            return;
                        }
                    }
                    else if (((asyncState.get_MatchBetParentSite().get_BetFollowMethod() == EnumCollection.eBetFollowMethod.Normal) & (asyncState.get_AgentToClientBetObj().get_FollowOddsOpt().get_FollowOddsOption() == EnumCollection.eFollowOddsOption.HaltIfOddsDifferentMoreThan)) && (SpiderFunction.GetOddsDiffSameSide(item.get_Odds(), asyncState.get_MatchBetParentSite().get_Odds()) > asyncState.get_AgentToClientBetObj().get_FollowOddsOpt().get_OddsValue()))
                    {
                        item.set_Description(string.Format("Odds Different Too Much ([{0}] > [{1}]", item.get_OddsString(), asyncState.get_MatchBetParentSite().get_OddsString()));
                        this.WriteProgramLogger(item.get_Description());
                        base._objBetListFailed.Add(item);
                        this.get__objBetQueueMonitor().SaveBetInfo(item.get_Description(), asyncState.get_MatchBetParentSite());
                        this.get__objBetQueueMonitor().UpdateMatchStatus(asyncState.get_MatchBetParentSite().get_ID(), item.get_Description());
                        base._isBetting = false;
                        this.RaiseEventGetTicketComplete(base._strName, false, asyncState.get_BetTarget(), asyncState.get_MatchParentSite(), asyncState.get_MatchBetParentSite(), asyncState.get_MatchChildSite(), asyncState.get_MatchBetChildSite(), null);
                        return;
                    }
                }
                base._isBetting = false;
                if ((asyncState.get_MatchBetParentSite().get_HomeScore() == num4) & (asyncState.get_MatchBetParentSite().get_AwayScore() == num))
                {
                    if (!base._isPerMatchLimitEnabled | (base._isPerMatchLimitEnabled & base._objPerMatchLimitList.IsCanBet(item, (int)Math.Round(Conversion.Val(item.get_BetAmount())), ref num3)))
                    {
                        if (num3 < Conversion.Val(item.get_BetAmount()))
                        {
                            item.set_BetAmount(num3.ToString());
                        }
                        str13 = string.Format("stake={0}&betcount={1}&loginname={2}&stakeInAuto={3}", new object[] { item.get_BetAmount(), num2.ToString(), this._strLoginName, item.get_BetAmount() });
                        this.RaiseEventGetTicketComplete(base._strName, true, asyncState.get_BetTarget(), asyncState.get_MatchParentSite(), asyncState.get_MatchBetParentSite(), asyncState.get_MatchChildSite(), asyncState.get_MatchBetChildSite(), item);
                        if (base._isAutoBetting)
                        {
                            if (base._isToTrySimilarHDP | (!base._isToTrySimilarHDP & (asyncState.get_MatchBetParentSite().get_HDP() == str3)))
                            {
                                this.WriteProgramLogger("Can Bet SBOBet.[INFO]  " + str13);
                                this.WriteBetlistLogger("Can Bet SBOBet. POST: " + str13);
                                this.Bet(str13, item, asyncState.get_MatchChildSite(), asyncState.get_BetTarget());
                            }
                            else
                            {
                                this.WriteProgramLogger("Cannot Bet SBOBet.");
                                this.WriteBetlistLogger(" Cannot Bet SBOBet. POST: " + str13);
                                this.WriteBetlistLogger(SpiderFunction.GenerateDetailedMatchInfo(asyncState.get_MatchBetParentSite(), asyncState.get_MatchBetChildSite(), "Failed Ticket HDP/ODDS Change", "SBOAgent"));
                                item.set_Description("HDP/Odds Change");
                                base._objBetListFailed.Add(item);
                                this.get__objBetQueueMonitor().SaveBetInfo(item.get_Description(), asyncState.get_MatchBetParentSite());
                                this.get__objBetQueueMonitor().UpdateMatchStatus(asyncState.get_MatchBetParentSite().get_ID(), item.get_Description());
                                this.RaiseEventGetTicketComplete(base._strName, false, asyncState.get_BetTarget(), asyncState.get_MatchParentSite(), asyncState.get_MatchBetParentSite(), asyncState.get_MatchChildSite(), asyncState.get_MatchBetChildSite(), null);
                            }
                        }
                        else
                        {
                            this.WriteProgramLogger("Auto Bet OFF.");
                            item.set_Description("Auto Bet OFF.");
                            base._objBetListFailed.Add(item);
                            this.get__objBetQueueMonitor().SaveBetInfo(item.get_Description(), asyncState.get_MatchBetParentSite());
                            this.get__objBetQueueMonitor().UpdateMatchStatus(asyncState.get_MatchBetParentSite().get_ID(), item.get_Description());
                            this.RaiseEventGetTicketComplete(base._strName, false, asyncState.get_BetTarget(), asyncState.get_MatchParentSite(), asyncState.get_MatchBetParentSite(), asyncState.get_MatchChildSite(), asyncState.get_MatchBetChildSite(), null);
                        }
                    }
                    else
                    {
                        this.WriteProgramLogger("Exceed Per Match Limit!");
                        item.set_Description("Exceed Per Match Limit!");
                        base._objBetListFailed.Add(item);
                        this.get__objBetQueueMonitor().SaveBetInfo(item.get_Description(), asyncState.get_MatchBetParentSite());
                        this.get__objBetQueueMonitor().UpdateMatchStatus(asyncState.get_MatchBetParentSite().get_ID(), item.get_Description());
                        this.RaiseEventGetTicketComplete(base._strName, false, asyncState.get_BetTarget(), asyncState.get_MatchParentSite(), asyncState.get_MatchBetParentSite(), asyncState.get_MatchChildSite(), asyncState.get_MatchBetChildSite(), null);
                    }
                }
                else
                {
                    this.WriteProgramLogger(string.Format("Score Changed [{0}-{1}] -> [{2}-{3}]", new object[] { asyncState.get_MatchBetParentSite().get_HomeScore(), asyncState.get_MatchBetParentSite().get_AwayScore(), num4, num }));
                    item.set_Description(string.Format("Score Changed [{0}-{1}] -> [{2}-{3}]", new object[] { asyncState.get_MatchBetParentSite().get_HomeScore(), asyncState.get_MatchBetParentSite().get_AwayScore(), num4, num }));
                    base._objBetListFailed.Add(item);
                    this.get__objBetQueueMonitor().SaveBetInfo(item.get_Description(), asyncState.get_MatchBetParentSite());
                    this.get__objBetQueueMonitor().UpdateMatchStatus(asyncState.get_MatchBetParentSite().get_ID(), item.get_Description());
                    this.RaiseEventGetTicketComplete(base._strName, false, asyncState.get_BetTarget(), asyncState.get_MatchParentSite(), asyncState.get_MatchBetParentSite(), asyncState.get_MatchChildSite(), asyncState.get_MatchBetChildSite(), null);
                }
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                base._isBetting = false;
                base._objErrorLogger.write(base._strName + ": EXCEPTION IN RequestCompleteTicketFromAgent: " + exception.Message);
                this.WriteProgramLogger(base._strName + ": EXCEPTION IN RequestCompleteTicketFromAgent: " + exception.Message);
                WebRequestStateEx2 ex2 = (WebRequestStateEx2)result1.AsyncState;
                this.get__objBetQueueMonitor().SaveBetInfo(exception.Message, ex2.get_MatchBetParentSite());
                this.RaiseEventGetTicketComplete(base._strName, true, ex2.get_BetTarget(), ex2.get_MatchParentSite(), ex2.get_MatchBetParentSite(), ex2.get_MatchChildSite(), ex2.get_MatchBetChildSite(), null);
                ProjectData.ClearProjectError();
            }
        }
Ejemplo n.º 3
0
 public static string GenerateDetailedMatchInfo(MatchBetNew new2, MatchBetNew new1, string text1, string text2)
 {
     return ("\r\n============================================================\r\n" + text1 + "\r\n============================================================\r\nLeague: " + new1.get_League() + "\r\nHome: " + new2.get_HomeName() + "\r\nAway: " + new2.get_AwayName() + "\r\nBet: " + new2.get_SelectedMatch() + "\r\n" + text2 + " HDP: " + new2.get_HDP() + "\r\n" + text2 + " Odd: " + new2.get_OddsString() + "\r\nNew HDP: " + new1.get_HDP() + "\r\nNew Odd: " + new1.get_OddsString() + "\r\nAmount: " + new1.get_BetAmount() + "\r\n============================================================");
 }
Ejemplo n.º 4
0
        // Aorta
        private void RequestCompleteTicketFromAgent(IAsyncResult result1)
        {
            try
            {
                int num3 = 0;
                int num = 0;
                string str4 = "";
                string str = "";
                string str10 = "";
                string str8 = "";
                string str3 = "";
                string inputStr = "";
                string str5 = "";
                string str7 = "";
                string str2 = "";
                string str11 = "";
                string str9 = "";
                string str12 = "";
                ArrayList list = new ArrayList();
                string str14 = "";
                int num2 = 0;
                string str13 = "";
                WebRequestStateEx2 asyncState = (WebRequestStateEx2)result1.AsyncState;
                int num4 = 0;
                string str16 = null;

                str12 = CommonFunction.ConvertWebRequestToString(asyncState.get_Request(), ref num4, ref str16);
                str13 = str12.ToLower();
                this.WriteProgramLogger("Get IBCBet Ticket Complete. (" + Conversions.ToString(DateTime.Now.Subtract(base._datTicketStart).TotalMilliseconds) + "ms)");
                this.WriteBetlistLogger("Ticket: " + str12);
                this.WriteProgramLogger("Ticket: " + str12);
                if (string.IsNullOrEmpty(str13) || this.IsLoggedOut(ref str12))
                {
                    throw new Exception(this._strAccountID + " has getted ticket fail.");
                }
                this.ExtractInfoFromTicket(str12, ref str4, ref str, ref str10, ref str5, ref str3, ref str8, ref inputStr, ref str7, ref str2, ref str9, ref str11, ref num3, ref num);
                this.WriteProgramLogger("IBCBet Client Odds : " + str8);

                if (!(str13.Contains("suspend") | str13.Contains("'close'")))
                {
                    MatchBetNew item = new MatchBetNew();
                    item.set_Company(asyncState.get_MatchBetParentSite().get_Company());
                    item.set_League(str5);
                    item.set_HomeName(str4);
                    item.set_AwayName(str);
                    item.set_SelectedMatch(str10);
                    item.HDPValue = str3;
                    if (!string.IsNullOrEmpty(str3))
                    {
                        string HDP_id = SportBookFunction.ConvertHDPType(str3);
                        item.set_HDP(HDP_id);
                    }
                    item.set_OddsString(str8);
                    item.set_MaxBetAmount(inputStr);
                    item.set_SportType(asyncState.get_MatchBetParentSite().get_SportType());
                    item.set_HomeColor(asyncState.get_MatchBetParentSite().get_HomeColor());
                    item.set_AwayColor(asyncState.get_MatchBetParentSite().get_AwayColor());
                    item.set_BetCoverage(asyncState.get_MatchBetParentSite().get_BetCoverage());
                    item.set_BetType(asyncState.get_MatchBetParentSite().get_BetType());
                    item.set_BetFollowMethod(asyncState.get_MatchBetParentSite().get_BetFollowMethod());
                    item.set_ID(asyncState.get_MatchBetParentSite().get_ID());
                    item.set_MemberName(asyncState.get_MatchBetParentSite().get_MemberName());
                    item.set_HomeScore(num3);
                    item.set_AwayScore(num);
                    item.set_MatchType(asyncState.get_MatchBetParentSite().get_MatchType());
                    item.set_MatchDate(asyncState.get_MatchBetChildSite().get_MatchDate());
                    item.set_GameType(asyncState.get_MatchBetParentSite().get_GameType());
                    item.set_RunningStatus(asyncState.get_MatchBetParentSite().get_RunningStatus());
                    item.set_MatchID(asyncState.get_MatchBetChildSite().getMatchID());
                    item.set_IPAddress(base.ipAdress);

                    switch (str9)
                    {
                        case "2":
                            item.set_OddsType(EnumCollection.eOddsType.HK);
                            break;

                        case "4":
                            item.set_OddsType(EnumCollection.eOddsType.Malay);
                            break;
                    }

                    if (asyncState.get_BetAmount() == Conversions.ToDouble("-1"))
                    {
                        item.set_BetAmount(inputStr);
                    }
                    else
                    {
                        item.set_BetAmount(Conversions.ToString(asyncState.get_BetAmount()));
                    }

                    if (Conversion.Val(item.get_BetAmount()) > Conversion.Val(inputStr))
                    {
                        item.set_BetAmount(inputStr);
                    }
                    /***** start Aorta
                    if (Conversion.Val(item.get_BetAmount()) > base._intMaxBetLimiter)
                    {
                        //item.set_BetAmount(Conversions.ToString(base._intMaxBetLimiter));
                    }

                    if (base._isAutoAdjustToMinBetAmount && (Conversion.Val(item.get_BetAmount()) < Conversion.Val(str7)))
                    {
                        item.set_BetAmount(str7);
                    }
                     end Aorta *****/

                    item.set_BetAmount(Conversions.ToString(Conversion.Int(Conversion.Val(item.get_BetAmount()))));

                    if ((asyncState.get_AgentToClientBetObj() != null) && (asyncState.get_AgentToClientBetObj().get_FollowOddsOpt() != null))
                    {
                        if (asyncState.get_AgentToClientBetObj().get_FollowOddsOpt().get_FollowOddsOption() == EnumCollection.eFollowOddsOption.HaltIfOddsLessThan)
                        {
                            if (SpiderFunction.IsOddsALessThanOddsB(item.get_Odds(), asyncState.get_AgentToClientBetObj().get_FollowOddsOpt().get_OddsValue()))
                            {
                                item.set_Description(string.Format("Odds Too Less ([{0}] < [{1}])", item.get_OddsString(), asyncState.get_MatchBetParentSite().get_OddsString()));
                                this.WriteProgramLogger(item.get_Description());
                                base._objBetListFailed.Add(item);
                                this.get__objBetQueueMonitor().UpdateMatchStatus(asyncState.get_MatchBetParentSite().get_ID(), item.get_Description());
                                this.get__objBetQueueMonitor().SaveBetInfo(item.get_Description(), asyncState.get_MatchBetParentSite());
                                base._isBetting = false;
                                this.RaiseEventGetTicketComplete(base._strName, false, asyncState.get_BetTarget(), asyncState.get_MatchParentSite(), asyncState.get_MatchBetParentSite(), asyncState.get_MatchChildSite(), asyncState.get_MatchBetChildSite(), null);
                                return;
                            }
                        }
                        else if (((asyncState.get_MatchBetParentSite().get_BetFollowMethod() == EnumCollection.eBetFollowMethod.Normal) & (asyncState.get_AgentToClientBetObj().get_FollowOddsOpt().get_FollowOddsOption() == EnumCollection.eFollowOddsOption.HaltIfOddsDifferentMoreThan)) && (SpiderFunction.GetOddsDiffSameSide(item.get_Odds(), asyncState.get_MatchBetParentSite().get_Odds()) > asyncState.get_AgentToClientBetObj().get_FollowOddsOpt().get_OddsValue()))
                        {
                            item.set_Description(string.Format("Odds Different Too Much ([{0}] > [{1}]", item.get_OddsString(), asyncState.get_MatchBetParentSite().get_OddsString()));
                            this.WriteProgramLogger(item.get_Description());
                            base._objBetListFailed.Add(item);
                            this.get__objBetQueueMonitor().SaveBetInfo(item.get_Description(), asyncState.get_MatchBetParentSite());
                            this.get__objBetQueueMonitor().UpdateMatchStatus(asyncState.get_MatchBetParentSite().get_ID(), item.get_Description());
                            base._isBetting = false;
                            this.RaiseEventGetTicketComplete(base._strName, false, asyncState.get_BetTarget(), asyncState.get_MatchParentSite(), asyncState.get_MatchBetParentSite(), asyncState.get_MatchChildSite(), asyncState.get_MatchBetChildSite(), null);
                            return;
                        }
                    }
                    if ((asyncState.get_MatchBetParentSite().get_HomeScore() == num3) & (asyncState.get_MatchBetParentSite().get_AwayScore() == num))
                    {
                        if (!base._isPerMatchLimitEnabled | (base._isPerMatchLimitEnabled & base._objPerMatchLimitList.IsCanBet(item, (int)Math.Round(Conversion.Val(item.get_BetAmount())), ref num2)))
                        {
                            if (num2 < Conversion.Val(item.get_BetAmount()))
                            {
                                item.set_BetAmount(num2.ToString());
                            }
                            str14 = "BPstake=" + item.get_BetAmount() + "&stakeRequest=&oddsRequest=" + str8 + "&oddChange1=Odds+has+changed+from&oddChange2=to&MINBET=" + str7 + "&MAXBET=" + inputStr + "&bettype=" + str2 + "&lowerminmesg=Your+stake+is+lower+than+minimun+bet%21%21%21&highermaxmesg=Your+stake+is+higher+than+maximum+bet%21%21%21&areyousuremesg=Are+you+sure+you+want+process+the+bet%3F&incorrectStakeMesg=Incorrect+Stake.&oddsWarning=WARNING%21%21%21+WE+HAVE+GIVEN+A+NEW+ODDS+%26+NEW+STAKE%21%21%21&betconfirmmesg=Please+click+OK+to+confirm+the+bet%3F&siteType=&hidStake10=Stake+must+be+in+multiples+of+10&hidStake20=Stake+must+be+in+multiples+of+20&sporttype=" + str11 + "&username="******"&oddsType=" + str9;
                            this.RaiseEventGetTicketComplete(base._strName, true, asyncState.get_BetTarget(), asyncState.get_MatchParentSite(), asyncState.get_MatchBetParentSite(), asyncState.get_MatchChildSite(), asyncState.get_MatchBetChildSite(), item);
                            if (base._isAutoBetting)
                            {
                                if (base._isToTrySimilarHDP | (!base._isToTrySimilarHDP & (asyncState.get_MatchBetParentSite().get_HDP() == str3)))
                                {
                                    this.WriteProgramLogger("Can Bet IBCBet.[INFO] " + str14);
                                    this.WriteBetlistLogger("Can Bet IBCBet. POST: " + str14);
                                    this.Bet(str14, item, asyncState.get_MatchChildSite(), asyncState.get_BetTarget());
                                }
                                else
                                {
                                    this.WriteProgramLogger("Cannot Bet IBCBet.[INFO] " + str14);
                                    this.WriteBetlistLogger(" Cannot Bet IBCBet. POST: " + str14);
                                    this.WriteBetlistLogger(SpiderFunction.GenerateDetailedMatchInfo(asyncState.get_MatchBetParentSite(), asyncState.get_MatchBetChildSite(), "Failed Ticket HDP/ODDS Change", "IBCAgent"));
                                    item.set_Description("HDP/Odds Change");
                                    base._objBetListFailed.Add(item);
                                    this.get__objBetQueueMonitor().SaveBetInfo(item.get_Description(), asyncState.get_MatchBetParentSite());
                                    this.get__objBetQueueMonitor().UpdateMatchStatus(asyncState.get_MatchBetParentSite().get_ID(), item.get_Description());
                                    base._isBetting = false;
                                    this.RaiseEventGetTicketComplete(base._strName, false, asyncState.get_BetTarget(), asyncState.get_MatchParentSite(), asyncState.get_MatchBetParentSite(), asyncState.get_MatchChildSite(), asyncState.get_MatchBetChildSite(), null);
                                }
                            }
                            else
                            {
                                this.WriteProgramLogger("Auto Bet OFF.");
                                item.set_Description("Auto Bet OFF.");
                                base._objBetListFailed.Add(item);
                                this.get__objBetQueueMonitor().UpdateMatchStatus(asyncState.get_MatchBetParentSite().get_ID(), item.get_Description());
                                base._isBetting = false;
                                this.RaiseEventGetTicketComplete(base._strName, false, asyncState.get_BetTarget(), asyncState.get_MatchParentSite(), asyncState.get_MatchBetParentSite(), asyncState.get_MatchChildSite(), asyncState.get_MatchBetChildSite(), null);
                            }
                        }
                        else
                        {
                            this.WriteProgramLogger("Exceed Per Match Limit!");
                            item.set_Description("Exceed Per Match Limit!");
                            base._objBetListFailed.Add(item);
                            this.get__objBetQueueMonitor().SaveBetInfo(item.get_Description(), asyncState.get_MatchBetParentSite());
                            this.get__objBetQueueMonitor().UpdateMatchStatus(asyncState.get_MatchBetParentSite().get_ID(), item.get_Description());
                            base._isBetting = false;
                            this.RaiseEventGetTicketComplete(base._strName, false, asyncState.get_BetTarget(), asyncState.get_MatchParentSite(), asyncState.get_MatchBetParentSite(), asyncState.get_MatchChildSite(), asyncState.get_MatchBetChildSite(), null);
                        }
                    }
                    else
                    {
                        this.WriteProgramLogger(string.Format("h Changed [{0}-{1}] -> [{2}-{3}]", new object[] { asyncState.get_MatchBetParentSite().get_HomeScore(), asyncState.get_MatchBetParentSite().get_AwayScore(), num3, num }));
                        item.set_Description(string.Format("Score Changed [{0}-{1}] -> [{2}-{3}]", new object[] { asyncState.get_MatchBetParentSite().get_HomeScore(), asyncState.get_MatchBetParentSite().get_AwayScore(), num3, num }));
                        base._objBetListFailed.Add(item);
                        this.get__objBetQueueMonitor().SaveBetInfo(item.get_Description(), asyncState.get_MatchBetParentSite());
                        this.get__objBetQueueMonitor().UpdateMatchStatus(asyncState.get_MatchBetParentSite().get_ID(), item.get_Description());
                        base._isBetting = false;
                        this.RaiseEventGetTicketComplete(base._strName, false, asyncState.get_BetTarget(), asyncState.get_MatchParentSite(), asyncState.get_MatchBetParentSite(), asyncState.get_MatchChildSite(), asyncState.get_MatchBetChildSite(), null);
                    }
                }
                else
                {
                    string str15 = "";
                    if (str13.Contains("suspend"))
                    {
                        str15 = "Cannot Bet...Match Suspended!";
                    }
                    else if (str13.Contains("'close'"))
                    {
                        str15 = "Cannot Bet...Match Closed!";
                    }
                    else
                    {
                        str15 = "Cannot Bet...Odds is Empty!";
                    }
                    base._isBetting = false;
                    this.WriteProgramLogger(str15);
                    this.get__objBetQueueMonitor().SaveBetInfo(str15, asyncState.get_MatchBetParentSite());
                    this.get__objBetQueueMonitor().UpdateMatchStatus(asyncState.get_MatchBetParentSite().get_ID(), str15);
                    this.RaiseEventGetTicketComplete(base._strName, false, asyncState.get_BetTarget(), asyncState.get_MatchParentSite(), asyncState.get_MatchBetParentSite(), asyncState.get_MatchChildSite(), asyncState.get_MatchBetChildSite(), null);
                }
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                base._isBetting = false;
                base._objErrorLogger.write(base._strName + ": EXCEPTION IN RequestCompleteTicketFromAgent: " + exception.Message);
                this.WriteProgramLogger(base._strName + ": EXCEPTION IN RequestCompleteTicketFromAgent: " + exception.Message);
                WebRequestStateEx2 ex2 = (WebRequestStateEx2)result1.AsyncState;
                this.get__objBetQueueMonitor().SaveBetInfo(exception.Message, ex2.get_MatchBetParentSite());
                this.RaiseEventGetTicketComplete(base._strName, true, ex2.get_BetTarget(), ex2.get_MatchParentSite(), ex2.get_MatchBetParentSite(), ex2.get_MatchChildSite(), ex2.get_MatchBetChildSite(), null);
                ProjectData.ClearProjectError();
            }
        }