|
@@ -1,5 +1,18 @@
|
|
|
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;
|
|
|
+ ShopSProxy.OnBuySuccess(message.BuyId, message.Times, message.TotalTimes, dTime <= 5000);
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
|
|
|
namespace GFGGame
|
|
|
{
|
|
@@ -30,35 +43,45 @@ 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 (LauncherConfig.netType == LauncherConfig.EnumNetType.LOCAL && shopCfg.costType == CostType.RMB)
|
|
|
+ if (shopCfg.costType == CostType.RMB)
|
|
|
{
|
|
|
- PromptController.Instance.ShowFloatTextPrompt("虚拟充值成功");
|
|
|
- }
|
|
|
-
|
|
|
- List<ItemData> itemDatas;
|
|
|
- if (itemCfg.itemType == ConstItemType.USEABLE &&
|
|
|
- (itemCfg.subType == ConstItemSubType.USEABLE_AUTO))
|
|
|
- {
|
|
|
- itemDatas = ItemUtil.CreateItemDataList(itemCfg.itemsArr, response.Times * shopCfg.itemNum);
|
|
|
+ QDManager.Pay(response.BuyId, response.Times, response.OrderId, response.Price);
|
|
|
+ return false;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- itemDatas = ItemUtil.CreateItemDataList(itemCfg.id, response.Times * shopCfg.itemNum);
|
|
|
+ OnBuySuccess(response.BuyId, response.Times, response.TotalTimes, true);
|
|
|
+ return true;
|
|
|
}
|
|
|
-
|
|
|
- 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)
|
|
|
+ {
|
|
|
+ //判断倍数
|
|
|
+ var multiple = 1;
|
|
|
+ if (totalTimes <= shopCfg.doubleTimes)
|
|
|
+ {
|
|
|
+ multiple = 2;
|
|
|
+ }
|
|
|
+ List<ItemData> itemDatas = ItemUtil.CreateItemDataList(itemCfg.id, times * shopCfg.itemNum* multiple);
|
|
|
+ BonusController.TryShowBonusList(itemDatas);
|
|
|
+ }
|
|
|
+ EventAgent.DispatchEvent(ConstMessage.SHOP_BUY);
|
|
|
+ EventAgent.DispatchEvent(ConstMessage.RED_CHANGE);
|
|
|
+ }
|
|
|
+
|
|
|
/**********************************************会员中心**********************************************/
|
|
|
//领取VIP等级礼包
|
|
|
public static async ETTask<bool> ReqGetVipGiftBag(int vipLv)
|