ActivityTeaSProxy.cs 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. using System;
  2. using System.Collections.Generic;
  3. using Assets.Game.HotUpdate.Data;
  4. using ET;
  5. namespace GFGGame
  6. {
  7. public class ActivityTeaSProxy
  8. {
  9. public static async ETTask<bool> ReqGetNPCVisitInfo(int id)
  10. {
  11. var response = (S2C_GetNpcVisits) await MessageHelper.SendToServer(new C2S_GetNpcVisits { ActivityId = id });
  12. if (!(response is { Error: ErrorCode.ERR_Success })) return false;
  13. //MiniGameDateManager.Instance.NpcInfoList = response.NpcVisits;
  14. return true;
  15. }
  16. public static async ETTask<bool> ReqUnLockNPCVisit(int id,int npcid)
  17. {
  18. var response = (S2C_UnlockNpcVisit)await MessageHelper.SendToServer(new C2S_UnlockNpcVisit { ActivityId = id , NpcId = npcid});
  19. if (!(response is { Error: ErrorCode.ERR_Success })) return false;
  20. //MiniGameDateManager.Instance.NpcInfoList = response.NpcVisits;
  21. return true;
  22. }
  23. public static async ETTask<bool> ReqGetNPCVisitReward(int id, int npcid)
  24. {
  25. var response = (S2C_GetNpcVisitRewrd)await MessageHelper.SendToServer(new C2S_GetNpcVisitRewrd { ActivityId = id, NpcId = npcid });
  26. if (!(response is { Error: ErrorCode.ERR_Success })) return false;
  27. // 奖励弹窗
  28. BonusController.TryShowBonusList(ItemUtil.CreateItemDataList(response.BonusList));
  29. //MiniGameDateManager.Instance.NpcInfoList = response.NpcVisits;
  30. return true;
  31. }
  32. //获取合成列表
  33. public static async ETTask<bool> ReqGetItemSyntheticInfos(int activityId)
  34. {
  35. S2C_GetItemSyntheticInfos response = null;
  36. response = (S2C_GetItemSyntheticInfos)await MessageHelper.SendToServer(new C2S_GetItemSyntheticInfos() { ActivityId = activityId });
  37. if (response != null)
  38. {
  39. if (response.Error == ErrorCode.ERR_Success)
  40. {
  41. ActivityTeaDataManager.Instance.ItemSynthetics = response.ItemSynthetics;
  42. return true;
  43. }
  44. }
  45. return false;
  46. }
  47. //部件合成
  48. public static async ETTask<bool> ReqItemSynthetic(int itemId)
  49. {
  50. S2C_ItemSynthetic response = null;
  51. response = (S2C_ItemSynthetic)await MessageHelper.SendToServer(new C2S_ItemSynthetic() { ItemId = itemId });
  52. if (response != null)
  53. {
  54. if (response.Error == ErrorCode.ERR_Success)
  55. {
  56. //ActivityTeaDataManager.Instance.ItemSynthetics = response.ItemSynthetics;
  57. BonusController.TryShowBonusList(ItemUtil.CreateItemDataList(response.BonusList));
  58. return true;
  59. }
  60. }
  61. return false;
  62. }
  63. }
  64. }