Example #1
0
        public override bool BetsMain(ConfigurationStatus.SCPlan plan, ref string pHint)
        {
            bool flag = false;

            try
            {
                string betsLine    = this.GetBetsLine(plan.Type);
                string lotteryLine = this.GetLotteryLine(plan.Type, false);
                Dictionary <string, Dictionary <string, List <string> > > fNNumberDic = plan.FNNumberDic;
                foreach (string str3 in fNNumberDic.Keys)
                {
                    Dictionary <string, List <string> > dictionary2 = fNNumberDic[str3];
                    foreach (string str4 in dictionary2.Keys)
                    {
                        if (plan.IsMNState(str4, true))
                        {
                            flag  = true;
                            pHint = "投注成功";
                        }
                        else
                        {
                            List <string> pTNumberList            = plan.GetPTNumberList(dictionary2[str4]);
                            string        pResponsetext           = "";
                            string        play                    = plan.Play;
                            ConfigurationStatus.PlayBase playInfo = CommFunc.GetPlayInfo(play);
                            int    num   = plan.FNNumber(str4);
                            int    num2  = 2;
                            string prize = base.Prize;
                            string str8  = "";
                            Dictionary <string, string> dictionary3 = new Dictionary <string, string>();
                            if (CommFunc.CheckPlayIsRX(play))
                            {
                                string        current;
                                string        str10;
                                string        str11;
                                int           num3;
                                int           count;
                                List <string> list5;
                                List <string> pList = new List <string>();
                                Dictionary <string, string> dictionary4 = new Dictionary <string, string>();
                                List <string> list3 = CommFunc.SplitString(this.GetPlayMethodID(plan.Type, plan.Play), ";", -1);
                                using (List <string> .Enumerator enumerator3 = list3.GetEnumerator())
                                {
                                    while (enumerator3.MoveNext())
                                    {
                                        current            = enumerator3.Current;
                                        str10              = CommFunc.Join(current.Split(new char[] { '-' })[0], ",", -1);
                                        str11              = current.Split(new char[] { '-' })[1];
                                        dictionary4[str10] = str11;
                                    }
                                }
                                if (CommFunc.CheckPlayIsRXFS(play))
                                {
                                    List <string> itemList = new List <string>();
                                    num3 = 0;
                                    while (num3 < pTNumberList.Count)
                                    {
                                        string item = $"{num3}-{pTNumberList[num3]}";
                                        itemList.Add(item);
                                        num3++;
                                    }
                                    count = playInfo.IndexList.Count;
                                    list5 = CommFunc.GetCombinations(itemList, count, "|");
                                    num3  = 0;
                                    while (num3 < list5.Count)
                                    {
                                        string pStr = list5[num3];
                                        if (!pStr.Contains("*"))
                                        {
                                            List <string> list6 = new List <string>();
                                            List <string> list7 = new List <string>();
                                            List <string> list8 = CommFunc.SplitString(pStr, "|", -1);
                                            for (int i = 0; i < list8.Count; i++)
                                            {
                                                string str14 = list8[i];
                                                list6.Add(str14.Split(new char[] { '-' })[0]);
                                                list7.Add(str14.Split(new char[] { '-' })[1]);
                                            }
                                            str10 = CommFunc.Join(list6, ",");
                                            str11 = CommFunc.Join(list7, "|");
                                            dictionary3[str10] = str11;
                                        }
                                        num3++;
                                    }
                                }
                                else if (CommFunc.CheckPlayIsRXDS(play))
                                {
                                    List <string> list9 = new List <string>();
                                    num3 = 0;
                                    while (num3 < plan.RXWZ.Count)
                                    {
                                        string str15 = plan.RXWZ[num3].ToString();
                                        list9.Add(str15);
                                        num3++;
                                    }
                                    count = playInfo.IndexList.Count;
                                    list5 = CommFunc.GetCombinations(list9, count, ",");
                                    for (num3 = 0; num3 < list5.Count; num3++)
                                    {
                                        str10 = list5[num3];
                                        str11 = this.GetNumberList1(pTNumberList, play, null);
                                        if (CommFunc.CheckPlayIsZuX(play) && play.Contains("复式"))
                                        {
                                            str11 = CommFunc.Join(str11, "|", -1);
                                        }
                                        dictionary3[str10] = str11;
                                    }
                                }
                                int num6 = 1;
                                foreach (string str100 in dictionary3.Keys)
                                {
                                    current = dictionary4[str100];
                                    str11   = dictionary3[str100];
                                    List <string> list10 = CommFunc.SplitString(str100, ",", -1);
                                    List <string> list11 = new List <string>();
                                    foreach (string str16 in list10)
                                    {
                                        list11.Add((Convert.ToInt32(str16) + 1).ToString());
                                    }
                                    string str17 = CommFunc.Join(list11);
                                    int    num8  = num;
                                    if (CommFunc.CheckPlayIsRXFS(play))
                                    {
                                        count = playInfo.IndexList.Count;
                                        string playName = "";
                                        switch (count)
                                        {
                                        case 2:
                                            playName = "前二直选复式";
                                            break;

                                        case 3:
                                            playName = "前三直选复式";
                                            break;

                                        case 4:
                                            playName = "前四直选复式";
                                            break;
                                        }
                                        num8 = CommFunc.GetBetsCodeCount(CommFunc.SplitString(str11, "|", -1), playName, null);
                                    }
                                    else if (CommFunc.CheckPlayIsRXDS(play))
                                    {
                                        num8 = CommFunc.GetBetsCodeCount(pTNumberList, play, null);
                                    }
                                    string str19 = "%7B%22ball%22%3A%22{0}%22%2C%22viewBalls%22%3A%22%22%2C%22num%22%3A{1}%2C%22type%22%3A%22{2}%22%2C%22onePrice%22%3A%22{3}%22%2C%22moneyunit%22%3A{4}%2C%22multiple%22%3A{5}%2C%22prizeGroup%22%3A%22{6}%22%2C%22index%22%3A%22{7}%22%2C%22jsId%22%3A{8}%2C%22wayId%22%3A%22{9}%22%2C%22position%22%3A%22{10}%22%7D";
                                    str19 = string.Format(str19, new object[] { HttpUtility.UrlEncode(str11), num8, this.GetPlayString(play), num2, plan.Money / ((double)num2), Convert.ToInt32(plan.AutoTimes(str4, true)), prize, HttpUtility.UrlEncode(str100), num6, current, str17 });
                                    pList.Add(str19);
                                    num6++;
                                }
                                str8 = CommFunc.Join(pList, "%2C");
                                str8 = $"ballstr=%5B{str8}%5D";
                            }
                            else
                            {
                                str8 = "ballstr=%5B%7B%22jsId%22%3A{0}%2C%22wayId%22%3A{1}%2C%22ball%22%3A%22{2}%22%2C%22viewBalls%22%3A%22%22%2C%22num%22%3A{3}%2C%22type%22%3A%22{4}%22%2C%22onePrice%22%3A%22{5}%22%2C%22moneyunit%22%3A%22{6}%22%2C%22multiple%22%3A{7}%2C%22prizeGroup%22%3A%22{8}%22%7D%5D";
                                str8 = string.Format(str8, new object[] { "1", this.GetPlayMethodID(plan.Type, plan.Play), HttpUtility.UrlEncode(this.GetNumberList1(pTNumberList, plan.Play, null)), num, this.GetPlayString(plan.Play), num2, plan.Money / ((double)num2), Convert.ToInt32(plan.AutoTimes(str4, true)), prize });
                            }
                            string format = "gameId={0}&isTrace=0&traceWinStop=1&traceStopValue=1&orders%5B{1}%5D=1&amount={2}&{3}&orderstr=%7B%22{1}%22%3A{4}%7D";
                            format = string.Format(format, new object[] { this.GetBetsLotteryID(plan.Type), this.GetBetsExpect(plan.CurrentExpect, ""), plan.AutoTotalMoney(str4, true), str8, "1" });
                            HttpHelper.GetResponse(ref pResponsetext, betsLine, "POST", format, lotteryLine, base.BetsTime3, "UTF-8", true);
                            flag  = this.CheckReturn(pResponsetext, true);
                            pHint = this.GetReturn(pResponsetext);
                        }
                    }
                }
            }
            catch
            {
            }
            return(flag);
        }