月卡调整,暂存

back_recharge
duhui 2022-06-06 16:31:44 +08:00
parent ea547c2dc1
commit 6f63f03ab0
4 changed files with 25 additions and 36 deletions

View File

@ -251,16 +251,16 @@ public class GetPlayerInfoHandler extends BaseHandler{
// 心愿抽卡 旧玩家兼容
wishOldUserRandomNumInit(user);
//hotfix 月卡
PlayerLogic.getInstance().getMonthCardInfo(user);
int monthline = STableManager.getConfig(SMonthcardConfig.class).get(Global.MONTHCARDID).getPrice();
int lmonthline = STableManager.getConfig(SMonthcardConfig.class).get(Global.LMONTHCARDID).getPrice();
if(newRechargeInfo.getMonthRr()>=monthline&&playerInfoManager.getMonthCard().getOrDefault(1,0)==0){
user.getPlayerInfoManager().getMonthCard().put(Global.MONTHCARDID, (int) (System.currentTimeMillis() / 1000));
}
if(newRechargeInfo.getsMonthRr()>=lmonthline&&playerInfoManager.getMonthCard().getOrDefault(2,0)==0){
user.getPlayerInfoManager().getMonthCard().put(Global.LMONTHCARDID, (int) (System.currentTimeMillis() / 1000));
Poster.getPoster().dispatchEvent(new NewWelfareEvent(user, NewWelfareTypeEnum.RECHARGE_BUY.getType(),Global.LMONTHCARDID));
}
// PlayerLogic.getInstance().getMonthCardInfo(user);
// int monthline = STableManager.getConfig(SMonthcardConfig.class).get(Global.MONTHCARDID).getPrice();
// int lmonthline = STableManager.getConfig(SMonthcardConfig.class).get(Global.LMONTHCARDID).getPrice();
// if(newRechargeInfo.getMonthRr()>=monthline&&playerInfoManager.getMonthCard().getOrDefault(1,0)==0){
// user.getPlayerInfoManager().getMonthCard().put(Global.MONTHCARDID, (int) (System.currentTimeMillis() / 1000));
// }
// if(newRechargeInfo.getsMonthRr()>=lmonthline&&playerInfoManager.getMonthCard().getOrDefault(2,0)==0){
// user.getPlayerInfoManager().getMonthCard().put(Global.LMONTHCARDID, (int) (System.currentTimeMillis() / 1000));
// Poster.getPoster().dispatchEvent(new NewWelfareEvent(user, NewWelfareTypeEnum.RECHARGE_BUY.getType(),Global.LMONTHCARDID));
// }
// 四灵试炼初始化
FourChallengeLogic.getInstance().firstGetTimes(user);

View File

@ -36,7 +36,6 @@ public class MonthTakeDailyHandler extends BaseHandler <PlayerInfoProto.TakeMoth
throw new ErrorCodeException(ErrorCode.CFG_NULL);
}
if(!user.getPlayerInfoManager().getMonthCard().containsKey(proto.getType())){
throw new ErrorCodeException(ErrorCode.newDefineCode("未激活"));
}

View File

@ -236,7 +236,7 @@ public class BuyGoodsNewLogic {
info.setRechargeList(TimeUtils.now(),price);
//处理月卡
user.getPlayerInfoManager().getMonthCard();
activeMonthCard(user,price,info);
activeMonthCard(user,price,config.getId());
//活动
user.getPlayerInfoManager().setRechargedaily(user.getPlayerInfoManager().getRechargedaily()+price);
changeActivity(user,price,info);
@ -485,32 +485,19 @@ public class BuyGoodsNewLogic {
/**
* //TODO 孟某某写的啥玩意 咋兼容老数据 后人注意这块 新加的月卡 策划大大讨论后从0开始计算
*/
public static void activeMonthCard(User user,double price,NewRechargeInfo info){
int monthline = STableManager.getConfig(SMonthcardConfig.class).get(Global.MONTHCARDID).getPrice();
int lmonthline = STableManager.getConfig(SMonthcardConfig.class).get(Global.LMONTHCARDID).getPrice();
int sinceremonthline = STableManager.getConfig(SMonthcardConfig.class).get(Global.SINCERECARDID).getPrice();
boolean sendneed =false;
if(info.getMonthRr()<monthline){
info.setMonthRr(MathUtils.doubleAdd(price,info.getMonthRr()));
if(info.getMonthRr()>=monthline){
sendneed=true;
user.getPlayerInfoManager().putMonthCard(Global.MONTHCARDID, (int) (System.currentTimeMillis() / 1000));
}
}
if(info.getsMonthRr()<lmonthline){
info.setsMonthRr(MathUtils.doubleAdd(price,info.getsMonthRr()));
if(info.getsMonthRr()>=lmonthline){
sendneed=true;
user.getPlayerInfoManager().putMonthCard(Global.LMONTHCARDID, (int) (System.currentTimeMillis() / 1000));
Poster.getPoster().dispatchEvent(new NewWelfareEvent(user, NewWelfareTypeEnum.RECHARGE_BUY.getType(),Global.LMONTHCARDID));
}
}
public static void activeMonthCard(User user,double price,int goodId){
Map<Integer, SMonthcardConfig> monthcardConfigMap = STableManager.getConfig(SMonthcardConfig.class);
if(info.getSinceremonth() < sinceremonthline){
info.setSinceremonth(MathUtils.doubleAdd(price,info.getSinceremonth()));
if(info.getSinceremonth() >= sinceremonthline){
boolean sendneed =false;
for (SMonthcardConfig monthcardConfig : monthcardConfigMap.values()) {
if (goodId == monthcardConfig.getPrice()){
sendneed=true;
user.getPlayerInfoManager().putMonthCard(Global.SINCERECARDID, (int) (System.currentTimeMillis() / 1000));
user.getPlayerInfoManager().putMonthCard(monthcardConfig.getId(), TimeUtils.nowInt());
// 特殊处理
if (monthcardConfig.getId() == Global.LMONTHCARDID){
Poster.getPoster().dispatchEvent(new NewWelfareEvent(user, NewWelfareTypeEnum.RECHARGE_BUY.getType(),Global.LMONTHCARDID));
}
break;
}
}
if(sendneed){

View File

@ -12,6 +12,9 @@ public class SMonthcardConfig implements BaseConfig {
private String name;
/**
* 2022-06-06 id
*/
private int price;
private int[][] baseReward;