| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 | using ET;using GFGGame;namespace ET{    public class M2C_NoticeUnitLimitPlayTimesHandler : AMHandler<M2C_NoticeUnitLimitPlayTimes>    {        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)                {                    //数据会通过通用推送协议另外推送                }            }        }    }}
 |