예제 #1
0
        public static bool IsBuyForbiddenForRankBigGrade(uint heroId, uint skinId, out RES_RANK_LIMIT_TYPE rankLimitType, out byte rankLimitBigGrade, out ulong rankLimitParam, out bool isHaveRankBigGradeLimit)
        {
            ResHeroSkinShop shop;
            uint            skinCfgId = GetSkinCfgId(heroId, skinId);

            if (GameDataMgr.skinShopInfoDict.TryGetValue(skinCfgId, out shop))
            {
                rankLimitType     = (RES_RANK_LIMIT_TYPE)shop.bRankLimitType;
                rankLimitBigGrade = shop.bRankLimitGrade;
                rankLimitParam    = shop.ullRankLimitParam;
                switch (rankLimitType)
                {
                case RES_RANK_LIMIT_TYPE.RES_RANK_LIMIT_CURGRADE:
                    isHaveRankBigGradeLimit = true;
                    return(CLadderSystem.GetRankBigGrade(Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().m_rankGrade) < rankLimitBigGrade);

                case RES_RANK_LIMIT_TYPE.RES_RANK_LIMIT_SEASONGRADE:
                    isHaveRankBigGradeLimit = true;
                    return(CLadderSystem.GetRankBigGrade(Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().m_rankSeasonHighestGrade) < rankLimitBigGrade);

                case RES_RANK_LIMIT_TYPE.RES_RANK_LIMIT_MAXGRADE:
                    isHaveRankBigGradeLimit = true;
                    return(CLadderSystem.GetRankBigGrade(Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().m_rankHistoryHighestGrade) < rankLimitBigGrade);

                case RES_RANK_LIMIT_TYPE.RES_RANK_LIMIT_HISTORYGRADE:
                    isHaveRankBigGradeLimit = true;
                    if (!Singleton <CLadderSystem> .GetInstance().IsCurSeason(rankLimitParam))
                    {
                        return(CLadderSystem.GetRankBigGrade(Singleton <CLadderSystem> .GetInstance().GetHistorySeasonGrade(rankLimitParam)) < rankLimitBigGrade);
                    }
                    return(CLadderSystem.GetRankBigGrade(Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().m_rankGrade) < rankLimitBigGrade);
                }
            }
            rankLimitType           = RES_RANK_LIMIT_TYPE.RES_RANK_LIMIT_NULL;
            rankLimitBigGrade       = 0;
            rankLimitParam          = 0L;
            isHaveRankBigGradeLimit = false;
            return(false);
        }
예제 #2
0
        public static bool IsBuyForbiddenForRankBigGrade(uint heroId, uint skinId, out RES_RANK_LIMIT_TYPE rankLimitType, out byte rankLimitBigGrade, out ulong rankLimitParam, out bool isHaveRankBigGradeLimit)
        {
            uint            skinCfgId = CSkinInfo.GetSkinCfgId(heroId, skinId);
            ResHeroSkinShop resHeroSkinShop;

            if (GameDataMgr.skinShopInfoDict.TryGetValue(skinCfgId, ref resHeroSkinShop))
            {
                rankLimitType     = (int)resHeroSkinShop.bRankLimitType;
                rankLimitBigGrade = resHeroSkinShop.bRankLimitGrade;
                rankLimitParam    = resHeroSkinShop.ullRankLimitParam;
                switch (rankLimitType)
                {
                case 1:
                    isHaveRankBigGradeLimit = true;
                    return(CLadderSystem.GetRankBigGrade(Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().m_rankGrade) < rankLimitBigGrade);

                case 2:
                    isHaveRankBigGradeLimit = true;
                    return(CLadderSystem.GetRankBigGrade(Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().m_rankSeasonHighestGrade) < rankLimitBigGrade);

                case 3:
                    isHaveRankBigGradeLimit = true;
                    return(CLadderSystem.GetRankBigGrade(Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().m_rankHistoryHighestGrade) < rankLimitBigGrade);

                case 4:
                    isHaveRankBigGradeLimit = true;
                    if (Singleton <CLadderSystem> .GetInstance().IsCurSeason(rankLimitParam))
                    {
                        return(CLadderSystem.GetRankBigGrade(Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().m_rankGrade) < rankLimitBigGrade);
                    }
                    return(CLadderSystem.GetRankBigGrade(Singleton <CLadderSystem> .GetInstance().GetHistorySeasonGrade(rankLimitParam)) < rankLimitBigGrade);
                }
            }
            rankLimitType           = 0;
            rankLimitBigGrade       = 0;
            rankLimitParam          = 0uL;
            isHaveRankBigGradeLimit = false;
            return(false);
        }