public static void OnRecieveLimitSkinAdd(CSPkg msg)
        {
            CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            COMDT_HERO_LIMIT_SKIN_LIST stLimitSkinList = msg.stPkgData.stLimitSkinAdd.stLimitSkinList;

            for (int i = 0; i < stLimitSkinList.dwNum; i++)
            {
                COMDT_HERO_LIMIT_SKIN comdt_hero_limit_skin = stLimitSkinList.astSkinList[i];
                if (masterRoleInfo.heroExperienceSkinDic.ContainsKey(comdt_hero_limit_skin.dwSkinID))
                {
                    uint num2 = masterRoleInfo.heroExperienceSkinDic[comdt_hero_limit_skin.dwSkinID];
                    masterRoleInfo.heroExperienceSkinDic[comdt_hero_limit_skin.dwSkinID] = comdt_hero_limit_skin.dwDeadLine;
                    if ((0 < num2) && (num2 < masterRoleInfo.heroExperienceSkinDic[comdt_hero_limit_skin.dwSkinID]))
                    {
                        int      experienceHeroOrSkinExtendDays = CHeroInfo.GetExperienceHeroOrSkinExtendDays(masterRoleInfo.heroExperienceSkinDic[comdt_hero_limit_skin.dwSkinID] - num2);
                        string   skinName   = CSkinInfo.GetSkinName(comdt_hero_limit_skin.dwSkinID);
                        object[] replaceArr = new object[] { skinName, experienceHeroOrSkinExtendDays };
                        Singleton <CUIManager> .GetInstance().OpenTips("ExpCard_ExtendDays", true, 1f, null, replaceArr);
                    }
                }
                else
                {
                    uint num4;
                    uint num5;
                    masterRoleInfo.heroExperienceSkinDic.Add(comdt_hero_limit_skin.dwSkinID, comdt_hero_limit_skin.dwDeadLine);
                    CSkinInfo.ResolveHeroSkin(comdt_hero_limit_skin.dwSkinID, out num4, out num5);
                    CUICommonSystem.ShowNewHeroOrSkin(num4, num5, enUIEventID.None, true, COM_REWARDS_TYPE.COM_REWARDS_TYPE_SKIN, false, null, enFormPriority.Priority1, 0, CHeroInfo.GetExperienceHeroOrSkinValidDays(comdt_hero_limit_skin.dwDeadLine));
                }
            }
        }
Example #2
0
        public static void OnReceiveDianQuanReward(CSPkg msg)
        {
            Singleton <CUIManager> .GetInstance().CloseSendMsgAlert();

            SCPKG_CMD_COUPONS_REWARDINFO stCouponsRewardRsp = msg.stPkgData.stCouponsRewardRsp;
            bool       flag     = true;
            CPaySystem instance = Singleton <CPaySystem> .GetInstance();

            instance.rewardItems.Clear();
            int num = Mathf.Min(stCouponsRewardRsp.stRewardInfo.bNum, stCouponsRewardRsp.stRewardInfo.astRewardDetail.Length);

            for (int i = 0; i < num; i++)
            {
                if (stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].bType == 5)
                {
                    CUICommonSystem.ShowNewHeroOrSkin(stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].stRewardInfo.stHero.dwHeroID, 0, enUIEventID.Pay_ClickGetNewHeroPanel, true, COM_REWARDS_TYPE.COM_REWARDS_TYPE_HERO, false, null, enFormPriority.Priority1, 0, 0);
                    flag = false;
                    break;
                }
                if (stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].bType == 10)
                {
                    uint num3;
                    uint num4;
                    CSkinInfo.ResolveHeroSkin(stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].stRewardInfo.stSkin.dwSkinID, out num3, out num4);
                    CUICommonSystem.ShowNewHeroOrSkin(num3, num4, enUIEventID.Pay_ClickGetNewHeroPanel, true, COM_REWARDS_TYPE.COM_REWARDS_TYPE_SKIN, false, null, enFormPriority.Priority1, 0, 0);
                    flag = false;
                    break;
                }
                if (stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].bType == 1)
                {
                    if (stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].bFromType == 1)
                    {
                        uint           dwHeroID  = stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].stFromInfo.stHeroInfo.dwHeroID;
                        ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey(dwHeroID);
                        if (dataByKey != null)
                        {
                            CUICommonSystem.ShowNewHeroOrSkin(dwHeroID, 0, enUIEventID.Pay_ClickGetNewHeroPanel, true, COM_REWARDS_TYPE.COM_REWARDS_TYPE_HERO, true, null, enFormPriority.Priority1, dataByKey.dwChgItemCnt, 0);
                        }
                    }
                    else if (stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].bFromType == 2)
                    {
                        uint dwSkinID = stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].stFromInfo.stSkinInfo.dwSkinID;
                        uint heroId   = 0;
                        uint skinId   = 0;
                        CSkinInfo.ResolveHeroSkin(dwSkinID, out heroId, out skinId);
                        ResHeroSkin heroSkin = CSkinInfo.GetHeroSkin(heroId, skinId);
                        if (heroSkin != null)
                        {
                            CUICommonSystem.ShowNewHeroOrSkin(heroId, skinId, enUIEventID.Pay_ClickGetNewHeroPanel, true, COM_REWARDS_TYPE.COM_REWARDS_TYPE_HERO, true, null, enFormPriority.Priority1, heroSkin.dwChgItemCnt, 0);
                        }
                    }
                }
            }
            instance.rewardItems = CUseableManager.GetUseableListFromReward(stCouponsRewardRsp.stRewardInfo);
            if (flag)
            {
                Singleton <CUIManager> .GetInstance().OpenAwardTip(LinqS.ToArray <CUseable>(instance.rewardItems), null, false, enUIEventID.None, false, false, "Form_Award");
            }
        }
        public static void OnRecieveLimitSkinAdd(CSPkg msg)
        {
            CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            COMDT_HERO_LIMIT_SKIN_LIST stLimitSkinList = msg.stPkgData.get_stLimitSkinAdd().stLimitSkinList;
            int num = 0;

            while ((long)num < (long)((ulong)stLimitSkinList.dwNum))
            {
                COMDT_HERO_LIMIT_SKIN cOMDT_HERO_LIMIT_SKIN = stLimitSkinList.astSkinList[num];
                if (masterRoleInfo.heroExperienceSkinDic.ContainsKey(cOMDT_HERO_LIMIT_SKIN.dwSkinID))
                {
                    uint num2 = masterRoleInfo.heroExperienceSkinDic.get_Item(cOMDT_HERO_LIMIT_SKIN.dwSkinID);
                    masterRoleInfo.heroExperienceSkinDic.set_Item(cOMDT_HERO_LIMIT_SKIN.dwSkinID, cOMDT_HERO_LIMIT_SKIN.dwDeadLine);
                    if (0u < num2 && num2 < masterRoleInfo.heroExperienceSkinDic.get_Item(cOMDT_HERO_LIMIT_SKIN.dwSkinID))
                    {
                        int    experienceHeroOrSkinExtendDays = CHeroInfo.GetExperienceHeroOrSkinExtendDays(masterRoleInfo.heroExperienceSkinDic.get_Item(cOMDT_HERO_LIMIT_SKIN.dwSkinID) - num2);
                        string skinName = CSkinInfo.GetSkinName(cOMDT_HERO_LIMIT_SKIN.dwSkinID);
                        Singleton <CUIManager> .GetInstance().OpenTips("ExpCard_ExtendDays", true, 1f, null, new object[]
                        {
                            skinName,
                            experienceHeroOrSkinExtendDays
                        });
                    }
                }
                else
                {
                    masterRoleInfo.heroExperienceSkinDic.Add(cOMDT_HERO_LIMIT_SKIN.dwSkinID, cOMDT_HERO_LIMIT_SKIN.dwDeadLine);
                    uint heroId;
                    uint skinId;
                    CSkinInfo.ResolveHeroSkin(cOMDT_HERO_LIMIT_SKIN.dwSkinID, out heroId, out skinId);
                    if (!Singleton <CHeroSelectBaseSystem> .get_instance().m_isInHeroSelectState)
                    {
                        CUICommonSystem.ShowNewHeroOrSkin(heroId, skinId, enUIEventID.None, true, 10, false, null, enFormPriority.Priority1, 0u, CHeroInfo.GetExperienceHeroOrSkinValidDays(cOMDT_HERO_LIMIT_SKIN.dwDeadLine));
                    }
                    else if (!Singleton <CHeroSelectBaseSystem> .get_instance().IsMultilMode())
                    {
                        CHeroInfoSystem2.ReqWearHeroSkin(heroId, skinId, true);
                    }
                }
                num++;
            }
        }
Example #4
0
        public static void OnReceiveDianQuanReward(CSPkg msg)
        {
            Singleton <CUIManager> .GetInstance().CloseSendMsgAlert();

            SCPKG_CMD_COUPONS_REWARDINFO stCouponsRewardRsp = msg.stPkgData.get_stCouponsRewardRsp();
            bool       flag     = true;
            CPaySystem instance = Singleton <CPaySystem> .GetInstance();

            instance.rewardItems.Clear();
            int num = Mathf.Min((int)stCouponsRewardRsp.stRewardInfo.bNum, stCouponsRewardRsp.stRewardInfo.astRewardDetail.Length);

            for (int i = 0; i < num; i++)
            {
                if (stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].bType == 5)
                {
                    CUICommonSystem.ShowNewHeroOrSkin(stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].stRewardInfo.get_stHero().dwHeroID, 0u, enUIEventID.Pay_ClickGetNewHeroPanel, true, 5, false, null, enFormPriority.Priority1, 0u, 0);
                    flag = false;
                    break;
                }
                if (stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].bType == 10)
                {
                    uint heroId;
                    uint skinId;
                    CSkinInfo.ResolveHeroSkin(stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].stRewardInfo.get_stSkin().dwSkinID, out heroId, out skinId);
                    CUICommonSystem.ShowNewHeroOrSkin(heroId, skinId, enUIEventID.Pay_ClickGetNewHeroPanel, true, 10, false, null, enFormPriority.Priority1, 0u, 0);
                    flag = false;
                    break;
                }
                if (stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].bType == 1)
                {
                    if (stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].bFromType == 1)
                    {
                        uint           dwHeroID  = stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].stFromInfo.get_stHeroInfo().dwHeroID;
                        ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey(dwHeroID);
                        if (dataByKey != null)
                        {
                            ResHeroShop resHeroShop = null;
                            GameDataMgr.heroShopInfoDict.TryGetValue(dataByKey.dwCfgID, ref resHeroShop);
                            CUICommonSystem.ShowNewHeroOrSkin(dwHeroID, 0u, enUIEventID.Pay_ClickGetNewHeroPanel, true, 5, true, null, enFormPriority.Priority1, (resHeroShop == null) ? 1u : resHeroShop.dwChgItemCnt, 0);
                        }
                    }
                    else if (stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].bFromType == 2)
                    {
                        uint dwSkinID = stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].stFromInfo.get_stSkinInfo().dwSkinID;
                        uint heroId2  = 0u;
                        uint skinId2  = 0u;
                        CSkinInfo.ResolveHeroSkin(dwSkinID, out heroId2, out skinId2);
                        ResHeroSkin heroSkin = CSkinInfo.GetHeroSkin(heroId2, skinId2);
                        if (heroSkin != null)
                        {
                            ResHeroSkinShop resHeroSkinShop = null;
                            GameDataMgr.skinShopInfoDict.TryGetValue(heroSkin.dwID, ref resHeroSkinShop);
                            CUICommonSystem.ShowNewHeroOrSkin(heroId2, skinId2, enUIEventID.Pay_ClickGetNewHeroPanel, true, 5, true, null, enFormPriority.Priority1, (resHeroSkinShop == null) ? 1u : resHeroSkinShop.dwChgItemCnt, 0);
                        }
                    }
                }
            }
            instance.rewardItems = CUseableManager.GetUseableListFromReward(stCouponsRewardRsp.stRewardInfo);
            if (flag)
            {
                Singleton <CUIManager> .GetInstance().OpenAwardTip(LinqS.ToArray <CUseable>(instance.rewardItems), null, false, enUIEventID.None, false, false, "Form_Award");
            }
        }