MainStorySProxy.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using ET;
  2. using GFGGame;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. namespace ET
  9. {
  10. public class M2C_NoticeMainStoryBoxBonusStateHandler : AMHandler<M2C_NoticeMainStoryBoxBonusState>
  11. {
  12. protected override async ETTask Run(Session session, M2C_NoticeMainStoryBoxBonusState message)
  13. {
  14. var levelCfg = StoryLevelCfgArray.Instance.GetCfg(message.LevelCfgId);
  15. MainStoryDataManager.UpdateBoxBonusStates(levelCfg.chapterId, message.BoxStates);
  16. await ETTask.CompletedTask;
  17. }
  18. }
  19. }
  20. namespace GFGGame
  21. {
  22. public class MainStorySProxy
  23. {
  24. //请求剧情关卡数据
  25. public static async ETTask GetStoryInfos()
  26. {
  27. M2C_GetMainStoryInfos response = null;
  28. response = (M2C_GetMainStoryInfos)await MessageHelper.SendToServer(new C2M_GetMainStoryInfos());
  29. if (response != null)
  30. {
  31. if (response.Error == ErrorCode.ERR_Success)
  32. {
  33. MainStoryDataManager.InitBoxBonusStates(response.ksBonusState, response.vsBonusState);
  34. }
  35. }
  36. }
  37. }
  38. }