Exemplo n.º 1
0
 public List<MatchNew> GenerateFullOddsFromText(string text1, bool flag1, bool flag2, bool flag3, bool flag4)
 {
     ArrayList list2 = new ArrayList();
     string str2 = "";
     int num2 = 0;
     List<MatchNew> list3 = new List<MatchNew>();
     int hour = 0;
     DateTime time = Conversions.ToDate(SpiderFunction.GetEarlyMarketStartTime(DateTime.Now));
     while (num2 > -1)
     {
         str2 = CommonFunction.substring(text1, num2, "Array('", "');", ref num2);
         if (str2 != string.Empty)
         {
             list2 = CommonFunction.SeperateStringBySymbol(str2, "','");
             if (list2.Count >= 0x1c)
             {
                 MatchNew item = new MatchNew();
                 item.set_FT_ID(Conversions.ToString(list2[0]));
                 item.set_UniqueID(item.get_FT_ID());
                 if (list2[1].ToString().ToLower().Contains("h/t"))
                 {
                     item.set_RunningMinutes(0x2d);
                     item.set_RunningStatus(EnumCollection.eRunningStatus.HT);
                     item.set_GameType(EnumCollection.eGameType.Running);
                     item.set_MatchTime(DateTime.Now);
                 }
                 else if (list2[1].ToString().Length <= 2)
                 {
                     item.set_RunningMinutes((int) Math.Round(Conversion.Val(RuntimeHelpers.GetObjectValue(list2[1]))));
                     item.set_RunningStatus(EnumCollection.eRunningStatus.Running);
                     item.set_GameType(EnumCollection.eGameType.Running);
                     item.set_MatchTime(DateTime.Now);
                 }
                 else if (list2[1].ToString().Length >= 15)
                 {
                     hour = (int) Math.Round(Conversion.Val(list2[1].ToString().Substring(9, 2)));
                     if ((list2[1].ToString().Substring(14, 1).ToLower() == "p") && ((hour >= 1) & (hour <= 11)))
                     {
                         hour += 12;
                     }
                     DateTime time3 = new DateTime(DateTime.Now.Year, (int) Math.Round(Conversion.Val(list2[1].ToString().Substring(0, 2))), (int) Math.Round(Conversion.Val(list2[1].ToString().Substring(3, 2))), hour, (int) Math.Round(Conversion.Val(list2[1].ToString().Substring(12, 2))), 0);
                     item.set_MatchTime(time3);
                     item.set_RunningStatus(EnumCollection.eRunningStatus.DeadBall);
                     item.set_GameType(EnumCollection.eGameType.Today);
                 }
                 if (item.get_GameType() != EnumCollection.eGameType.Running)
                 {
                     if (SpiderFunction.IsEarlyMarket(time, item.get_MatchTime()))
                     {
                         item.set_GameType(EnumCollection.eGameType.Early);
                     }
                 }
                 else
                 {
                     item.set_HomeScore((int) Math.Round(Conversion.Val(RuntimeHelpers.GetObjectValue(list2[0x12]))));
                     item.set_AwayScore((int) Math.Round(Conversion.Val(RuntimeHelpers.GetObjectValue(list2[0x13]))));
                 }
                 if (((item.get_GameType() == EnumCollection.eGameType.Running) & flag1) | ((item.get_GameType() != EnumCollection.eGameType.Running) & (flag2 | flag3)))
                 {
                     item.set_League(Conversions.ToString(list2[2]));
                     if (base._objLeagueListSelected.get_IsSelectAll() | this.IsLeagueExistedInSelectedList(item.get_League()))
                     {
                         int num3;
                         item.set_FTHDP_ID(Conversions.ToString(list2[3]));
                         item.set_FTOU_ID(Conversions.ToString(list2[4]));
                         item.set_HomeName(Conversions.ToString(list2[5]));
                         if (item.get_HomeName().Contains("/font"))
                         {
                             num3 = 0;
                             item.set_HomeName(CommonFunction.substring(item.get_HomeName(), 0, ">", "<", ref num3));
                         }
                         item.set_AwayName(Conversions.ToString(list2[6]));
                         if (item.get_AwayName().Contains("/font"))
                         {
                             num3 = 0;
                             item.set_AwayName(CommonFunction.substring(item.get_AwayName(), 0, ">", "<", ref num3));
                         }
                         item.set_FTHDP(Conversions.ToString(list2[8]));
                         if (item.get_FTHDP() != string.Empty)
                         {
                             item.set_FTHDP(SportBookFunction.ConvertHDPDashedTypeWithZero(item.get_FTHDP().Replace(" ", "").Replace("/", "-")));
                         }
                         if (item.get_FTHDP() == "0.0")
                         {
                             item.set_FTAwayColor(Color.Blue);
                             item.set_FTHomeColor(Color.Blue);
                         }
                         else if (Operators.ConditionalCompareObjectEqual(list2[7], "H", false))
                         {
                             item.set_FTAwayColor(Color.Blue);
                             item.set_FTHomeColor(Color.Red);
                         }
                         else
                         {
                             item.set_FTAwayColor(Color.Red);
                             item.set_FTHomeColor(Color.Blue);
                         }
                         item.set_HalfAwayColor(item.get_FTAwayColor());
                         item.set_HalfHomeColor(item.get_FTHomeColor());
                         object[] arguments = new object[1];
                         ArrayList list4 = list2;
                         num3 = 9;
                         arguments[0] = RuntimeHelpers.GetObjectValue(list4[num3]);
                         object[] objArray2 = arguments;
                         bool[] copyBack = new bool[] { true };
                         if (copyBack[0])
                         {
                             list4[num3] = RuntimeHelpers.GetObjectValue(objArray2[0]);
                         }
                         item.set_FT_HomeOddsString(Conversions.ToString(NewLateBinding.LateGet(null, typeof(SportBookFunction), "ConvertHKToMalayOdds", objArray2, null, null, copyBack)));
                         objArray2 = new object[1];
                         list4 = list2;
                         num3 = 10;
                         objArray2[0] = RuntimeHelpers.GetObjectValue(list4[num3]);
                         arguments = objArray2;
                         copyBack = new bool[] { true };
                         if (copyBack[0])
                         {
                             list4[num3] = RuntimeHelpers.GetObjectValue(arguments[0]);
                         }
                         item.set_FT_AwayOddsString(Conversions.ToString(NewLateBinding.LateGet(null, typeof(SportBookFunction), "ConvertHKToMalayOdds", arguments, null, null, copyBack)));
                         if (item.get_GameType() == EnumCollection.eGameType.Running)
                         {
                             item.set_FT_HomeBetLink(Conversions.ToString(Operators.ConcatenateObject(Operators.ConcatenateObject(Operators.ConcatenateObject((((base._strRootURL + "/app/member/FT_order/FT_order_re.php?gid=" + item.get_FT_ID()) + "&uid=" + this._strUID) + "&type=H" + "&gnum=") + item.get_FTHDP_ID() + "&strong=", list2[7]), "&odd_f_type="), this._strOddFType)));
                             item.set_FT_AwayBetLink(Conversions.ToString(Operators.ConcatenateObject(Operators.ConcatenateObject(Operators.ConcatenateObject((((base._strRootURL + "/app/member/FT_order/FT_order_re.php?gid=" + item.get_FT_ID()) + "&uid=" + this._strUID) + "&type=C" + "&gnum=") + item.get_FTOU_ID() + "&strong=", list2[7]), "&odd_f_type="), this._strOddFType)));
                         }
                         else
                         {
                             item.set_FT_HomeBetLink(Conversions.ToString(Operators.ConcatenateObject(Operators.ConcatenateObject(Operators.ConcatenateObject((((base._strRootURL + "/app/member/FT_order/FT_order_r.php?gid=" + item.get_FT_ID()) + "&uid=" + this._strUID) + "&type=H" + "&gnum=") + item.get_FTHDP_ID() + "&strong=", list2[7]), "&odd_f_type="), this._strOddFType)));
                             item.set_FT_AwayBetLink(Conversions.ToString(Operators.ConcatenateObject(Operators.ConcatenateObject(Operators.ConcatenateObject((((base._strRootURL + "/app/member/FT_order/FT_order_r.php?gid=" + item.get_FT_ID()) + "&uid=" + this._strUID) + "&type=C" + "&gnum=") + item.get_FTOU_ID() + "&strong=", list2[7]), "&odd_f_type="), this._strOddFType)));
                         }
                         item.set_FTOU(Conversions.ToString(list2[11]));
                         if (item.get_FTOU() != string.Empty)
                         {
                             item.set_FTOU(SportBookFunction.ConvertHDPDashedTypeWithZero(item.get_FTOU().Substring(1, item.get_FTOU().Length - 1).Replace(" ", "").Replace("/", "-")));
                         }
                         objArray2 = new object[1];
                         list4 = list2;
                         num3 = 13;
                         objArray2[0] = RuntimeHelpers.GetObjectValue(list4[num3]);
                         arguments = objArray2;
                         copyBack = new bool[] { true };
                         if (copyBack[0])
                         {
                             list4[num3] = RuntimeHelpers.GetObjectValue(arguments[0]);
                         }
                         item.set_FT_UnderOddsString(Conversions.ToString(NewLateBinding.LateGet(null, typeof(SportBookFunction), "ConvertHKToMalayOdds", arguments, null, null, copyBack)));
                         objArray2 = new object[1];
                         list4 = list2;
                         num3 = 14;
                         objArray2[0] = RuntimeHelpers.GetObjectValue(list4[num3]);
                         arguments = objArray2;
                         copyBack = new bool[] { true };
                         if (copyBack[0])
                         {
                             list4[num3] = RuntimeHelpers.GetObjectValue(arguments[0]);
                         }
                         item.set_FT_OverOddsString(Conversions.ToString(NewLateBinding.LateGet(null, typeof(SportBookFunction), "ConvertHKToMalayOdds", arguments, null, null, copyBack)));
                         if (item.get_GameType() == EnumCollection.eGameType.Running)
                         {
                             item.set_FT_UnderBetLink(base._strRootURL + "/app/member/FT_order/FT_order_rou.php?gid=" + item.get_FT_ID() + "&uid=" + this._strUID + "&type=H&gnum=" + item.get_FTHDP_ID() + "&odd_f_type=" + this._strOddFType);
                             item.set_FT_OverBetLink(base._strRootURL + "/app/member/FT_order/FT_order_rou.php?gid=" + item.get_FT_ID() + "&uid=" + this._strUID + "&type=C&gnum=" + item.get_FTOU_ID() + "&odd_f_type=" + this._strOddFType);
                         }
                         else
                         {
                             item.set_FT_UnderBetLink(base._strRootURL + "/app/member/FT_order/FT_order_ou.php?gid=" + item.get_FT_ID() + "&uid=" + this._strUID + "&type=H&gnum=" + item.get_FTHDP_ID() + "&odd_f_type=" + this._strOddFType);
                             item.set_FT_OverBetLink(base._strRootURL + "/app/member/FT_order/FT_order_ou.php?gid=" + item.get_FT_ID() + "&uid=" + this._strUID + "&type=C&gnum=" + item.get_FTOU_ID() + "&odd_f_type=" + this._strOddFType);
                         }
                         if (flag4)
                         {
                             if ((item.get_GameType() == EnumCollection.eGameType.Running) | (list2.Count == 0x2b))
                             {
                                 item.set_GameType(EnumCollection.eGameType.Running);
                                 item.set_Half_ID(Conversions.ToString(list2[20]));
                                 item.set_HalfHDP(Conversions.ToString(list2[0x16]));
                                 if (item.get_HalfHDP() != string.Empty)
                                 {
                                     item.set_HalfHDP(SportBookFunction.ConvertHDPDashedTypeWithZero(item.get_HalfHDP().Replace(" ", "").Replace("/", "-")));
                                 }
                                 objArray2 = new object[1];
                                 list4 = list2;
                                 num3 = 0x17;
                                 objArray2[0] = RuntimeHelpers.GetObjectValue(list4[num3]);
                                 arguments = objArray2;
                                 copyBack = new bool[] { true };
                                 if (copyBack[0])
                                 {
                                     list4[num3] = RuntimeHelpers.GetObjectValue(arguments[0]);
                                 }
                                 item.set_Half_HomeOddsString(Conversions.ToString(NewLateBinding.LateGet(null, typeof(SportBookFunction), "ConvertHKToMalayOdds", arguments, null, null, copyBack)));
                                 objArray2 = new object[1];
                                 list4 = list2;
                                 num3 = 0x18;
                                 objArray2[0] = RuntimeHelpers.GetObjectValue(list4[num3]);
                                 arguments = objArray2;
                                 copyBack = new bool[] { true };
                                 if (copyBack[0])
                                 {
                                     list4[num3] = RuntimeHelpers.GetObjectValue(arguments[0]);
                                 }
                                 item.set_Half_AwayOddsString(Conversions.ToString(NewLateBinding.LateGet(null, typeof(SportBookFunction), "ConvertHKToMalayOdds", arguments, null, null, copyBack)));
                                 item.set_Half_HomeBetLink(Conversions.ToString(Operators.ConcatenateObject(Operators.ConcatenateObject(Operators.ConcatenateObject((((base._strRootURL + "/app/member/FT_order/FT_order_hre.php?gid=" + item.get_Half_ID()) + "&uid=" + this._strUID) + "&type=H" + "&gnum=") + item.get_FTHDP_ID() + "&strong=", list2[0x15]), "&odd_f_type="), this._strOddFType)));
                                 item.set_Half_AwayBetLink(Conversions.ToString(Operators.ConcatenateObject(Operators.ConcatenateObject(Operators.ConcatenateObject((((base._strRootURL + "/app/member/FT_order/FT_order_hre.php?gid=" + item.get_Half_ID()) + "&uid=" + this._strUID) + "&type=C" + "&gnum=") + item.get_FTOU_ID() + "&strong=", list2[0x15]), "&odd_f_type="), this._strOddFType)));
                                 item.set_HalfOU(Conversions.ToString(list2[0x19]));
                                 if (item.get_HalfOU() != string.Empty)
                                 {
                                     item.set_HalfOU(SportBookFunction.ConvertHDPDashedTypeWithZero(item.get_HalfOU().Substring(1, item.get_HalfOU().Length - 1).Replace(" ", "").Replace("/", "-")));
                                 }
                                 objArray2 = new object[1];
                                 list4 = list2;
                                 num3 = 0x1b;
                                 objArray2[0] = RuntimeHelpers.GetObjectValue(list4[num3]);
                                 arguments = objArray2;
                                 copyBack = new bool[] { true };
                                 if (copyBack[0])
                                 {
                                     list4[num3] = RuntimeHelpers.GetObjectValue(arguments[0]);
                                 }
                                 item.set_Half_UnderOddsString(Conversions.ToString(NewLateBinding.LateGet(null, typeof(SportBookFunction), "ConvertHKToMalayOdds", arguments, null, null, copyBack)));
                                 objArray2 = new object[1];
                                 list4 = list2;
                                 num3 = 0x1c;
                                 objArray2[0] = RuntimeHelpers.GetObjectValue(list4[num3]);
                                 arguments = objArray2;
                                 copyBack = new bool[] { true };
                                 if (copyBack[0])
                                 {
                                     list4[num3] = RuntimeHelpers.GetObjectValue(arguments[0]);
                                 }
                                 item.set_Half_OverOddsString(Conversions.ToString(NewLateBinding.LateGet(null, typeof(SportBookFunction), "ConvertHKToMalayOdds", arguments, null, null, copyBack)));
                                 item.set_Half_UnderBetLink(base._strRootURL + "/app/member/FT_order/FT_order_hrou.php?gid=" + item.get_Half_ID() + "&uid=" + this._strUID + "&type=H&gnum=" + item.get_FTHDP_ID() + "&odd_f_type=" + this._strOddFType);
                                 item.set_Half_OverBetLink(base._strRootURL + "/app/member/FT_order/FT_order_hrou.php?gid=" + item.get_Half_ID() + "&uid=" + this._strUID + "&type=C&gnum=" + item.get_FTOU_ID() + "&odd_f_type=" + this._strOddFType);
                             }
                             else
                             {
                                 item.set_Half_ID(Conversions.ToString(list2[0x16]));
                                 item.set_HalfHDP(Conversions.ToString(list2[0x18]));
                                 if (item.get_HalfHDP() != string.Empty)
                                 {
                                     item.set_HalfHDP(SportBookFunction.ConvertHDPDashedTypeWithZero(item.get_HalfHDP().Replace(" ", "").Replace("/", "-")));
                                 }
                                 objArray2 = new object[1];
                                 list4 = list2;
                                 num3 = 0x19;
                                 objArray2[0] = RuntimeHelpers.GetObjectValue(list4[num3]);
                                 arguments = objArray2;
                                 copyBack = new bool[] { true };
                                 if (copyBack[0])
                                 {
                                     list4[num3] = RuntimeHelpers.GetObjectValue(arguments[0]);
                                 }
                                 item.set_Half_HomeOddsString(Conversions.ToString(NewLateBinding.LateGet(null, typeof(SportBookFunction), "ConvertHKToMalayOdds", arguments, null, null, copyBack)));
                                 objArray2 = new object[1];
                                 list4 = list2;
                                 num3 = 0x1a;
                                 objArray2[0] = RuntimeHelpers.GetObjectValue(list4[num3]);
                                 arguments = objArray2;
                                 copyBack = new bool[] { true };
                                 if (copyBack[0])
                                 {
                                     list4[num3] = RuntimeHelpers.GetObjectValue(arguments[0]);
                                 }
                                 item.set_Half_AwayOddsString(Conversions.ToString(NewLateBinding.LateGet(null, typeof(SportBookFunction), "ConvertHKToMalayOdds", arguments, null, null, copyBack)));
                                 item.set_Half_HomeBetLink(Conversions.ToString(Operators.ConcatenateObject(Operators.ConcatenateObject(Operators.ConcatenateObject((((base._strRootURL + "/app/member/FT_order/FT_order_hr.php?gid=" + item.get_Half_ID()) + "&uid=" + this._strUID) + "&type=H" + "&gnum=") + item.get_FTHDP_ID() + "&strong=", list2[0x17]), "&odd_f_type="), this._strOddFType)));
                                 item.set_Half_AwayBetLink(Conversions.ToString(Operators.ConcatenateObject(Operators.ConcatenateObject(Operators.ConcatenateObject((((base._strRootURL + "/app/member/FT_order/FT_order_hr.php?gid=" + item.get_Half_ID()) + "&uid=" + this._strUID) + "&type=C" + "&gnum=") + item.get_FTOU_ID() + "&strong=", list2[0x17]), "&odd_f_type="), this._strOddFType)));
                                 item.set_HalfOU(Conversions.ToString(list2[0x1b]));
                                 if (item.get_HalfOU() != string.Empty)
                                 {
                                     item.set_HalfOU(SportBookFunction.ConvertHDPDashedTypeWithZero(item.get_HalfOU().Substring(1, item.get_HalfOU().Length - 1).Replace(" ", "").Replace("/", "-")));
                                 }
                                 objArray2 = new object[1];
                                 list4 = list2;
                                 num3 = 0x1d;
                                 objArray2[0] = RuntimeHelpers.GetObjectValue(list4[num3]);
                                 arguments = objArray2;
                                 copyBack = new bool[] { true };
                                 if (copyBack[0])
                                 {
                                     list4[num3] = RuntimeHelpers.GetObjectValue(arguments[0]);
                                 }
                                 item.set_Half_UnderOddsString(Conversions.ToString(NewLateBinding.LateGet(null, typeof(SportBookFunction), "ConvertHKToMalayOdds", arguments, null, null, copyBack)));
                                 objArray2 = new object[1];
                                 list4 = list2;
                                 num3 = 30;
                                 objArray2[0] = RuntimeHelpers.GetObjectValue(list4[num3]);
                                 arguments = objArray2;
                                 copyBack = new bool[] { true };
                                 if (copyBack[0])
                                 {
                                     list4[num3] = RuntimeHelpers.GetObjectValue(arguments[0]);
                                 }
                                 item.set_Half_OverOddsString(Conversions.ToString(NewLateBinding.LateGet(null, typeof(SportBookFunction), "ConvertHKToMalayOdds", arguments, null, null, copyBack)));
                                 item.set_Half_UnderBetLink(base._strRootURL + "/app/member/FT_order/FT_order_hou.php?gid=" + item.get_Half_ID() + "&uid=" + this._strUID + "&type=H&gnum=" + item.get_FTHDP_ID() + "&odd_f_type=" + this._strOddFType);
                                 item.set_Half_OverBetLink(base._strRootURL + "/app/member/FT_order/FT_order_hou.php?gid=" + item.get_Half_ID() + "&uid=" + this._strUID + "&type=C&gnum=" + item.get_FTOU_ID() + "&odd_f_type=" + this._strOddFType);
                             }
                         }
                         item.set_Website("SingBet");
                         item.set_Type(EnumCollection.eMatchType.Match);
                         item.set_GlobalLastUpdate(DateTime.Now);
                         list3.Add(item);
                     }
                 }
             }
         }
     }
     return list3;
 }
Exemplo n.º 2
0
        public void GetTicketAndBetFromAgent(MatchBetNew new4, MatchNew new1, EnumCollection.eBetTarget target1, int num1, AgentToClientBet bet1)
        {
            MatchBetNew new3 = new MatchBetNew();
            MatchBetNew new2 = new MatchBetNew();
            try
            {
                string requestUriString = "";
                string str5 = "";
                string str = "";
                string str3 = "";
                string str4 = "";
                base._isBetting = true;
                base._datTicketStart = DateTime.Now;
                requestUriString = base._strRootURL + "/BetProcess_Data.aspx";
                switch (target1)
                {
                    case EnumCollection.eBetTarget.FT_Home:
                        str = new1.get_FTHDP_ID();
                        str3 = new1.get_FT_HomeOddsString();
                        str4 = "h";
                        break;

                    case EnumCollection.eBetTarget.FT_Away:
                        str = new1.get_FTHDP_ID();
                        str3 = new1.get_FT_AwayOddsString();
                        str4 = "a";
                        break;

                    case EnumCollection.eBetTarget.FT_Over:
                        str = new1.get_FTOU_ID();
                        str3 = new1.get_FT_OverOddsString();
                        str4 = "h";
                        break;

                    case EnumCollection.eBetTarget.FT_Under:
                        str = new1.get_FTOU_ID();
                        str3 = new1.get_FT_UnderOddsString();
                        str4 = "a";
                        break;

                    case EnumCollection.eBetTarget.Half_Home:
                        str = new1.get_HalfHDP_ID();
                        str3 = new1.get_Half_HomeOddsString();
                        str4 = "h";
                        break;

                    case EnumCollection.eBetTarget.Half_Away:
                        str = new1.get_HalfHDP_ID();
                        str3 = new1.get_Half_AwayOddsString();
                        str4 = "a";
                        break;

                    case EnumCollection.eBetTarget.Half_Over:
                        str = new1.get_HalfOU_ID();
                        str3 = new1.get_Half_OverOddsString();
                        str4 = "h";
                        break;

                    case EnumCollection.eBetTarget.Half_Under:
                        str = new1.get_HalfOU_ID();
                        str3 = new1.get_Half_UnderOddsString();
                        str4 = "a";
                        break;
                    // add 1x2
                    case EnumCollection.eBetTarget.FT_1:
                        str = new1.get_FT1X2_ID();
                        str3 = new1.get_FT_1X2HomeOddsString().ToString();
                        str4 = "1";
                        break;
                    case EnumCollection.eBetTarget.FT_X:
                        str = new1.get_FT1X2_ID();
                        str3 = new1.get_FT_1X2AwayOddsString().ToString();
                        str4 = "X";
                        break;
                    case EnumCollection.eBetTarget.FT_2:
                        str = new1.get_FT1X2_ID();
                        str3 = new1.get_FT_1X2DrawOddsString().ToString();
                        str4 = "2";
                        break;
                    case EnumCollection.eBetTarget.Half_1:
                        str = new1.get_Half1X2_ID();
                        str3 = new1.get_Half_1X2HomeOddsString().ToString();
                        str4 = "1";
                        break;
                    case EnumCollection.eBetTarget.Half_X:
                        str = new1.get_Half1X2_ID();
                        str3 = new1.get_Half_1X2AwayOddsString().ToString(); ;
                        str4 = "X";
                        break;
                    case EnumCollection.eBetTarget.Half_2:
                        str = new1.get_Half1X2_ID();
                        str3 = new1.get_Half_1X2DrawOddsString().ToString(); ;
                        str4 = "2";
                        break;
                }
                str5 = "bp_Match=" + str + "_" + str4 + "_" + str3 + "&bp_ssport=&chk_BettingChange=4";
                // Add Andy 添加新值 2011.08.08
                StringBuilder sb = new StringBuilder(str5);
                sb.Append("&").Append(this.key);
                sb.Append("=").Append(this.value);
                str5 = sb.ToString();
                // End Andy

                new3 = new4;
                new2 = new1.GenerateMatchBet(target1);
                HttpWebRequest request = (HttpWebRequest)WebRequest.Create(requestUriString);
                request.Timeout = 0x7530;
                request.Method = "POST";
                request.UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.16) Gecko/2009120208 Firefox/3.0.16";
                request.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8";
                request.Headers.Add("Accept-Language", "en-gb,en;q=0.5");
                request.Headers.Add("Accept-Encoding", "gzip, deflate");
                request.Headers.Add("Accept-Charset", "ISO-8859-1,utf-8;q=0.7,*;q=0.7");
                request.Headers["Cookie"] = base._objCookieList.ToString();
                request.Referer = base._strRootURL + "/LeftAllInOne.aspx";
                request.ContentType = "application/x-www-form-urlencoded";
                request.ContentLength = str5.Length;

                base._objBetListLogger.write("POST: " + str5);
                this.WriteProgramLogger("TWESTESST2.0: " + request.Address.ToString());
                Stream stream = request.GetRequestStream();
                byte[] bytes = Encoding.UTF8.GetBytes(str5);
                stream.Write(bytes, 0, str5.Length);
                stream.Close();
                this.WriteProgramLogger("TWESTESST2.1: " + request.Address.ToString());

                WebRequestStateEx2 state = new WebRequestStateEx2("GetTicketAndBetFromAgent", request, str5, num1, new3.get_BetType(), target1, new MatchNew(), new3, new1, new2, bet1);
                ThreadPool.RegisterWaitForSingleObject(request.BeginGetRequestStream(new AsyncCallback(this.RequestCompleteTicketFromAgent), state).AsyncWaitHandle, new WaitOrTimerCallback(this.TimeoutCallBackEx2), state, 0x7530, true);
                base.allDone.WaitOne();
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                base._isBetting = false;
                base._objErrorLogger.write(base._strName + ": EXCEPTION IN GetTicketAndBetFromAgent: " + exception.Message);
                this.WriteProgramLogger(base._strName + ": EXCEPTION IN GetTicketAndBetFromAgent: " + exception.Message);
                this.get__objBetQueueMonitor().SaveBetInfo(exception.Message, new4);
                this.RaiseEventGetTicketComplete(base._strName, false, target1, new MatchNew(), new3, new1, new2, null);
                ProjectData.ClearProjectError();
            }
        }
Exemplo n.º 3
0
        public void GetTicketAndBetFromAgent(MatchBetNew new4, MatchNew new1, EnumCollection.eBetTarget target1, int num1, AgentToClientBet bet1)
        {
            MatchBetNew new3 = new MatchBetNew();
            MatchBetNew new2 = new MatchBetNew();
            try
            {
                string format = "";
                string str5 = "";
                base._isBetting = true;
                base._datTicketStart = DateTime.Now;
                format = base._strRootURL + "/webroot/restricted/plain/ticket.aspx?{0}&loginname=" + this._strLoginName;
                switch (target1)
                {
                    case EnumCollection.eBetTarget.FT_Home:
                        str5 = "id=" + new1.get_FTHDP_ID() + "&odds=" + new1.get_FT_HomeOdds().ToString() + "&op=h&hdpType=" + new1.get_FT_HomeBetLink() + "&isor=0&hidRefreshOdds=&hidAuto=";
                        break;

                    case EnumCollection.eBetTarget.FT_Away:
                        str5 = "id=" + new1.get_FTHDP_ID() + "&odds=" + new1.get_FT_AwayOdds().ToString() + "&op=a&hdpType=" + new1.get_FT_AwayBetLink() + "&isor=0&hidRefreshOdds=&hidAuto=";
                        break;

                    case EnumCollection.eBetTarget.FT_Over:
                        str5 = "id=" + new1.get_FTOU_ID() + "&odds=" + new1.get_FT_OverOdds().ToString() + "&op=h&hdpType=0&isor=0&hidRefreshOdds=&hidAuto=";
                        break;

                    case EnumCollection.eBetTarget.FT_Under:
                        str5 = "id=" + new1.get_FTOU_ID() + "&odds=" + new1.get_FT_UnderOdds().ToString() + "&op=a&hdpType=0&isor=0&hidRefreshOdds=&hidAuto=";
                        break;

                    case EnumCollection.eBetTarget.FT_1:
                        str5 = "id=" + new1.get_FT1X2_ID() + "&odds=" + new1.get_FT_1X2HomeOddsString() + "&op=1&hdpType=0&isor=0&hidRefreshOdds=&hidAuto=";
                        break;

                    case EnumCollection.eBetTarget.FT_X:
                        str5 = "id=" + new1.get_FT1X2_ID() + "&odds=" + new1.get_FT_1X2DrawOddsString() + "&op=x&hdpType=0&isor=0&hidRefreshOdds=&hidAuto=";
                        break;

                    case EnumCollection.eBetTarget.FT_2:
                        str5 = "id=" + new1.get_FT1X2_ID() + "&odds=" + new1.get_FT_1X2AwayOddsString() + "&op=2&hdpType=0&isor=0&hidRefreshOdds=&hidAuto=";
                        break;

                    case EnumCollection.eBetTarget.Half_Home:
                        str5 = "id=" + new1.get_HalfHDP_ID() + "&odds=" + new1.get_Half_HomeOdds().ToString() + "&op=h&hdpType=" + new1.get_Half_HomeBetLink() + "&isor=0&hidRefreshOdds=&hidAuto=";
                        break;

                    case EnumCollection.eBetTarget.Half_Away:
                        str5 = "id=" + new1.get_HalfHDP_ID() + "&odds=" + new1.get_Half_AwayOdds().ToString() + "&op=a&hdpType=" + new1.get_Half_AwayBetLink() + "&isor=0&hidRefreshOdds=&hidAuto=";
                        break;

                    case EnumCollection.eBetTarget.Half_Over:
                        str5 = "id=" + new1.get_HalfOU_ID() + "&odds=" + new1.get_Half_OverOdds().ToString() + "&op=h&hdpType=0&isor=0&hidRefreshOdds=&hidAuto=";
                        break;

                    case EnumCollection.eBetTarget.Half_Under:
                        str5 = "id=" + new1.get_HalfOU_ID() + "&odds=" + new1.get_Half_UnderOdds().ToString() + "&op=a&hdpType=0&isor=0&hidRefreshOdds=&hidAuto=";
                        break;
                    case EnumCollection.eBetTarget.Half_1:
                        str5 = "id=" + new1.get_Half1X2_ID() + "&odds=" + new1.get_Half_1X2HomeOddsString() + "&op=1&hdpType=0&isor=0&hidRefreshOdds=&hidAuto=";
                        break;

                    case EnumCollection.eBetTarget.Half_X:
                        str5 = "id=" + new1.get_Half1X2_ID() + "&odds=" + new1.get_Half_1X2DrawOddsString() + "&op=x&hdpType=0&isor=0&hidRefreshOdds=&hidAuto=";
                        break;

                    case EnumCollection.eBetTarget.Half_2:
                        str5 = "id=" + new1.get_Half1X2_ID() + "&odds=" + new1.get_Half_1X2AwayOddsString() + "&op=2&hdpType=0&isor=0&hidRefreshOdds=&hidAuto=";
                        break;

                }
                string url = string.Format(format, str5);
                new3 = new4;
                new2 = new1.GenerateMatchBet(target1);
                HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
                request.Timeout = 0x7530;
                request.Method = "GET";
                request.UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.16) Gecko/2009120208 Firefox/3.0.16";
                request.Headers["Cookie"] = base._objCookieList.ToString();
                request.ContentType = "application/x-www-form-urlencoded";
                //request.KeepAlive = true;

                this.WriteProgramLogger("POST: " + url);
                base._objBetListLogger.write("POST: " + str5);
                WebRequestStateEx2 state = new WebRequestStateEx2("GetTicketAndBetFromAgent", request, str5, num1, new3.get_BetType(), target1, new MatchNew(), new3, new1, new2, bet1);
                ThreadPool.RegisterWaitForSingleObject(request.BeginGetResponse(new AsyncCallback(this.RequestCompleteTicketFromAgent), state).AsyncWaitHandle, new WaitOrTimerCallback(this.TimeoutCallBackEx2), state, 0x7530, true);
                this.allDone.WaitOne();
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                base._isBetting = false;
                base._objErrorLogger.write(base._strName + ": EXCEPTION IN GetTicketAndBetFromAgent: " + exception.Message);
                this.WriteProgramLogger(base._strName + ": EXCEPTION IN GetTicketAndBetFromAgent: " + exception.Message);
                this.RaiseEventGetTicketComplete(base._strName, false, target1, new MatchNew(), new3, new1, new2, null);
                this.get__objBetQueueMonitor().SaveBetInfo(exception.Message, new4);
                ProjectData.ClearProjectError();
            }
        }
Exemplo n.º 4
0
        private void GetTicketAndBetFromAgent(MatchBetNew new1, MatchNew new4, EnumCollection.eBetTarget target1, int num1, AgentToClientBet bet1)
        {
            MatchBetNew new3 = new MatchBetNew();
            MatchBetNew new2 = new MatchBetNew();
            try
            {
                string requestUriString = "";
                string str5 = "";
                base._isBetting = true;
                base._datTicketStart = DateTime.Now;
                requestUriString = base._strRootURL + "/english/index.php?p=bettingback&b=soccer|";
                if (new1.get_GameType() == EnumCollection.eGameType.Running)
                {
                    str5 = "r";
                }
                switch (target1)
                {
                    case EnumCollection.eBetTarget.FT_Home:
                        requestUriString = requestUriString + string.Format("{2}ah|{0}|a||||{1}", new4.get_FTHDP_ID(), this._strOddsText, str5);
                        break;

                    case EnumCollection.eBetTarget.FT_Away:
                        requestUriString = requestUriString + string.Format("{2}ah|{0}|b||||{1}", new4.get_FTHDP_ID(), this._strOddsText, str5);
                        break;

                    case EnumCollection.eBetTarget.FT_Over:
                        requestUriString = requestUriString + string.Format("{2}ou|{0}|over||||{1}", new4.get_FTOU_ID(), this._strOddsText, str5);
                        break;

                    case EnumCollection.eBetTarget.FT_Under:
                        requestUriString = requestUriString + string.Format("{2}ou|{0}|under||||{1}", new4.get_FTOU_ID(), this._strOddsText, str5);
                        break;

                    case EnumCollection.eBetTarget.Half_Home:
                        requestUriString = requestUriString + string.Format("{2}ahht|{0}|a||||{1}", new4.get_HalfHDP_ID(), this._strOddsText, str5);
                        break;

                    case EnumCollection.eBetTarget.Half_Away:
                        requestUriString = requestUriString + string.Format("{2}ahht|{0}|b||||{1}", new4.get_HalfHDP_ID(), this._strOddsText, str5);
                        break;

                    case EnumCollection.eBetTarget.Half_Over:
                        requestUriString = requestUriString + string.Format("{2}ouht|{0}|over||||{1}", new4.get_HalfOU_ID(), this._strOddsText, str5);
                        break;

                    case EnumCollection.eBetTarget.Half_Under:
                        requestUriString = requestUriString + string.Format("{2}ouht|{0}|under||||{1}", new4.get_HalfOU_ID(), this._strOddsText, str5);
                        break;
                }
                new3 = new1;
                new2 = new4.GenerateMatchBet(target1);
                HttpWebRequest request = (HttpWebRequest) WebRequest.Create(requestUriString);
                request.Timeout = 0x2710;
                request.Method = "GET";
                request.UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.16) Gecko/2009120208 Firefox/3.0.16";
                request.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8";
                request.Headers.Add("Accept-Language", "en-gb,en;q=0.5");
                request.Headers.Add("Accept-Encoding", "gzip, deflate");
                request.Headers.Add("Accept-Charset", "ISO-8859-1,utf-8;q=0.7,*;q=0.7");
                request.Headers["Cookie"] = base._objCookieList.ToString();
                request.Referer = base._strRootURL + "/english/index.php?p=user_main";
                request.ContentLength = 0L;
                request.KeepAlive = true;
                WebRequestStateEx2 state = new WebRequestStateEx2("GetTicketAndBetFromAgent", request, "", num1, new3.get_BetType(), target1, new MatchNew(), new3, new4, new2, bet1);
                ThreadPool.RegisterWaitForSingleObject(request.BeginGetResponse(new AsyncCallback(this.RequestCompleteTicketFromAgent), state).AsyncWaitHandle, new WaitOrTimerCallback(this.TimeoutCallBackEx2), state, 0x2710, true);
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                base._isBetting = false;
                base._objErrorLogger.write(base._strName + ": EXCEPTION IN GetTicketAndBetFromAgent: " + exception.Message);
                this.WriteProgramLogger(base._strName + ": EXCEPTION IN GetTicketAndBetFromAgent: " + exception.Message);
                this.RaiseEventGetTicketComplete(base._strName, false, target1, new MatchNew(), new3, new4, new2, null);
                ProjectData.ClearProjectError();
            }
        }