商店购买提示修改

back_recharge
duhui 2022-09-09 17:09:14 +08:00
parent 85943157a9
commit 3f66ac83b5
1 changed files with 4 additions and 20 deletions

View File

@ -596,20 +596,11 @@ public class StoreLogic implements IEventHandler {
throw new ErrorCodeException(ErrorCode.SHOP_XIA_JIA); throw new ErrorCodeException(ErrorCode.SHOP_XIA_JIA);
} }
StoreInfo storeInfo = storeInfoMap.get(storeId); StoreInfo storeInfo = storeInfoMap.get(storeId);
Map<Integer, Integer> itemNumMap =storeInfo.getItemNumMap(); Map<Integer, Integer> itemNumMap = storeInfo.getItemNumMap();
if (!itemNumMap.containsKey(itemId)){ if (!itemNumMap.containsKey(itemId)){
LOGGER.info("buyStoreItem==> uid={},itemId={}",user.getId(),itemId); LOGGER.info("buyStoreItem==> uid={},itemId={}",user.getId(),itemId);
throw new ErrorCodeException(ErrorCode.SHOP_NO_ITEM); throw new ErrorCodeException(ErrorCode.SHOP_NO_ITEM);
} }
// if(storeId==Global.VIPSTORID){
// int vipLeve = user.getPlayerInfoManager().getVipLevel();
// if(vipLeve<(sStoreConfig.getSort()-1)){
// return "vip leve limit";
// }
//// if(user.getPlayerInfoManager().getHadTakeLevelBoxVip().contains(vipLeve)){
//// return "vip time limit 1";
//// }
// }
int[] buyRule = sStoreConfig.getBuyRule(); int[] buyRule = sStoreConfig.getBuyRule();
String err = ""; String err = "";
if (buyRule != null && buyRule.length > 0){ if (buyRule != null && buyRule.length > 0){
@ -645,7 +636,7 @@ public class StoreLogic implements IEventHandler {
int limit = sStoreConfig.getLimit(); int limit = sStoreConfig.getLimit();
int relatedtoVIP = sStoreConfig.getRelatedtoVIP(); int relatedtoVIP = sStoreConfig.getRelatedtoVIP();
if(limit!=0){ if(limit!=0){
boolean check =true; boolean check;
if(relatedtoVIP == 1){ if(relatedtoVIP == 1){
if(limit == 6){ if(limit == 6){
int goodsNum = sStoreConfig.getGoods()[0][1]*itemNum; int goodsNum = sStoreConfig.getGoods()[0][1]*itemNum;
@ -657,21 +648,14 @@ public class StoreLogic implements IEventHandler {
check = limit > buyTimes; check = limit > buyTimes;
} }
if(!check){ if(!check){
throw new ErrorCodeException(ErrorCode.HERO_MAX); throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
} }
} }
int[][] cost = getCost(buyTimes ,itemNum, sStoreConfig.getCost(), sStoreConfig.getPremiumType(),sStoreConfig.getIsDiscount(),sStoreConfig.getDiscountDegree()); int[][] cost = getCost(buyTimes ,itemNum, sStoreConfig.getCost(), sStoreConfig.getPremiumType(),sStoreConfig.getIsDiscount(),sStoreConfig.getDiscountDegree());
boolean result = ItemUtil.itemCost(user, cost,BIReason.BUY_GOODS_CONSUME,storeId); boolean result = ItemUtil.itemCost(user, cost, BIReason.BUY_GOODS_CONSUME, storeId);
if (!result){ if (!result){
throw new ErrorCodeException(ErrorCode.ITEM_NOT_ENOUGH); throw new ErrorCodeException(ErrorCode.ITEM_NOT_ENOUGH);
} }
// if(relatedtoVIP == 1 && limit!=0){
// int updateValue = itemNum;
// if(limit == 6){
// updateValue= sStoreConfig.getGoods()[0][1]*itemNum;
// }
// playerInfoManager.updateVipPrivilage(limit,updateValue);
// }
itemNumMap.put(itemId,buyTimes +itemNum); itemNumMap.put(itemId,buyTimes +itemNum);
storeInfo.setItemNumMap(itemNumMap); storeInfo.setItemNumMap(itemNumMap);
KtEventUtils.onKtEvent(user, ParamEventBean.UserStoreEvent,storeId,itemId,cost[0][0],itemNum,cost[0][1]); KtEventUtils.onKtEvent(user, ParamEventBean.UserStoreEvent,storeId,itemId,cost[0][0],itemNum,cost[0][1]);