| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- using System.Collections.Generic;
- using System.Linq;
- 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.DataList.Where(a => a.Id == response.ChapterId)
- .ToList();
- 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);
- }
- }
- }
- }
- }
|