RoleLimitSProxy.cs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. using ET;
  2. using GFGGame;
  3. namespace ET
  4. {
  5. public class M2C_NoticeUnitLimitPlayTimesHandler : AMHandler<M2C_NoticeUnitLimitPlayTimes>
  6. {
  7. protected override async ETTask Run(Session session, M2C_NoticeUnitLimitPlayTimes message)
  8. {
  9. RoleLimitDataManager.UpdateLimitData(message.UnitLimitInfo);
  10. await ETTask.CompletedTask;
  11. }
  12. }
  13. }
  14. namespace GFGGame
  15. {
  16. public class RoleLimitSProxy
  17. {
  18. public static async ETTask ReqUnitLimitInfos()
  19. {
  20. S2C_GetUnitLimitInfos response = null;
  21. response = (S2C_GetUnitLimitInfos)await MessageHelper.SendToServer(new C2S_GetUnitLimitInfos());
  22. if (response != null)
  23. {
  24. if (response.Error == ErrorCode.ERR_Success)
  25. {
  26. RoleLimitDataManager.InitServerData(response.UnitLimitInfos);
  27. }
  28. }
  29. }
  30. //请求购买次数
  31. public static async ETTask ReqBuyLimitPlayTimes(int chapterId, int buyType, int buyCount)
  32. {
  33. M2C_BuyUnitLimitPlayTimes response = null;
  34. response = (M2C_BuyUnitLimitPlayTimes)await MessageHelper.SendToServer(new C2M_BuyUnitLimitPlayTimes() { LimitId = chapterId, BuyType = buyType, BuyCount = buyCount });
  35. if (response != null)
  36. {
  37. if (response.Error == ErrorCode.ERR_Success)
  38. {
  39. //数据会通过通用推送协议另外推送
  40. }
  41. }
  42. }
  43. }
  44. }