月卡调整,暂存

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); wishOldUserRandomNumInit(user);
//hotfix 月卡 //hotfix 月卡
PlayerLogic.getInstance().getMonthCardInfo(user); // PlayerLogic.getInstance().getMonthCardInfo(user);
int monthline = STableManager.getConfig(SMonthcardConfig.class).get(Global.MONTHCARDID).getPrice(); // int monthline = STableManager.getConfig(SMonthcardConfig.class).get(Global.MONTHCARDID).getPrice();
int lmonthline = STableManager.getConfig(SMonthcardConfig.class).get(Global.LMONTHCARDID).getPrice(); // int lmonthline = STableManager.getConfig(SMonthcardConfig.class).get(Global.LMONTHCARDID).getPrice();
if(newRechargeInfo.getMonthRr()>=monthline&&playerInfoManager.getMonthCard().getOrDefault(1,0)==0){ // if(newRechargeInfo.getMonthRr()>=monthline&&playerInfoManager.getMonthCard().getOrDefault(1,0)==0){
user.getPlayerInfoManager().getMonthCard().put(Global.MONTHCARDID, (int) (System.currentTimeMillis() / 1000)); // user.getPlayerInfoManager().getMonthCard().put(Global.MONTHCARDID, (int) (System.currentTimeMillis() / 1000));
} // }
if(newRechargeInfo.getsMonthRr()>=lmonthline&&playerInfoManager.getMonthCard().getOrDefault(2,0)==0){ // if(newRechargeInfo.getsMonthRr()>=lmonthline&&playerInfoManager.getMonthCard().getOrDefault(2,0)==0){
user.getPlayerInfoManager().getMonthCard().put(Global.LMONTHCARDID, (int) (System.currentTimeMillis() / 1000)); // user.getPlayerInfoManager().getMonthCard().put(Global.LMONTHCARDID, (int) (System.currentTimeMillis() / 1000));
Poster.getPoster().dispatchEvent(new NewWelfareEvent(user, NewWelfareTypeEnum.RECHARGE_BUY.getType(),Global.LMONTHCARDID)); // Poster.getPoster().dispatchEvent(new NewWelfareEvent(user, NewWelfareTypeEnum.RECHARGE_BUY.getType(),Global.LMONTHCARDID));
} // }
// 四灵试炼初始化 // 四灵试炼初始化
FourChallengeLogic.getInstance().firstGetTimes(user); FourChallengeLogic.getInstance().firstGetTimes(user);

View File

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

View File

@ -236,7 +236,7 @@ public class BuyGoodsNewLogic {
info.setRechargeList(TimeUtils.now(),price); info.setRechargeList(TimeUtils.now(),price);
//处理月卡 //处理月卡
user.getPlayerInfoManager().getMonthCard(); user.getPlayerInfoManager().getMonthCard();
activeMonthCard(user,price,info); activeMonthCard(user,price,config.getId());
//活动 //活动
user.getPlayerInfoManager().setRechargedaily(user.getPlayerInfoManager().getRechargedaily()+price); user.getPlayerInfoManager().setRechargedaily(user.getPlayerInfoManager().getRechargedaily()+price);
changeActivity(user,price,info); changeActivity(user,price,info);
@ -485,32 +485,19 @@ public class BuyGoodsNewLogic {
/** /**
* //TODO 孟某某写的啥玩意 咋兼容老数据 后人注意这块 新加的月卡 策划大大讨论后从0开始计算 * //TODO 孟某某写的啥玩意 咋兼容老数据 后人注意这块 新加的月卡 策划大大讨论后从0开始计算
*/ */
public static void activeMonthCard(User user,double price,NewRechargeInfo info){ public static void activeMonthCard(User user,double price,int goodId){
int monthline = STableManager.getConfig(SMonthcardConfig.class).get(Global.MONTHCARDID).getPrice(); Map<Integer, SMonthcardConfig> monthcardConfigMap = STableManager.getConfig(SMonthcardConfig.class);
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));
}
}
if(info.getSinceremonth() < sinceremonthline){ boolean sendneed =false;
info.setSinceremonth(MathUtils.doubleAdd(price,info.getSinceremonth())); for (SMonthcardConfig monthcardConfig : monthcardConfigMap.values()) {
if(info.getSinceremonth() >= sinceremonthline){ if (goodId == monthcardConfig.getPrice()){
sendneed=true; 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){ if(sendneed){

View File

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