| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- using System.Collections.Generic;
- using cfg.GfgCfg;
- using ET;
- using GFGGame;
- namespace ET
- {
- public class NoticeFilingScoreBonusChanged : AMHandler<S2C_FilingScoreBonusChanged>
- {
- protected override async ETTask Run(Session session, S2C_FilingScoreBonusChanged message)
- {
- StudioDataManager.Instance.NoticeFilingScoreBonusChanged(message.ChapterId, message.ChapterScore,
- message.BonusStatusList);
- EventAgent.DispatchEvent(ConstMessage.FILING_SCORE_CHANGE);
- EventAgent.DispatchEvent(ConstMessage.RED_CHANGE);
- await ETTask.CompletedTask;
- }
- }
- }
- namespace GFGGame
- {
- public class StudioSProxy
- {
- //请求工作室副本数据
- public static async ETTask ReqStudioInfos()
- {
- M2C_GetStudioInfos response = null;
- response = (M2C_GetStudioInfos)await MessageHelper.SendToServer(new C2M_GetStudioInfos());
- if (response != null)
- {
- if (response.Error == ErrorCode.ERR_Success)
- {
- for (int i = 0; i < response.infos.Count; i++)
- {
- StudioData studioData = new StudioData
- {
- ChapterId = response.infos[i].ChapterId, ChapterScore = response.infos[i].ChapterScore,
- RewardsStatus = response.infos[i].BonusStatusList
- };
- StudioDataManager.Instance.RspStudioInfos(studioData);
- }
- StudioDataManager.Instance.PorcelainTheme = response.RepairPorcelainTheme;
- }
- }
- }
- //领取查阅建档分数宝箱
- public static async ETTask ReqFilingScoreRewards(int chapterId)
- {
- S2C_GetFilingScoreBonus response = null;
- response = (S2C_GetFilingScoreBonus)await MessageHelper.SendToServer(new C2S_GetFilingScoreBonus()
- { ChapterId = chapterId });
- if (response != null)
- {
- if (response.Error == ErrorCode.ERR_Success)
- {
- List<ItemData> itemDatas = new List<ItemData>();
- for (int i = 0; i < response.BonusIndexList.Count; i++)
- {
- StudioDataManager.Instance.RspFilingScoreReward(response.ChapterId, response.BonusIndexList[i]);
- List<FilingRewardCfg> filingRewards =
- CommonDataManager.Tables.TblFilingRewardCfg.GetGroup1ById(response.ChapterId);
- var rewards = filingRewards[response.BonusIndexList[i]].Items;
- for (int j = 0; j < rewards.Count; j++)
- {
- itemDatas.Add(ItemUtil.createItemData(rewards[j].ToGfgGameItemParam()));
- }
- }
- BonusController.TryShowBonusList(itemDatas);
- EventAgent.DispatchEvent(ConstMessage.FILING_SCORE_CHANGE);
- EventAgent.DispatchEvent(ConstMessage.RED_CHANGE);
- }
- }
- }
- }
- }
|