Example #1
0
        public DTOBuffMemberView RebuildMembers(Guid managerId, ArenaTeammemberFrame arenaFrame)
        {
            const bool homeFlag = true;
            var        buffPack = new DTOBuffPack();
            var        use      = ManagerUtil.GetSkillUseWrap(managerId);
            var        poolView = BuffPoolCore.Instance().GetRawPools(managerId, "", true);

            FillBuffPack(buffPack, homeFlag, managerId, arenaFrame);
            TeammemberDataHelper.FillTeammemberData(buffPack, homeFlag);
            use.OnPids = buffPack.GetOnPids(homeFlag).Keys.ToArray();
            BuffUtil.GetManagerSkillList(managerId, use);
            BuffCache.Instance().FillRankedSkillList(buffPack.GetSBM(homeFlag), use.ManagerSkills);
            BuffUtil.FillLiveSkillList(use, poolView.LiveSkills);
            var data = CreateBuffView(managerId, use, buffPack.GetRawMembers(homeFlag));

            data.PoolSyncTime    = poolView.SyncTime;
            data.PoolSyncVersion = poolView.SyncVersion;
            FillBuffView(data, buffPack, homeFlag, false, 0);
            BuffFlowFacade.ProcManagerBuff(buffPack, homeFlag, data.FirmSkillList, false);
            BuffFlowFacade.ProcPlayerBuff(buffPack, homeFlag, data.BuffMembers.Values, false);
            BuffFlowFacade.ProcManagerBuff(buffPack, homeFlag, poolView);
            FillBuffView(data, buffPack, homeFlag, true, 1);
            data.TalentType = BuffUtil.GetTalentType(managerId);
            NbManagerextraMgr.UpdateKpi(managerId, data.Kpi);
            data.SyncIdleFlag = false;
            s_memBuffMember.Set(arenaFrame.ArenaType.ToString() + managerId.ToString(), data);
            return(data);
        }
Example #2
0
        DTOBuffMemberView GetMembersCore(DTOBuffPack buffPack, bool homeFlag, Guid managerId, ArenaTeammemberFrame arenaFrame, bool syncFlag = true, string siteId = "")
        {
            if (FrameConfig.SWAPBuffDisableCrossCache && !string.IsNullOrEmpty(siteId))
            {
                syncFlag = false;
            }
            ManagerSkillUseWrap use;
            DTOBuffPoolView     poolView;
            var data = GetMembers4Mem(out use, out poolView, managerId, siteId, arenaFrame);

            do
            {
                if (null != data)
                {
                    break;
                }
                if (string.IsNullOrEmpty(siteId))
                {
                    data = GetMembers4Db(managerId, use, arenaFrame);
                }
                if (null == data)
                {
                    FillBuffPack(buffPack, homeFlag, managerId, arenaFrame, null, siteId);
                    TeammemberDataHelper.FillTeammemberData(buffPack, homeFlag, siteId);
                    use.OnPids = buffPack.GetOnPids(homeFlag).Keys.ToArray();
                    BuffUtil.GetManagerSkillList(managerId, use, siteId);
                    BuffCache.Instance().FillRankedSkillList(buffPack.GetSBM(homeFlag), use.ManagerSkills);
                    BuffUtil.FillLiveSkillList(use, poolView.LiveSkills);
                    data = CreateBuffView(managerId, use, buffPack.GetRawMembers(homeFlag));
                    data.PoolSyncTime    = poolView.SyncTime;
                    data.PoolSyncVersion = poolView.SyncVersion;
                    FillBuffView(data, buffPack, homeFlag, false, 0);
                    BuffFlowFacade.ProcManagerBuff(buffPack, homeFlag, data.FirmSkillList, false);
                    BuffFlowFacade.ProcPlayerBuff(buffPack, homeFlag, data.BuffMembers.Values, false);
                    BuffFlowFacade.ProcManagerBuff(buffPack, homeFlag, poolView);
                    FillBuffView(data, buffPack, homeFlag, true, 1);
                }
                data.TalentType = BuffUtil.GetTalentType(managerId, siteId);
                if (syncFlag)
                {
                    s_buffSync.SyncBuffMembers(managerId, arenaFrame.ArenaType, CloneBuffView(data), siteId);
                }
            }while (false);
            data.KpiReady = data.Kpi;
            data.ClothId  = BuffPoolCore.Instance().GetManagerClothId(managerId, poolView);
            return(data);
        }
Example #3
0
        public void GetMembers(out DTOBuffMemberView homeData, out DTOBuffMemberView awayData, string homeSiteId, Guid homeId, bool isHomeNpc, string awaySiteId, Guid awayId, ArenaTeammemberFrame homeFrame, ArenaTeammemberFrame awayFrame, bool isAwayNpc, bool syncHomeFlag = true, bool syncAwayFlag = false)
        {
            var buffPack = new DTOBuffPack();

            if (isHomeNpc)
            {
                syncHomeFlag = false;
                homeData     = CloneBuffView(NpcdicCache.Instance.GetBuffView(homeId), true);
            }
            else
            {
                homeData = GetMembersCore(buffPack, true, homeId, homeFrame, syncHomeFlag, homeSiteId);
            }
            if (isAwayNpc)
            {
                syncAwayFlag = false;
                awayData     = CloneBuffView(NpcdicCache.Instance.GetBuffView(awayId), true);
            }
            else
            {
                awayData = GetMembersCore(buffPack, false, awayId, awayFrame, syncAwayFlag, awaySiteId);
            }
            string antiTalentSkill;

            if (ManagerSkillCache.Instance().TryGetAntiTanlent(out antiTalentSkill, homeData.TalentType, awayData.TalentType))
            {
                if (null == homeData.ReadySkillList)
                {
                    homeData.ReadySkillList = new List <string>(2);
                }
                homeData.ReadySkillList.Add(antiTalentSkill);
            }
            if (ManagerSkillCache.Instance().TryGetAntiTanlent(out antiTalentSkill, awayData.TalentType, homeData.TalentType))
            {
                if (null == awayData.ReadySkillList)
                {
                    awayData.ReadySkillList = new List <string>(2);
                }
                awayData.ReadySkillList.Add(antiTalentSkill);
            }
            int cntHome = 0;
            int cntAway = 0;

            if (null != homeData.ReadySkillList)
            {
                cntHome = homeData.ReadySkillList.Count;
            }
            if (null != awayData.ReadySkillList)
            {
                cntAway = awayData.ReadySkillList.Count;
            }
            if (cntHome == 0 && cntAway == 0)
            {
                return;
            }
            if (isHomeNpc)
            {
                FillBuffPack(buffPack, true, homeData.BuffPlayers);
            }
            else
            {
                FillBuffPack(buffPack, true, homeId, homeFrame, null, homeSiteId);
            }
            if (isAwayNpc)
            {
                FillBuffPack(buffPack, false, awayData.BuffPlayers);
            }
            else
            {
                FillBuffPack(buffPack, false, awayId, awayFrame, null, awaySiteId);
            }
            BuffFlowFacade.ProcManagerBuff(buffPack, true, homeData.ReadySkillList, true);
            BuffFlowFacade.ProcManagerBuff(buffPack, false, awayData.ReadySkillList, true);
            FillBuffView(homeData, buffPack, true, true, 2);
            FillBuffView(awayData, buffPack, false, true, 2);
        }