新增挚礼月卡

xuexinpeng 2021-10-29 00:14:33 +08:00
parent d435e81ffc
commit cf11f25859
5 changed files with 40 additions and 5 deletions

View File

@ -76,4 +76,5 @@ public interface Global {
int MONTHCARDID =1;//1月卡 int MONTHCARDID =1;//1月卡
int LMONTHCARDID =2;//2豪华月卡 int LMONTHCARDID =2;//2豪华月卡
int SINCERECARDID =3;//3挚礼月卡
} }

View File

@ -373,6 +373,18 @@ public class CrossYuxulundaoChallengeHandler extends BaseHandler<ArenaInfoProto.
Map<Integer, List<TeamPosHeroInfo>> teamPosForHero = user.getTeamPosManager().getTeamPosForHero(); Map<Integer, List<TeamPosHeroInfo>> teamPosForHero = user.getTeamPosManager().getTeamPosForHero();
if(!teamPosForHero.containsKey(myteamId[i]) || teamPosForHero.get(myteamId[i]).size() == 0){ if(!teamPosForHero.containsKey(myteamId[i]) || teamPosForHero.get(myteamId[i]).size() == 0){
result[i] = 0; result[i] = 0;
CommonProto.FightTeamInfo defteamInfo = FightUtil.makeCrossPersonData(csPlayer, defTeamId[i], arenaRecord, crossArenaManager);
CommonProto.FightData build = CommonProto.FightData.newBuilder()
.addMonsterList(defteamInfo).build();
//数据互换
byte[] snapRecord = build.toByteArray();
if (i == 0) {
arenaRecord.setYxldFightData1(snapRecord);
} else if (i == 1) {
arenaRecord.setYxldFightData2(snapRecord);
} else if (i == 2) {
arenaRecord.setYxldFightData3(snapRecord);
}
if (GameApplication.serverId == csPlayer.getServerId()) { if (GameApplication.serverId == csPlayer.getServerId()) {
User defuser = UserManager.getUser(csPlayer.getUserId()); User defuser = UserManager.getUser(csPlayer.getUserId());
int addforce = HeroLogic.getInstance().calTeamTotalForce(defuser, myteamId[i], false); int addforce = HeroLogic.getInstance().calTeamTotalForce(defuser, myteamId[i], false);

View File

@ -915,6 +915,8 @@ public class PlayerManager extends MongoBase {
newRechargeInfo.setMonthRr(0); newRechargeInfo.setMonthRr(0);
}else if(key ==Global.LMONTHCARDID){ }else if(key ==Global.LMONTHCARDID){
newRechargeInfo.setsMonthRr(0); newRechargeInfo.setsMonthRr(0);
}else if(key ==Global.SINCERECARDID){
newRechargeInfo.setSinceremonth(0);
} }
} }
} }

View File

@ -406,11 +406,12 @@ public class BuyGoodsNewLogic {
} }
/** /**
* * //TODO 孟某某写的啥玩意 咋兼容老数据 后人注意这块 新加的月卡 策划大大讨论后从0开始计算
*/ */
public static void activeMonthCard(User user,double price,NewRechargeInfo info){ public static void activeMonthCard(User user,double price,NewRechargeInfo info){
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();
int sinceremonthline = STableManager.getConfig(SMonthcardConfig.class).get(Global.SINCERECARDID).getPrice();
boolean sendneed =false; boolean sendneed =false;
if(info.getMonthRr()<monthline){ if(info.getMonthRr()<monthline){
info.setMonthRr(MathUtils.doubleAdd(price,info.getMonthRr())); info.setMonthRr(MathUtils.doubleAdd(price,info.getMonthRr()));
@ -427,6 +428,14 @@ public class BuyGoodsNewLogic {
Poster.getPoster().dispatchEvent(new NewWelfareEvent(user, NewWelfareTypeEnum.RECHARGE_BUY.getType(),Global.LMONTHCARDID)); Poster.getPoster().dispatchEvent(new NewWelfareEvent(user, NewWelfareTypeEnum.RECHARGE_BUY.getType(),Global.LMONTHCARDID));
} }
} }
if(info.getSinceremonth() < sinceremonthline){
info.setSinceremonth(MathUtils.doubleAdd(price,info.getSinceremonth()));
if(info.getSinceremonth() >= sinceremonthline){
sendneed=true;
user.getPlayerInfoManager().putMonthCard(Global.SINCERECARDID, (int) (System.currentTimeMillis() / 1000));
}
}
if(sendneed){ if(sendneed){
ISession session = OnlineUserManager.sessionMap.get(user.getId()); ISession session = OnlineUserManager.sessionMap.get(user.getId());
if(session!=null){ if(session!=null){

View File

@ -16,6 +16,8 @@ public class NewRechargeInfo extends MongoBase {
private double monthRr ; //月卡累计总额 private double monthRr ; //月卡累计总额
private double sMonthRr ; //豪华月卡累计总额 private double sMonthRr ; //豪华月卡累计总额
private double sinceremonth ; //挚礼月卡累计总额
private boolean isFirst;//是否首冲过 private boolean isFirst;//是否首冲过
private long firstTime;//首冲时间 private long firstTime;//首冲时间
@ -121,6 +123,15 @@ public class NewRechargeInfo extends MongoBase {
updateString("sMonthRr",sMonthRr); updateString("sMonthRr",sMonthRr);
} }
public double getSinceremonth() {
return sinceremonth;
}
public void setSinceremonth(double sinceremonth) {
this.sinceremonth = sinceremonth;
updateString("sinceremonth",sinceremonth);
}
public boolean getIsFirst() { public boolean getIsFirst() {
return isFirst; return isFirst;
} }