妖晶购买
parent
bb6b537567
commit
cfbc6e00ef
|
|
@ -189,6 +189,7 @@ public enum ErrorCode implements IErrorCode {
|
||||||
RECHARGE_NUM_NOT(157,"充值金额不足"),
|
RECHARGE_NUM_NOT(157,"充值金额不足"),
|
||||||
BEFORE_CONDITION_NOT(158,"前置条件不足"),
|
BEFORE_CONDITION_NOT(158,"前置条件不足"),
|
||||||
GIFT_NULL_ERROR(160,"礼包不存在"),
|
GIFT_NULL_ERROR(160,"礼包不存在"),
|
||||||
|
GIFT_PRICE_ERROR(161,"礼包需要rmb购买"),
|
||||||
ACCOUNT_ERROR(-104,"帐号异常,被封号"),
|
ACCOUNT_ERROR(-104,"帐号异常,被封号"),
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|
|
||||||
|
|
@ -37,8 +37,12 @@ public class YaoJingBuyHandler extends BaseHandler<PlayerInfoProto.YaoJingBuyReq
|
||||||
if (config == null){
|
if (config == null){
|
||||||
throw new ErrorCodeException(ErrorCode.GIFT_NULL_ERROR);//礼包不存在
|
throw new ErrorCodeException(ErrorCode.GIFT_NULL_ERROR);//礼包不存在
|
||||||
}
|
}
|
||||||
|
int[] priceYaoJing = config.getPriceYaoJing();
|
||||||
|
if (priceYaoJing == null || priceYaoJing.length == 0){
|
||||||
|
throw new ErrorCodeException(ErrorCode.GIFT_PRICE_ERROR);//礼包需要rmb购买
|
||||||
|
}
|
||||||
// 道具是否足够
|
// 道具是否足够
|
||||||
boolean cost = ItemUtil.itemCost(user, new int[][]{config.getPriceYaoJing()}, BIReason.YAOJING_BUY_GOOD_COST, 0);
|
boolean cost = ItemUtil.itemCost(user, new int[][]{priceYaoJing}, BIReason.YAOJING_BUY_GOOD_COST, 0);
|
||||||
if (!cost){
|
if (!cost){
|
||||||
throw new ErrorCodeException(ErrorCode.ITEM_NOT_ENOUGH);
|
throw new ErrorCodeException(ErrorCode.ITEM_NOT_ENOUGH);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue