StudioSProxy.cs 3.1 KB

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