| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- using System.Collections.Generic;
- using ET;
- namespace GFGGame
- {
- public static class EnduringGiftBoxSProxy
- {
- //获取已经领取的返利物品ids
- public static async ETTask<bool> ReqGetAllGiftBagRebateStatus()
- {
- S2C_GetAllGiftBagRebateStatus response = null;
- response = (S2C_GetAllGiftBagRebateStatus)await MessageHelper.SendToServer(
- new C2S_GetAllGiftBagRebateStatus() { });
- if (response != null)
- {
- if (response.Error == ErrorCode.ERR_Success)
- {
- EnduringGiftBoxDataManager.Instance.Clear();
- foreach (var item in response.DayAllItemResidues)
- {
- EnduringGiftBoxDataManager.Instance.UpDayAllRebateItemDic(item.ItemId, item.ResidueNum);
- }
- foreach (var item in response.ItemIds)
- {
- EnduringGiftBoxDataManager.Instance.AddDayRebateItemIds(item);
- }
- return true;
- }
- }
- return false;
- }
- //请求领取连续返利礼包--的返利
- public static async ETTask<bool> ReqGetGiftBagRebate(int shopId)
- {
- S2C_GiftBagRebate response = null;
- response = (S2C_GiftBagRebate)await MessageHelper.SendToServer(
- new C2S_GetGiftBagRebate() { ShopId = shopId });
- if (response != null)
- {
- if (response.Error == ErrorCode.ERR_Success)
- {
- var itemDataList = ItemUtil.CreateItemDataList(response.ItemList);
- BonusController.TryShowBonusList(itemDataList);
- EnduringGiftBoxDataManager.Instance.UpDayRebateInfo(CommonDataManager.Tables.TblShopCfg
- .GetOrDefault(shopId)
- .ItemId);
- EventAgent.DispatchEvent(ConstMessage.CONTINUOUS_REBATE_GIFT);
- return true;
- }
- }
- return false;
- }
- }
- }
|