StudioSProxy.cs 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. using System.Collections.Generic;
  2. using ET;
  3. using GFGGame;
  4. namespace ET
  5. {
  6. public class NoticeFilingScoreBonusChanged : AMHandler<S2C_FilingScoreBonusChanged>
  7. {
  8. protected override async ETTask Run(Session session, S2C_FilingScoreBonusChanged message)
  9. {
  10. StudioDataManager.Instance.NoticeFilingScoreBonusChanged(message.ChapterId, message.ChapterScore, message.BonusStatusList);
  11. EventAgent.DispatchEvent(ConstMessage.FILING_SCORE_CHANGE);
  12. EventAgent.DispatchEvent(ConstMessage.RED_CHANGE);
  13. await ETTask.CompletedTask;
  14. }
  15. }
  16. }
  17. namespace GFGGame
  18. {
  19. public class StudioSProxy
  20. {
  21. //请求工作室副本数据
  22. public static async ETTask ReqStudioInfos()
  23. {
  24. M2C_GetStudioInfos response = null;
  25. response = (M2C_GetStudioInfos)await MessageHelper.SendToServer(new C2M_GetStudioInfos());
  26. if (response != null)
  27. {
  28. if (response.Error == ErrorCode.ERR_Success)
  29. {
  30. for (int i = 0; i < response.infos.Count; i++)
  31. {
  32. StudioData studioData = new StudioData { ChapterId = response.infos[i].ChapterId, ChapterScore = response.infos[i].ChapterScore, RewardsStatus = response.infos[i].BonusStatusList };
  33. StudioDataManager.Instance.RspStudioInfos(studioData);
  34. }
  35. StudioDataManager.Instance.PorcelainTheme = response.RepairPorcelainTheme;
  36. }
  37. }
  38. }
  39. //领取查阅建档分数宝箱
  40. public static async ETTask ReqFilingScoreRewards(int chapterId)
  41. {
  42. S2C_GetFilingScoreBonus response = null;
  43. response = (S2C_GetFilingScoreBonus)await MessageHelper.SendToServer(new C2S_GetFilingScoreBonus() { ChapterId = chapterId });
  44. if (response != null)
  45. {
  46. if (response.Error == ErrorCode.ERR_Success)
  47. {
  48. List<ItemData> itemDatas = new List<ItemData>();
  49. for (int i = 0; i < response.BonusIndexList.Count; i++)
  50. {
  51. StudioDataManager.Instance.RspFilingScoreReward(response.ChapterId, response.BonusIndexList[i]);
  52. List<FilingRewardCfg> filingRewards = FilingRewardCfgArray.Instance.GetCfgsByid(response.ChapterId);
  53. int[][] rewards = filingRewards[response.BonusIndexList[i]].itemsArr;
  54. for (int j = 0; j < rewards.Length; j++)
  55. {
  56. itemDatas.Add(ItemUtil.createItemData(rewards[j]));
  57. }
  58. }
  59. BonusController.TryShowBonusList(itemDatas);
  60. EventAgent.DispatchEvent(ConstMessage.FILING_SCORE_CHANGE);
  61. EventAgent.DispatchEvent(ConstMessage.RED_CHANGE);
  62. }
  63. }
  64. }
  65. }
  66. }