예제 #1
0
파일: IBCBet.cs 프로젝트: yjtang/AutoBws
 public override List<MatchBetNew> GenerateServerBetListFullFromText(string text1)
 {
     int num = 0;
     string str3 = "";
     string str2 = "";
     List<string> list2 = new List<string>();
     List<MatchBetNew> list3 = new List<MatchBetNew>();
     list2 = CommonFunction.SeperateStringBySymbol2(text1, "<tr valign=\"top");
     foreach (string str in list2)
     {
         MatchBetNew item = new MatchBetNew();
         num = 0;
         str2 = str.ToLower();
         item.set_ReceiptID(CommonFunction.substring2(str2, num, "ref no:", "</", ref num).Trim().ToUpper());
         item.set_SelectedMatch(CommonFunction.substring2(str2, num, "<span ", ">", "</", ref num).Trim());
         str3 = CommonFunction.substring2(str2, num, "<span ", ">", "</", ref num).Replace("<b>", "").Replace("</b>", "").Trim();
         item.set_HDP(SportBookFunction.ConvertHDPType(str3));
         List<string> list4 = CommonFunction.SeperateStringBySymbol2(CommonFunction.substring2(str2, num, "</strong>", "/>", "<", ref num).Trim(), "-vs-");
         if (list4.Count == 2)
         {
             item.set_HomeName(list4[0].Trim());
             item.set_AwayName(list4[1].Trim());
             item.set_OddsString(CommonFunction.substring2(str2, num, "oddsclass", ">", "</", ref num).Trim());
             if ((((item.get_ReceiptID() != string.Empty) & (item.get_HomeName() != string.Empty)) & (item.get_AwayName() != string.Empty)) & (item.get_SelectedMatch() != string.Empty))
             {
                 item.set_ReceiptStatus(EnumCollection.eBetReceiptStatus.Confirm);
                 str3 = CommonFunction.substring2(str2, num, "center\">", "tabcontbk\">", "</", ref num).Trim();
                 if (str3.Contains("waiting"))
                 {
                     item.set_ReceiptStatus(EnumCollection.eBetReceiptStatus.Waiting);
                 }
                 else if (str3.Contains("reject") | str3.Contains("cancel"))
                 {
                     item.set_ReceiptStatus(EnumCollection.eBetReceiptStatus.Reject);
                 }
                 item.set_Company(base._strWebsiteName);
                 list3.Add(item);
             }
         }
     }
     return list3;
 }
예제 #2
0
        /// <summary>
        /// 手动跟注
        /// </summary>
        /// /// <param name="betNew">下注数据</param>
        /// <param name="betNew">下注数据</param>
        public void BetFollowAdmin(AgentConvert agent ,MatchBetNew betNew)
        {
            AgentSiteAbstractClass agentSite = agent.AgentSite;
            List<MatchBetNew>  currentMatchLists =  agentSite.get_MatchDetailListCurrent();
            bool flag = false;
            foreach (var matchBetNew in currentMatchLists)
            {
                if (betNew.get_ReceiptID() == matchBetNew.get_ReceiptID())
                {
                    betNew = matchBetNew;
                    flag = true;
                    break;
                }
            }
            if (!flag)
            {
                Console.WriteLine("没有找到相关的赛事。");
                return;
            }
            foreach (var gamer in PlayerVariable.getInstance().getGamerList().Values)
            {
                // 是否跟注
                if (!gamer.Player.IsBetFollowAdmin)
                {
                    return;
                }

                Member member = agentSite.get_TargetMemberList().get_Item(betNew.get_MemberName());
                WebSiteAbstractClass gamerSite = gamer.WebSite;
                WebsiteBetStyle websiteByName = agentSite.get_TargetMemberList().get_DefaultWebsiteBetStyleList().GetWebsiteByName(gamerSite.get_WebsiteName());
                gamerSite.get_BetQueueList().AddNewAgentMemberBet(betNew, agentSite.get_TargetMemberList().get_GlobalFollowOddsOption(), websiteByName.get_BetStyle(), websiteByName.get_BetValue(), gamerSite.get_BetQueueMaxAttempt(), false);
            }
        }