Beispiel #1
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 void OnHuoyue_Reward_RES(ref CSPkg pkg)
        {
            SCPKG_GETHUOYUEDUREWARD_RSP stHuoYueDuRewardRsp = pkg.stPkgData.stHuoYueDuRewardRsp;

            this.model.huoyue_data.Get_Reward((RES_HUOYUEDU_TYPE)stHuoYueDuRewardRsp.bRewardType, stHuoYueDuRewardRsp.wHuoYueDuId);
            if (stHuoYueDuRewardRsp.stRewardInfo.bNum > 0)
            {
                ListView <CUseable> useableListFromReward = CUseableManager.GetUseableListFromReward(stHuoYueDuRewardRsp.stRewardInfo);
                Singleton <CUIManager> .GetInstance().OpenAwardTip(LinqS.ToArray <CUseable>(useableListFromReward), null, false, enUIEventID.None, false, false, "Form_Award");
            }
            if (this.m_taskView != null)
            {
                this.m_taskView.Refresh_Huoyue();
            }
        }
Beispiel #3
0
        public static void OnSCID_GETPVPLEVELREWARD_RSP(CSPkg pkg)
        {
            SCPKG_GETPVPLEVELREWARD_RSP stLevelRewardRsp = pkg.stPkgData.get_stLevelRewardRsp();

            if (stLevelRewardRsp.iErrorCode == 0)
            {
                Singleton <CTaskSys> .get_instance().model.SyncServerLevelRewardFlagData(stLevelRewardRsp.ullLevelRewardFlag);

                ListView <CUseable> useableListFromReward = CUseableManager.GetUseableListFromReward(stLevelRewardRsp.stRewardInfo);
                Singleton <CUIManager> .GetInstance().OpenAwardTip(LinqS.ToArray <CUseable>(useableListFromReward), null, false, enUIEventID.None, false, false, "Form_Award");

                Singleton <CTaskSys> .get_instance().m_taskView.Refresh();
            }
            else
            {
                Debug.LogError("---领取等级奖励 response error, errorcode:" + stLevelRewardRsp.iErrorCode);
            }
        }
Beispiel #4
0
        private void ShowRewards(SCPKG_DRAWWEAL_RSP rspPkg)
        {
            Singleton <CUIManager> .GetInstance().CloseSendMsgAlert();

            Activity activity = Singleton <ActivitySys> .GetInstance().GetActivity((COM_WEAL_TYPE)rspPkg.bWealType, rspPkg.dwWealID);

            if (activity != null)
            {
                if (rspPkg.iResult == 0)
                {
                    activity.SetPhaseMarked(rspPkg.dwPeriodID);
                    if (rspPkg.stReward.bNum > 0)
                    {
                        ListView <CUseable> useableListFromReward = CUseableManager.GetUseableListFromReward(rspPkg.stReward);
                        for (int i = 0; i < useableListFromReward.Count; i++)
                        {
                            useableListFromReward[i].m_stackMulti = (int)(rspPkg.stMultipleInfo.dwWealRatio / 0x2710);
                        }
                        this._rewardListQueue.Add(new RewardList(useableListFromReward, rspPkg.iExtraCode));
                        Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.Common_NewHeroOrSkinFormClose, new CUIEventManager.OnUIEventHandler(this.ShowNextReward));

                        Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.Mall_Get_AWARD_CLOSE_FORM, new CUIEventManager.OnUIEventHandler(this.ShowNextReward));

                        this.ShowNextReward(null);
                    }
                }
                else
                {
                    string str = "[";
                    if ((rspPkg.iResult == 8) || (rspPkg.iResult == 9))
                    {
                        str = str + Singleton <CTextManager> .GetInstance().GetText("payError");
                    }
                    else
                    {
                        str = str + rspPkg.iResult;
                    }
                    str = str + "]";
                    Singleton <CUIManager> .GetInstance().OpenMessageBox(Singleton <CTextManager> .GetInstance().GetText("drawRewardFailed") + str, false);
                }
            }
        }
Beispiel #5
0
        private void ShowRewards(SCPKG_DRAWWEAL_RSP rspPkg)
        {
            Singleton <CUIManager> .GetInstance().CloseSendMsgAlert();

            Activity activity = Singleton <ActivitySys> .GetInstance().GetActivity(rspPkg.bWealType, rspPkg.dwWealID);

            if (activity != null)
            {
                if (rspPkg.iResult == 0)
                {
                    activity.SetPhaseMarked(rspPkg.dwPeriodID);
                    if (rspPkg.stReward.bNum > 0)
                    {
                        ListView <CUseable> useableListFromReward = CUseableManager.GetUseableListFromReward(rspPkg.stReward);
                        for (int i = 0; i < useableListFromReward.get_Count(); i++)
                        {
                            useableListFromReward.get_Item(i).m_stackMulti = CUseable.GetMultipleValue(rspPkg.stMultipleInfo, 1) / 10000;
                        }
                        this._rewardListQueue.Add(new ActivitySys.RewardList(useableListFromReward, rspPkg.iExtraCode));
                        Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.Common_NewHeroOrSkinFormClose, new CUIEventManager.OnUIEventHandler(this.ShowNextReward));

                        Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.Mall_Get_AWARD_CLOSE_FORM, new CUIEventManager.OnUIEventHandler(this.ShowNextReward));

                        this.ShowNextReward(null);
                    }
                }
                else
                {
                    string text = "[";
                    if (rspPkg.iResult == 8 || rspPkg.iResult == 9)
                    {
                        text += Singleton <CTextManager> .GetInstance().GetText("payError");
                    }
                    else
                    {
                        text += rspPkg.iResult;
                    }
                    text += "]";
                    Singleton <CUIManager> .GetInstance().OpenMessageBox(Singleton <CTextManager> .GetInstance().GetText("drawRewardFailed") + text, false);
                }
            }
        }
Beispiel #6
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");
            }
        }