海外支付不校验金额

master_yuenan
DESKTOP-C3M45P4\dengdan 2025-02-19 16:18:38 +08:00
parent 9581b76101
commit e3dc7a8f0b
2 changed files with 18 additions and 9 deletions

View File

@ -284,9 +284,12 @@ public class BuyGoodsNewLogic {
return resultRes;
}
SRechargeCommodityNewConfig config = null;
boolean checkAmount = true;
//不是数字通过rechareId获取配置,海外渠道商品id为字符串类型
if (!StringUtil.isNumeric(sdkGoodsId)){
config = SRechargeCommodityNewConfig.sdkconfigMap.get(sdkGoodsId);
//海外货币种类太多,不校验金额
checkAmount = false;
}else {
config = SRechargeCommodityNewConfig.configMap.get(Integer.parseInt(sdkGoodsId));
}
@ -297,16 +300,20 @@ public class BuyGoodsNewLogic {
}
int goodsId = config.getId();
double price = 0;
// 支付金额用分
double priceTemp = config.getPrice();
int cfgType = SSpecialConfig.getIntegerValue("exchange_focus_type");
double price = priceTemp==0?0: SExchangeRate.doubleIntegerHashMap.get(cfgType).get((int)priceTemp);
if(amount != price*100){
resultRes.setResultMsg("compared amount fail");
LOGGER.error("sendGoods 金额校验失败, uid={}, goodId={}, amount={}, price={}",uid,goodsId, amount, price*100);
return resultRes;
if(checkAmount){
double priceTemp = config.getPrice();
int cfgType = SSpecialConfig.getIntegerValue("exchange_focus_type");
price = priceTemp==0?0: SExchangeRate.doubleIntegerHashMap.get(cfgType).get((int)priceTemp);
if(amount != price*100){
resultRes.setResultMsg("compared amount fail");
LOGGER.error("sendGoods 金额校验失败, uid={}, goodId={}, amount={}, price={}",uid,goodsId, amount, price*100);
return resultRes;
}
}
User user = UserManager.getUser(uid);
if (user == null) {
resultRes.setResultMsg("User not found");
@ -339,7 +346,9 @@ public class BuyGoodsNewLogic {
//处理月卡
activeMonthCard(user,config.getId());
//活动
changeActivity(user,price,rechargeInfo);
if(price > 0) {
changeActivity(user, price, rechargeInfo);
}
}
if(getFirstRechargeTime(uid) == 0){
setFirstRecharge(uid);

View File

@ -42,7 +42,7 @@ public class ProtocolsManager implements ProtocolsAbstract {
private static ProtocolsManager instance = new ProtocolsManager();
private Map<Integer, BaseHandler> handlers = new HashMap<>();
private static ClassLoader classLoader = GameApplication.class.getClassLoader();
public static int HANDLER_THREAD_NUM = 10;
public static int HANDLER_THREAD_NUM = 8;
public static HandlerLogicThread[] handlerThreads;
static {