Пример #1
0
        /// <summary>
        /// agentConvert监听到有Ghost下注
        /// </summary>
        /// <param name="agentName"></param>
        /// <param name="newMemberBetList"></param>
        private void FoundNewMemberBet(string agentName, List<MatchBetNew> newMemberBetList)
        {
            AgentSiteAbstractClass agentSite = agentConvert.AgentSite;
            if (newMemberBetList.Count > 0)
            {
                int num;
                Member member = null;
                WebsiteBetStyle websiteByName = null;

                foreach (var gamer in PlayerVariable.getInstance().getGamerList().Values)
                {
                    WebSiteAbstractClass bet = gamer.WebSite;
                    String webSiteName = bet.get_WebsiteName();

                    if (bet.get_IsLoginSuccess())
                    {
                        SetGamerBetFollowMethod(agentConvert, gamer);
                        if (agentSite.get_TargetMemberList().get_MemberRange() == EnumCollection.eMemberRange.AllMember)
                        {
                            websiteByName = agentSite.get_TargetMemberList().get_DefaultWebsiteBetStyleList().GetWebsiteByName(webSiteName);
                            if (((websiteByName.get_BetStyle() != EnumCollection.eBetAmountStyle.None) & !((websiteByName.get_BetStyle() == EnumCollection.eBetAmountStyle.Fixed) & (websiteByName.get_BetValue() == 0))) & !((websiteByName.get_BetStyle() == EnumCollection.eBetAmountStyle.Percent) & (websiteByName.get_BetValue() == 0)))
                            {
                                foreach (MatchBetNew new2 in newMemberBetList)
                                {

                                    if ((Conversion.Val(new2.get_BetAmount()) >= System.Convert.ToDouble(agentSite.get_TargetMemberList().get_GlobalMinFollowLimit())) && (!agentSite.get_TargetMemberList().get_IsToShowBetTargetCollection() | (agentSite.get_TargetMemberList().get_IsToShowBetTargetCollection() & agentSite.get_TargetMemberList().get_GlobalBetTargetCollection().IsMatchBetCanBet(new2))))
                                    {

                                        bet.get_BetQueueList().AddNewAgentMemberBet(new2, agentSite.get_TargetMemberList().get_GlobalFollowOddsOption(), websiteByName.get_BetStyle(), websiteByName.get_BetValue(), bet.get_BetQueueMaxAttempt(), false);
                                    }
                                }
                            }
                        }
                        else if (agentSite.get_TargetMemberList().get_MemberRange() == EnumCollection.eMemberRange.SelectedMember)
                        {
                            foreach (MatchBetNew new2 in newMemberBetList)
                            {
                                int sign = 0;
                                bool isFilter = GhostFilter.DoFilter(agentConvert, new2, gamer,ref sign);
                                // Agent不需要监听的Ghost,以及不需要跟注当前Ghost的玩家不下发下注命令
                                if (isFilter)
                                {
                                    if (sign == 1)
                                    {
                                        PlayerBetLog log = new PlayerBetLog();
                                        log.Player = gamer.Player;
                                        log.Results = "bet unsuccessful";
                                        log.Remarks = "Ghost has bet amount less than real amount!";
                                        log.BetTime = DateTime.Now;

                                        DataServiceAdapter.SavePlayerBetLog(log);
                                    }
                                    continue;
                                }

                                member = agentSite.get_TargetMemberList().get_Item(new2.get_MemberName());
                                if ((Conversion.Val(new2.get_BetAmount()) >= System.Convert.ToDouble(member.get_MinFollowLimit())))
                                {
                                    websiteByName = member.get_WebsiteBetStyleList().GetWebsiteByName(webSiteName);
                                    if (websiteByName.get_BetStyle() != EnumCollection.eBetAmountStyle.None)
                                    {
                                        // TODO Aorta
                                        bet.WriteProgramLogger("[Agent Timer]" + new2.GetInfo(gamer.Player.LoginName));
                                        bet.get_BetQueueList().AddNewAgentMemberBet(new2, member.get_FollowOddsOpt(), websiteByName.get_BetStyle(), websiteByName.get_BetValue(), bet.get_BetQueueMaxAttempt(), false);
                                    }
                                }
                            }
                        }
                    }
                    else
                    {
                        foreach (MatchBetNew new2 in newMemberBetList)
                        {

                            member = agentConvert.AgentSite.get_TargetMemberList().get_Item(new2.get_MemberName());
                            string name = member.get_Name();
                            if (agentConvert.Ghosts.ContainsKey(name) &&
                                agentConvert.Ghosts[name].Gamers.ContainsKey(gamer.Player.LoginName) &&
                                Conversions.ToInteger(new2.get_BetAmount()) >= agentConvert.Ghosts[name].Ghost.RealBetAccount)
                            {
                                PlayerBetLog log = new PlayerBetLog();
                                log.Player = gamer.Player;
                                log.Results = "bet unsuccessful";
                                log.Remarks = "No login system, can't bet on.";
                                log.BetTime = DateTime.Now;

                                DataServiceAdapter.SavePlayerBetLog(log);
                            }
                        }

                    }
                }

                foreach (MatchBetNew matchBetNew in newMemberBetList)
                {
                    // 保存Ghost下注信息
                    DataServiceAdapter.SaveGhostBetInfo(matchBetNew);
                }
            }
        }
Пример #2
0
        public bool AddPlayerBetLog(PlayerBetLog playerBetLog)
        {
            bool flag = false;
            MySqlParameter[] parms = new MySqlParameter[]{
                                                     new MySqlParameter("@playerId", playerBetLog.Player.Id),
                                                     new MySqlParameter("@results", playerBetLog.Results),
                                                     new MySqlParameter("@remarks", playerBetLog.Remarks),
                                                     new MySqlParameter("@betTime", playerBetLog.BetTime)
            };
            try
            {
                if (DBHelper.ExecuteNonQuery(connectStr, CommandType.StoredProcedure, "AddNewPlayerBetLog", parms) != 0)
                {
                    flag = true;
                }
            }
            catch
            {
                throw;
            }

            return flag;
        }
Пример #3
0
 private PlayerBetLog setBetLogMessage(string message)
 {
     PlayerBetLog log = new PlayerBetLog();
     log.Player = playerConvert.Player;
     log.Results = BET_UNSUCCESS;
     log.Remarks = message;
     log.BetTime = DateTime.Now;
     return log;
 }
Пример #4
0
        public static bool SavePlayerBetLog(PlayerBetLog log)
        {
            bool isSuccess = false;
            try
            {
            // 创建下注数据访问对象
                BetService betService = new BetService();
                log.Player = GetPlayerByPlayerName(log.Player.LoginName);
                isSuccess = betService.AddPlayerBetLog(log);
                System.Threading.Thread.Sleep(100);
            }
            catch (Exception e)
            {

                throw;
            }

            return isSuccess;
        }