Exemplo n.º 1
0
        DTOBuffMemberView GetMembers4Mem(out ManagerSkillUseWrap use, out DTOBuffPoolView poolView, Guid managerId, string siteId)
        {
            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>(managerId.ToString());

            if (null != data &&
                data.UseSyncVersion == verNo &&
                data.PoolSyncTime == poolView.SyncTime &&
                data.PoolSyncVersion == poolView.SyncVersion)
            {
                return(data);
            }
            return(null);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 获取原始Buff
        /// </summary>
        /// <param name="managerId">经理id</param>
        /// <param name="syncFlag">同步缓存标记</param>
        /// <returns></returns>
        public DTOBuffPoolView GetRawPools(Guid managerId, string siteId = "", bool syncFlag = true)
        {
            if (FrameConfig.SWAPBuffDisableCrossCache && !string.IsNullOrEmpty(siteId))
            {
                syncFlag = false;
            }
            var data = s_memBuffPool.Get <DTOBuffPoolView>(managerId.ToString());

            if (null == data)
            {
                data = ReqRawPools(managerId, siteId, syncFlag);
            }
            else
            {
                if (syncFlag && !IfMemValid(data.CreateTime))
                {
                    s_buffSync.SyncBuffPools(managerId, siteId);
                }
            }
            return(data);
        }