using ET; namespace GFGGame { public class ShopSProxy { // public static async ETTask ShopBuy(int shopType, int buyId, long buyCount) // { // M2C_ShopBuy response = null; // response = (M2C_ShopBuy)await MessageHelper.SendToServer(new C2M_ShopBuy() { ShopType = shopType, BuyId = buyId, BuyCount = (int)buyCount }); // if (response != null) // { // if (response.Error == ErrorCode.ERR_Success) // { // // EventAgent.DispatchEvent(ConstMessage.SHOP_BUY); // return true; // } // } // return false; // } public static async ETTask ReqShopInfo() { S2C_RequestShopInfo response = null; response = (S2C_RequestShopInfo)await MessageHelper.SendToServer(new C2S_RequestShopInfo()); if (response != null) { if (response.Error == ErrorCode.ERR_Success) { for (int i = 0; i < response.ks.Count; i++) { ShopDataManager.Instance.UpdateGiftData(response.ks[i], response.vs[i]); } return true; } } return false; } public static async ETTask ReqShopBuy(int buyId, long buyCount) { S2C_ShopBuy response = null; response = (S2C_ShopBuy)await MessageHelper.SendToServer(new C2S_ShopBuy() { BuyId = buyId, Times = (int)buyCount }); if (response != null) { if (response.Error == ErrorCode.ERR_Success) { ShopDataManager.Instance.UpdateGiftData(response.BuyId, response.TotalTimes); return true; } } return false; } } }