123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- using System;
- using System.Collections.Generic;
- using Assets.Game.HotUpdate.Data;
- using ET;
- namespace GFGGame
- {
- public class ActivityNPCRewardProtoHandler : AMHandler<S2C_PushNpcVisits>
- {
- protected override async ETTask Run(Session session, S2C_PushNpcVisits message)
- {
- MiniGameDateManager.Instance.NpcInfoList = message.NpcVisits;
- await ETTask.CompletedTask;
- }
- }
- public class ActivityTeaSProxy
- {
- public static async ETTask<bool> ReqGetNPCVisitInfo(int id)
- {
- var response = (S2C_GetNpcVisits) await MessageHelper.SendToServer(new C2S_GetNpcVisits { ActivityId = id });
- if (!(response is { Error: ErrorCode.ERR_Success })) return false;
- MiniGameDateManager.Instance.NpcInfoList = response.NpcVisits;
- return true;
- }
- public static async ETTask<bool> ReqUnLockNPCVisit(int id,int npcid)
- {
- var response = (S2C_UnlockNpcVisit)await MessageHelper.SendToServer(new C2S_UnlockNpcVisit { ActivityId = id , NpcId = npcid});
- if (!(response is { Error: ErrorCode.ERR_Success })) return false;
- MiniGameDateManager.Instance.NpcInfoList = response.NpcVisits;
- return true;
- }
- public static async ETTask<bool> ReqGetNPCVisitReward(int id, int npcid)
- {
- var response = (S2C_GetNpcVisitRewrd)await MessageHelper.SendToServer(new C2S_GetNpcVisitRewrd { ActivityId = id, NpcId = npcid });
- if (!(response is { Error: ErrorCode.ERR_Success })) return false;
- // 奖励弹窗
- BonusController.TryShowBonusList(ItemUtil.CreateItemDataList(response.BonusList));
- MiniGameDateManager.Instance.NpcInfoList = response.NpcVisits;
- return true;
- }
- //获取合成列表
- public static async ETTask<bool> ReqGetItemSyntheticInfos(int activityId)
- {
- S2C_GetItemSyntheticInfos response = null;
- response = (S2C_GetItemSyntheticInfos)await MessageHelper.SendToServer(new C2S_GetItemSyntheticInfos() { ActivityId = activityId });
- if (response != null)
- {
- if (response.Error == ErrorCode.ERR_Success)
- {
- ActivityTeaDataManager.Instance.ItemSynthetics = response.ItemSynthetics;
- return true;
- }
- }
- return false;
- }
- //部件合成
- public static async ETTask<bool> ReqItemSynthetic(int activityId ,int itemId)
- {
- S2C_ItemSynthetic response = null;
- response = (S2C_ItemSynthetic)await MessageHelper.SendToServer(new C2S_ItemSynthetic() { ActivityId = activityId,ItemId = itemId });
- if (response != null)
- {
- if (response.Error == ErrorCode.ERR_Success)
- {
- //ActivityTeaDataManager.Instance.ItemSynthetics = response.ItemSynthetics;
- BonusController.TryShowBonusList(ItemUtil.CreateItemDataList(response.BonusList));
- return true;
- }
- }
- return false;
- }
- }
- }
|