From ba1cb23fb257ef1c0150e2d312234a7e96d68bd2 Mon Sep 17 00:00:00 2001 From: zhangshanxue Date: Mon, 25 Nov 2019 22:12:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=94=E6=98=9F=E8=8B=B1=E9=9B=84=E6=88=90?= =?UTF-8?q?=E9=95=BF=E7=A4=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ljsd/jieling/logic/store/BuyGoodsLogic.java | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/store/BuyGoodsLogic.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/store/BuyGoodsLogic.java index 10e9e3507..bce27b86d 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/logic/store/BuyGoodsLogic.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/store/BuyGoodsLogic.java @@ -204,7 +204,13 @@ public class BuyGoodsLogic { int temptype = discountType[0]; int tempvalue = discountType[1]; if(temptype == 4&&tempvalue==5){ - rechargeInfo.removeTypeBagMap(tempvalue); + if (rechargeInfo.getTypeBagMap().containsKey(tempvalue)){ + rechargeInfo.removeTypeBagMap(tempvalue); + } + if (rechargeInfo.getCacheSendedTypes().containsKey(tempvalue)){ + rechargeInfo.getCacheSendedTypes().remove(temptype); + } + List goodsBagInfo = new ArrayList<>(SRechargeCommodityConfig.rechargeCommodityConfigMap.size()); BuyGoodsLogic.getGoodsBagInfo(uid, goodsBagInfo,false); PlayerInfoProto.AllGiftGoodsIndication build = PlayerInfoProto.AllGiftGoodsIndication.newBuilder().addAllGiftGoodsInfo(goodsBagInfo).build(); @@ -346,18 +352,18 @@ public class BuyGoodsLogic { } endTime = startTime + addtime * 3600 * 1000; - if (rechargeInfo.getCacheSendedTypes().containsKey(5)) { - long lasttime = rechargeInfo.getCacheSendedTypes().get(5); + if (rechargeInfo.getCacheSendedTypes().containsKey(value)) { + long lasttime = rechargeInfo.getCacheSendedTypes().get(value); if(lasttime != startTime){ needChange = true; int diffHourTemp = (int) ((now - lasttime) / 3600 / 1000); if (diffHourTemp < addtime) { startTime =0; } - rechargeInfo.getCacheSendedTypes().put(5, System.currentTimeMillis()); + rechargeInfo.getCacheSendedTypes().put(value, System.currentTimeMillis()); } }else { - rechargeInfo.getCacheSendedTypes().put(5, System.currentTimeMillis()); + rechargeInfo.getCacheSendedTypes().put(value, System.currentTimeMillis()); } }