123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- using ET;
- namespace GFGGame
- {
- public class RechargeSProxy
- {
- public static async ETTask ReqRecharge(int rechargeId)
- {
- M2C_Recharge response = null;
- response = (M2C_Recharge)await MessageHelper.SendToServer(new C2M_Recharge() { RechargeId = rechargeId });
- if (response != null)
- {
- if (response.Error == ErrorCode.ERR_Success)
- {
- RechargeDataManager.Instance.UpdateRechargeData(response.RechargeId, response.RechargedTimes);
- PromptController.Instance.ShowFloatTextPrompt("虚拟充值成功", MessageType.SUCCESS);
- }
- }
- }
- public static async ETTask ReqRechargeInfo()
- {
- M2C_GetRechargeInfo response = null;
- response = (M2C_GetRechargeInfo)await MessageHelper.SendToServer(new C2M_GetRechargeInfo() { });
- if (response != null)
- {
- if (response.Error == ErrorCode.ERR_Success)
- {
- for (int i = 0; i < response.ks.Count; i++)
- {
- RechargeDataManager.Instance.UpdateRechargeData(response.ks[i], response.vs[i]);
- }
- }
- }
- }
- public static async ETTask ReqRequestGiftBagInfo()
- {
- M2C_RequestGiftBagInfo response = null;
- response = (M2C_RequestGiftBagInfo)await MessageHelper.SendToServer(new C2M_RequestGiftBagInfo() { });
- if (response != null)
- {
- if (response.Error == ErrorCode.ERR_Success)
- {
- for (int i = 0; i < response.ks.Count; i++)
- {
- RechargeDataManager.Instance.UpdateGiftData(response.ks[i], response.vs[i]);
- }
- }
- }
- }
- public static async ETTask ReqBuyGiftBag(int giftId)
- {
- M2C_BuyGiftBag response = null;
- response = (M2C_BuyGiftBag)await MessageHelper.SendToServer(new C2M_BuyGiftBag() { GiftBagId = giftId });
- if (response != null)
- {
- if (response.Error == ErrorCode.ERR_Success)
- {
- RechargeDataManager.Instance.UpdateGiftData(response.GiftBagId, response.BuyTimes);
- }
- }
- }
- public static async ETTask ReqExchangeInfo(int giftId)
- {
- M2C_RequestShopExchangeInfo response = null;
- response = (M2C_RequestShopExchangeInfo)await MessageHelper.SendToServer(new C2M_RequestShopExchangeInfo() { });
- if (response != null)
- {
- if (response.Error == ErrorCode.ERR_Success)
- {
- for (int i = 0; i < response.ks.Count; i++)
- {
- RechargeDataManager.Instance.UpdateExchangeData(response.ks[i], response.vs[i]);
- }
- }
- }
- }
- public static async ETTask ReqExchangeShopItem(int exchangeId)
- {
- M2C_ExchangeShopItem response = null;
- response = (M2C_ExchangeShopItem)await MessageHelper.SendToServer(new C2M_ExchangeShopItem() { ExchangeId = exchangeId });
- if (response != null)
- {
- if (response.Error == ErrorCode.ERR_Success)
- {
- RechargeDataManager.Instance.UpdateExchangeData(response.ExchangeId, response.ExchangeTimes);
- }
- }
- }
- }
- }
|