/// <summary> /// 下发下注命令过滤器 /// </summary> /// <param name="agent">当前代理对象</param> /// <param name="gamer">玩家对象</param> /// <param name="betNew">Ghost下注信息</param> public static bool DoFilter(AgentConvert agentConvert, MatchBetNew betNew, PlayerConvert gamer,ref int sign) { bool isFilter = true; Member member = agentConvert.AgentSite.get_TargetMemberList().get_Item(betNew.get_MemberName()); // 保存Agent下的Ghost详细信息 if (null != member && !string.IsNullOrEmpty(member.get_Name())) { string name = member.get_Name(); //List<Member> members = agentConvert.AgentSite.get_MemberCreditList(); //foreach (var item in members) //{ // if (null != item && !string.IsNullOrEmpty(item.get_Name()) && name == item.get_Name()) // { // member = item; // } //} if (agentConvert.Ghosts.ContainsKey(name) && agentConvert.Ghosts[name].Gamers.ContainsKey(gamer.Player.LoginName)) { if (Conversions.ToInteger(betNew.get_BetAmount()) < agentConvert.Ghosts[name].Ghost.RealBetAccount) { sign = 1; return isFilter; } GhostConvert ghostConvert = agentConvert.Ghosts[name]; ghostConvert.Member = member; // set gamer bet follow method. if (ghostConvert.Ghost.IsOppositeBet) { ghostConvert.FollowMethod = EnumCollection.eBetFollowMethod.Opposite; } gamer.Member.set_BetFollowMethod(ghostConvert.FollowMethod); isFilter = false; } } return isFilter; }
public void LoginPlayers(List<Player> players) { foreach (var player in players) { PlayerConvert gamer = new PlayerConvert(player); if (!string.IsNullOrEmpty(player.Urltype)) { string urlType = player.Urltype.ToLower(); if (urlType == ConstUtil.SBO_WEBSITE) { gamerVariable.setSBOBet(gamer); } else if(urlType == ConstUtil.IBC_WEBSITE) { gamerVariable.setIBCBet(gamer); } } else { gamerVariable.setIBCBet(gamer); } WebSiteAbstractClass webSite = gamer.WebSite; webSite.LoginByThread(); webSite.set_IsAutoReLogin(true); webSite.set_IsAutoBetting(true); CommonFunction.delay(ConstUtil.LOGIN_DELAY_TIME); } }
/// <summary> /// 设置玩家跟注的方式 /// </summary> /// <param name="agentSite">代理网</param> /// <param name="gamer">玩家</param> private void SetGamerBetFollowMethod(AgentConvert agentConvert, PlayerConvert gamer) { // 按全局方式跟注 if (gamer.IsGlobalBetFollowMethod) { gamer.Member.set_BetFollowMethod(agentConvert.AgentSite.get_TargetMemberList().get_GlobalBetFollowMethod()); } else { gamer.Member.set_BetFollowMethod(gamer.Member.get_BetFollowMethod()); } }
/// <summary> /// 默认构造方法 /// </summary> public PlayerTimer(PlayerConvert gamer) { this.gamer = gamer; this.gamerSpiderCallback = new TimerCallback(this.GamerSpider_Tick); }
/// <summary> /// 创建IBC玩家对象 /// </summary> /// <param name="accountID">账户</param> /// <param name="accountPassword">密码</param> public void setIBCBet(PlayerConvert gamer) { this.gamer = gamer; set_objGamer(new IBCBet("IBCBet", null, gamer.Player.Url, gamer.Player.LoginName, gamer.Player.LoginPwd, true, true, true, true, false, false, true, false, EnumCollection.eSpiderMethod.Full, 0x4E20)); initBet(this.gamer.WebSite); AddNetPlayer(this.gamer.Player.LoginName, this.gamer); }
/// <summary> /// 私有构造方法 /// </summary> private PlayerVariable() { gamerList = new Dictionary<string,PlayerConvert>(); gamer = new PlayerConvert(); }
private void AddNetPlayer(string key, PlayerConvert playerConvert) { if (!this.gamerList.ContainsKey(key)) { this.gamerList.Add(key, playerConvert); } else { PlayerConvert oldPlayer = this.gamerList[key]; oldPlayer = playerConvert; } }
public PlayerListener(PlayerConvert playerConvert) { this.playerConvert = playerConvert; }