1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- using ET;
- namespace GFGGame
- {
- public class ShopSProxy
- {
- // public static async ETTask<bool> 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<bool> 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<bool> 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;
- }
- }
- }
|