| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- using System.Collections.Generic;
- using cfg.GfgCfg;
- using ET;
- namespace GFGGame
- {
- public static class DailyWelfareSProxy
- {
- //每日签到
- public static async ETTask<bool> ReqSign(int taskId)
- {
- S2C_Sign response = null;
- response = (S2C_Sign)await MessageHelper.SendToServer(new C2S_Sign());
- if (response != null)
- {
- if (response.Error == ErrorCode.ERR_Success)
- {
- // DailyWelfareManager.Instance.DailySignDatas.Add(DateTime.Now.Day);
- List<ItemData> bonus = ItemUtil.CreateItemDataList(response.reward);
- BonusController.TryShowBonusList(bonus);
- EventAgent.DispatchEvent(ConstMessage.RED_CHANGE);
- return true;
- }
- }
- return false;
- }
- //补签
- public static async ETTask<bool> ReqReSign(int day, int type)
- {
- S2C_ReSign response = null;
- response = (S2C_ReSign)await MessageHelper.SendToServer(new C2S_ReSign() { Day = day, ConsumeType = type });
- if (response != null)
- {
- if (response.Error == ErrorCode.ERR_Success)
- {
- // DailyWelfareManager.Instance.DailySignDatas.Add(day);
- List<ItemData> bonus = ItemUtil.CreateItemDataList(response.reward);
- BonusController.TryShowBonusList(bonus);
- return true;
- }
- }
- return false;
- }
- //领取签到累计奖励
- public static async ETTask<bool> ReqGetSignReward(int day)
- {
- S2C_GetSignReward response = null;
- response = (S2C_GetSignReward)await MessageHelper.SendToServer(new C2S_GetSignReward() { Day = day });
- if (response != null)
- {
- if (response.Error == ErrorCode.ERR_Success)
- {
- // DailyWelfareManager.Instance.AccumulatedSignDatas.Add(day);
- List<ItemData> bonus = ItemUtil.CreateItemDataList(response.reward);
- BonusController.TryShowBonusList(bonus);
- EventAgent.DispatchEvent(ConstMessage.RED_CHANGE);
- return true;
- }
- }
- return false;
- }
- //领取/补领每日补给
- public static async ETTask<bool> ReqGetSupplyReward(int id)
- {
- S2C_GetSupplyReward response = null;
- response = (S2C_GetSupplyReward)await MessageHelper.SendToServer(new C2S_GetSupplyReward() { Id = id });
- if (response != null)
- {
- if (response.Error == ErrorCode.ERR_Success)
- {
- // DailyWelfareManager.Instance.SupplyRewardDatas.Add(id);
- DailySupplyCfg supplyCfg = CommonDataManager.Tables.TblDailySupplyCfg.GetOrDefault(id);
- BonusController.TryShowBonusList(supplyCfg.Bonus.ToGfgGameItemParam());
- EventAgent.DispatchEvent(ConstMessage.RED_CHANGE);
- return true;
- }
- }
- return false;
- }
- }
- }
|