Ejemplo n.º 1
0
        DTOBuffMemberView GetMembers4Mem(out ManagerSkillUseWrap use, out DTOBuffPoolView poolView, Guid managerId, string siteId, ArenaTeammemberFrame arenaFrame)
        {
            use      = ManagerUtil.GetSkillUseWrap(managerId, siteId);
            poolView = BuffPoolCore.Instance().GetRawPools(managerId, siteId, true);
            bool syncFlag = true;

            if (FrameConfig.SWAPBuffDisableCrossCache && !string.IsNullOrEmpty(siteId))
            {
                syncFlag = false;
            }
            ulong    verNo = use.VersionNo;
            DateTime dtNow = DateTime.Now;

            if (verNo == 0 || dtNow >= poolView.SyncTime)
            {
                if (syncFlag)
                {
                    s_buffSync.SyncBuffPools(managerId, siteId);
                }
                return(null);
            }
            var data = s_memBuffMember.Get <DTOBuffMemberView>(arenaFrame.ArenaType.ToString() + managerId.ToString());

            if (null != data &&
                data.UseSyncVersion == verNo &&
                data.PoolSyncTime == poolView.SyncTime &&
                data.PoolSyncVersion == poolView.SyncVersion)
            {
                return(data);
            }
            return(null);
        }
Ejemplo n.º 2
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);
        }
Ejemplo n.º 3
0
        public static void ProcManagerBuff(DTOBuffPack buffPack, bool homeFlag, DTOBuffPoolView poolView = null)
        {
            Guid managerId = buffPack.GetMid(homeFlag);
            var  pools     = BuffPoolCore.Instance().GetBuffSource(managerId, EnumBuffUnitType.PlayerProp, true, poolView);

            ProcBuffPool(buffPack, homeFlag, Guid.Empty, pools);
        }
Ejemplo n.º 4
0
 public static BuffPoolCore Instance()
 {
     if (null == s_instnce || !s_instnce.InitFlag)
     {
         lock (s_lockObj)
         {
             if (null == s_instnce || !s_instnce.InitFlag)
             {
                 s_instnce = new BuffPoolCore();
             }
         }
     }
     return(s_instnce);
 }
Ejemplo n.º 5
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);
        }
Ejemplo n.º 6
0
 public void SyncBuffPools(Guid managerId, string siteId = "")
 {
     s_tpBuffPool.Add(() => BuffPoolCore.Instance().ReqRawPools(managerId, siteId));
 }