using ET; using GFGGame; namespace ET { public class M2C_NoticeUnitLimitPlayTimesHandler : AMHandler { protected override async ETTask Run(Session session, M2C_NoticeUnitLimitPlayTimes message) { RoleLimitDataManager.UpdateLimitData(message.UnitLimitInfo); await ETTask.CompletedTask; } } } namespace GFGGame { public class RoleLimitSProxy { public static async ETTask ReqUnitLimitInfos() { S2C_GetUnitLimitInfos response = null; response = (S2C_GetUnitLimitInfos)await MessageHelper.SendToServer(new C2S_GetUnitLimitInfos()); if (response != null) { if (response.Error == ErrorCode.ERR_Success) { RoleLimitDataManager.InitServerData(response.UnitLimitInfos); } } } //请求购买次数 public static async ETTask ReqBuyLimitPlayTimes(int chapterId, int buyType, int buyCount) { M2C_BuyUnitLimitPlayTimes response = null; response = (M2C_BuyUnitLimitPlayTimes)await MessageHelper.SendToServer(new C2M_BuyUnitLimitPlayTimes() { LimitId = chapterId, BuyType = buyType, BuyCount = buyCount }); if (response != null) { if (response.Error == ErrorCode.ERR_Success) { //数据会通过通用推送协议另外推送 } } } } }