|
@@ -1,5 +1,21 @@
|
|
|
using System.Collections.Generic;
|
|
|
using ET;
|
|
|
+using GFGGame;
|
|
|
+
|
|
|
+namespace ET
|
|
|
+{
|
|
|
+ public class S2C_SyncRechargeItemGetHandler : AMHandler<S2C_SyncRechargeItemGet>
|
|
|
+ {
|
|
|
+ protected override async ETTask Run(Session session, S2C_SyncRechargeItemGet message)
|
|
|
+ {
|
|
|
+ var dTime = TimeHelper.ServerNow() - message.OrderTime;
|
|
|
+ if(dTime <= 5000)
|
|
|
+ {
|
|
|
+ ShopSProxy.OnBuySuccess(message.BuyId, message.Times, message.TotalTimes, false);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
|
|
|
namespace GFGGame
|
|
|
{
|
|
@@ -30,27 +46,39 @@ namespace GFGGame
|
|
|
{
|
|
|
if (response.Error == ErrorCode.ERR_Success)
|
|
|
{
|
|
|
- ShopDataManager.Instance.UpdateGoodsData(response.BuyId, response.TotalTimes);
|
|
|
ShopCfg shopCfg = ShopCfgArray.Instance.GetCfg(response.BuyId);
|
|
|
ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(shopCfg.itemId);
|
|
|
if (shopCfg.costType == CostType.RMB)
|
|
|
{
|
|
|
QDManager.Pay(response.BuyId, response.Times, response.OrderId);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ OnBuySuccess(response.BuyId, response.Times, response.TotalTimes, true);
|
|
|
return true;
|
|
|
}
|
|
|
-
|
|
|
- List<ItemData> itemDatas = ItemUtil.CreateItemDataList(itemCfg.id, response.Times * shopCfg.itemNum);
|
|
|
-
|
|
|
- EventAgent.DispatchEvent(ConstMessage.CONTINUOUS_REBATE_GIFT_SHOP_BUY, shopCfg);
|
|
|
- BonusController.TryShowBonusList(itemDatas);
|
|
|
- EventAgent.DispatchEvent(ConstMessage.SHOP_BUY);
|
|
|
- EventAgent.DispatchEvent(ConstMessage.RED_CHANGE);
|
|
|
- return true;
|
|
|
}
|
|
|
}
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
+ public static void OnBuySuccess(int buyId, int times, int totalTimes, bool showItems)
|
|
|
+ {
|
|
|
+ ShopDataManager.Instance.UpdateGoodsData(buyId, totalTimes);
|
|
|
+ ShopCfg shopCfg = ShopCfgArray.Instance.GetCfg(buyId);
|
|
|
+ ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(shopCfg.itemId);
|
|
|
+
|
|
|
+ EventAgent.DispatchEvent(ConstMessage.CONTINUOUS_REBATE_GIFT_SHOP_BUY, shopCfg);
|
|
|
+ if(showItems)
|
|
|
+ {
|
|
|
+ List<ItemData> itemDatas = ItemUtil.CreateItemDataList(itemCfg.id, times * shopCfg.itemNum);
|
|
|
+ BonusController.TryShowBonusList(itemDatas);
|
|
|
+ }
|
|
|
+ EventAgent.DispatchEvent(ConstMessage.SHOP_BUY);
|
|
|
+ EventAgent.DispatchEvent(ConstMessage.RED_CHANGE);
|
|
|
+ }
|
|
|
+
|
|
|
/**********************************************会员中心**********************************************/
|
|
|
//领取VIP等级礼包
|
|
|
public static async ETTask<bool> ReqGetVipGiftBag(int vipLv)
|