LuckyBoxSProxy.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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. public static async ETTask<int> ReqGetLuckyBoxRotatingInfo()
  25. {
  26. S2C_GetLuckyBoxRotatingInfo response = null;
  27. response = (S2C_GetLuckyBoxRotatingInfo)await MessageHelper.SendToServer(new C2S_GetLuckyBoxRotatingInfo() { });
  28. if (response != null)
  29. {
  30. if (response.Error == ErrorCode.ERR_Success)
  31. {
  32. return response.RotatingId;
  33. }
  34. }
  35. return 0;
  36. }
  37. }
  38. }