Beispiel #1
0
        Guid[] GetIdleMembers(Guid managerId, DTOBuffMemberView buffData)
        {
            if (!buffData.SyncIdleFlag)
            {
                return(null);
            }
            var       members = NbManagerbuffmemberMgr.GetByMid(managerId, ShareUtil.GetTableMod(managerId));
            Guid      tid     = Guid.Empty;
            var       dic     = buffData.BuffMembers;
            const int cnt     = 5;
            int       i       = 0;
            var       ary     = new Guid[cnt];

            foreach (var item in members)
            {
                if (i >= cnt)
                {
                    break;
                }
                tid = item.Tid;
                if (!dic.ContainsKey(tid))
                {
                    ary[i++] = tid;
                }
            }
            for (; i < cnt; ++i)
            {
                ary[i] = Guid.Empty;
            }
            return(ary);
        }
Beispiel #2
0
        DTOBuffMemberView GetMembers4Db(Guid managerId, ManagerSkillUseWrap use, ArenaTeammemberFrame arenaFrame)
        {
            if (!FrameConfig.SWAPBuffDataReadDb ||
                null == use || use.Raw.SyncFlag != 0)
            {
                return(null);
            }
            var rawMembers = BuffUtil.GetRawMembers(managerId, true, arenaFrame);
            var members    = NbManagerbuffmemberMgr.GetByMid(managerId, ShareUtil.GetTableMod(managerId));
            //var extra = NbManagerextraMgr.GetById(managerId);
            var             dic = new Dictionary <Guid, NbManagerbuffmemberEntity>(members.Count);
            DicPlayerEntity cfg = null;

            foreach (var item in members)
            {
                cfg = PlayersdicCache.Instance.GetPlayer(Math.Abs(item.Pid));
                if (null == cfg)
                {
                    continue;
                }
                FillBuffMemberProp(item, cfg);
                item.ReadySkillList = item.ReadySkills.Split(',').ToList();
                item.LiveSkillList  = item.LiveSkills.Split(',').ToList();
            }
            var data = CreateBuffView(managerId, use, rawMembers.ToDictionary(i => i.Idx, i => i));

            data.Kpi          = arenaFrame.Kpi;
            data.SyncIdleFlag = false;
            data.BuffMembers  = dic;
            return(data);
        }