SettingSProxy.cs 802 B

123456789101112131415161718192021222324252627
  1. using ET;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using UnityEngine;
  5. namespace GFGGame
  6. {
  7. public class SettingSProxy
  8. {
  9. /// <summary>
  10. /// 发送兑换码验证请求
  11. /// </summary>
  12. /// <param name="code"></param>
  13. /// <returns></returns>
  14. public static async ETTask<bool> ReqGiftCodeInfo(string code)
  15. {
  16. var response = (S2C_RedeemRewards)await MessageHelper.SendToServer(new C2S_RedeemRewards { ActivationCode = code });
  17. if(!(response is { Error: ErrorCode.ERR_Success }))
  18. {
  19. return false;
  20. }
  21. // 奖励弹窗
  22. BonusController.TryShowBonusList(ItemUtil.CreateItemDataList(response.ItemList));
  23. return true;
  24. }
  25. }
  26. }