LuckyBoxSProxy.cs 867 B

1234567891011121314151617181920212223242526
  1. using ET;
  2. namespace GFGGame
  3. {
  4. public class LuckyBoxSProxy
  5. {
  6. //抽奖
  7. public static async ETTask<bool> ReqGetBonus(int luckyBoxId, int times)
  8. {
  9. M2C_DrawLuckyBox response = null;
  10. response = (M2C_DrawLuckyBox)await MessageHelper.SendToServer(new C2M_DrawLuckyBox() { LuckyBoxId = luckyBoxId, Times = times });
  11. if (response != null)
  12. {
  13. if (response.Error == ErrorCode.ERR_Success)
  14. {
  15. LuckyBoxDataManager.Instance.times = response.Times;
  16. LuckyBoxDataManager.Instance.luckyBoxId = response.LuckyBoxId;
  17. LuckyBoxDataManager.Instance.RewardList = ItemUtil.CreateItemDataList(response.bonusList);
  18. return true;
  19. }
  20. }
  21. return false;
  22. }
  23. }
  24. }