挂机奖励修改

back_recharge
duhui 2021-01-29 10:52:56 +08:00
parent a4dca69532
commit 508eda57d8
2 changed files with 18 additions and 11 deletions

View File

@ -13,16 +13,23 @@ import java.util.Map;
public class MainLevelManager extends MongoBase {
public static final String _COLLECTION_NAME = "mainLevelManager";
private int fightId; // 当前关卡id
private int state; //状态 -1表示有等级卡
private int startTime;// 给前端展示的挂机时长
private int lastTime; //上一个关卡记时时间
// 当前关卡id
private int fightId;
//状态 -1表示有等级卡
private int state;
// 给前端展示的挂机时长
private int startTime;
//上一个关卡记时时间
private int lastTime;
private Map<Integer,Integer> fightStateInfo = new HashMap<>();
private Map<Integer,HashSet<String>> bossIds = new HashMap<>();
public void init(){
this.startTime = (int)(System.currentTimeMillis()/1000);
this.startTime = TimeUtils.nowInt();
this.lastTime = TimeUtils.nowInt();
updateString("startTime",startTime);
updateString("lastTime",lastTime);
updateFight(1011,1);
}
@ -50,11 +57,11 @@ public class MainLevelManager extends MongoBase {
// 更新时间
if(adventureOffline <= times){
times=0;
}else {
// 修改最后时间
updateString("lastTime",TimeUtils.nowInt()+times*adventureRefresh);
}
// 修改最后时间
updateString("lastTime", lastTime + times * adventureRefresh);
fightStateInfo.put(fightId,times);
updateString("fightStateInfo." + fightId,times);
}
@ -70,10 +77,10 @@ public class MainLevelManager extends MongoBase {
}
this.fightId = fightId;
this.state = state;
this.lastTime = TimeUtils.nowInt();
updateString("fightId",fightId);
updateString("state",state);
updateString("lastTime",lastTime);
// this.lastTime = TimeUtils.nowInt();
// updateString("lastTime",lastTime);
}
public void afterTakeStateReward(boolean needReset,int lastTakes,int time){

View File

@ -987,7 +987,7 @@ public class CombatLogic {
MailLogic.getInstance().sendMail(user.getId(),title,content,reward,time, Global.MAIL_EFFECTIVE_TIME);
}
}
mainLevelManager.afterTakeStateReward(true,0,time);
// mainLevelManager.afterTakeStateReward(true,0,time);
myResult = true;
return this;
}