| 123456789101112131415161718192021222324252627282930313233343536373839404142434445 | using ET;namespace GFGGame{    public class LuckyBoxSProxy    {        //抽奖        public static async ETTask<bool> ReqGetBonus(int luckyBoxId, int times)        {            M2C_DrawLuckyBox response = null;            response = (M2C_DrawLuckyBox)await MessageHelper.SendToServer(new C2M_DrawLuckyBox() { LuckyBoxId = luckyBoxId, Times = times });            if (response != null)            {                if (response.Error == ErrorCode.ERR_Success)                {                    ActivityOpenCfg activityOpenCfg = ActivityOpenCfgArray.Instance.GetCfg(ActivityDataManager.Instance.actLuckyBoxId);                    if (activityOpenCfg != null && activityOpenCfg.paramsArr[0] == luckyBoxId)                    {                        ActivityDataManager.Instance.allPlayTimes += response.Times;                    }                    LuckyBoxDataManager.Instance.times = response.Times;                    LuckyBoxDataManager.Instance.luckyBoxId = response.LuckyBoxId;                    LuckyBoxDataManager.Instance.RewardList = ItemUtil.CreateItemDataList(response.bonusList);                    return true;                }            }            return false;        }        //请求轮换抽奖活动信息        public static async ETTask<int> ReqGetLuckyBoxRotatingInfo()        {            S2C_GetLuckyBoxRotatingInfo response = null;            response = (S2C_GetLuckyBoxRotatingInfo)await MessageHelper.SendToServer(new C2S_GetLuckyBoxRotatingInfo() { });            if (response != null)            {                if (response.Error == ErrorCode.ERR_Success)                {                    return response.RotatingId;                }            }            return 0;        }    }}
 |