| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 | using ET;using GFGGame;using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace ET{    public class M2C_NoticeMainStoryBoxBonusStateHandler : AMHandler<M2C_NoticeMainStoryBoxBonusState>    {        protected override async ETTask Run(Session session, M2C_NoticeMainStoryBoxBonusState message)        {            MainStoryDataManager.UpdateBoxBonusStates(message.ChapterId, message.BoxStates);            EventAgent.DispatchEvent(ConstMessage.NOTICE_MAINSTORY_BOXBONUS_STATE);            await ETTask.CompletedTask;        }    }}namespace GFGGame{    public class MainStorySProxy    {        //请求剧情关卡数据        public static async ETTask GetStoryInfos()        {            M2C_GetMainStoryInfos response = null;            response = (M2C_GetMainStoryInfos)await MessageHelper.SendToServer(new C2M_GetMainStoryInfos());            if (response != null)            {                if (response.Error == ErrorCode.ERR_Success)                {                    MainStoryDataManager.InitBoxBonusStates(response.KsBonusState, response.VsBonusState);                }            }        }        //请求剧情关卡数据        public static async ETTask<bool> GetMainStoryBoxBonus(int chapterId, int index)        {            M2C_GetMainStoryBoxBonus response = null;            response = (M2C_GetMainStoryBoxBonus)await MessageHelper.SendToServer(new C2M_GetMainStoryBoxBonus() { ChapterId = chapterId, Index = index });            if (response != null)            {                if (response.Error == ErrorCode.ERR_Success)                {                    MainStoryDataManager.UpdateBoxBonusStates(response.ChapterId, response.BoxStates);                    return true;                }            }            return false;        }    }}
 |