1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- using System.Collections.Generic;
- using ET;
- using GFGGame;
- namespace ET
- {
- public class NoticeStudioPlayTimes : AMHandler<M2C_NoticeStudioPlayTimes>
- {
- protected override async ETTask Run(Session session, M2C_NoticeStudioPlayTimes message)
- {
- StudioDataManager.Instance.NoticeStudioPlayTimes(message.ChapterId, message.PlayTimes);
- EventAgent.DispatchEvent(ConstMessage.NOTICE_STUDIO_PLAY_TIMES);
- await ETTask.CompletedTask;
- }
- }
- 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);
- 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, BuyTimes = response.infos[i].BuyTimes, PlayTimes = response.infos[i].PlayTimes, TotalPlayTimes = response.infos[i].TotalPlayTimes, ChapterScore = response.infos[i].ChapterScore, };
- StudioDataManager.Instance.RspStudioInfos(studioData);
- }
- // EventAgent.DispatchEvent(ConstMessage.GET_STUDIO_INFO);
- }
- }
- }
- //请求购买副本挑战次数
- public static async ETTask ReqBuyStudioPlayTimes(int chapterId, int buyType, int buyCount)
- {
- M2C_BuyStudioPlayTimes response = null;
- response = (M2C_BuyStudioPlayTimes)await MessageHelper.SendToServer(new C2M_BuyStudioPlayTimes() { ChapterId = chapterId, BuyType = buyType, BuyCount = buyCount });
- if (response != null)
- {
- if (response.Error == ErrorCode.ERR_Success)
- {
- StudioDataManager.Instance.RspBuyStudioPlayTimes(response.ChapterId, response.BuyTimes, response.TotalPlayTimes);
- EventAgent.DispatchEvent(ConstMessage.BUY_STUDIO_PLAY_TIMES);
- }
- }
- }
- //领取查阅建档分数宝箱
- 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)
- {
- StudioDataManager.Instance.RspFilingScoreReward(response.ChapterId, response.BonusIndexList);
- EventAgent.DispatchEvent(ConstMessage.FILING_SCORE_CHANGE);
- }
- }
- }
- }
- }
|