离线探索

back_recharge
xuexinpeng 2021-12-30 13:34:34 +08:00
parent bb1bea214f
commit 16fc0ffbbb
1 changed files with 12 additions and 5 deletions

View File

@ -194,27 +194,34 @@ public class ExplorerMapLogic {
} else { } else {
offlineEndTime = keyVal.getValue().getSendEndTime(); offlineEndTime = keyVal.getValue().getSendEndTime();
} }
if (keyVal.getValue().getBatteTime() + 300 >= offlineEndTime) { SExplore exploreConfig = STableManager.getConfig(SExplore.class).get(keyVal.getValue().getMapId());
int battleInterval = exploreConfig.getBattleInterval();
if (exploreConfig == null) {
continue; continue;
} }
for (int i = keyVal.getValue().getBatteTime() + 300; i < offlineEndTime; i = i + 300) { if (keyVal.getValue().getBatteTime() +battleInterval >= offlineEndTime) {
continue;
}
LOGGER.info("离线玩家队伍id",keyVal.getKey());
for (int i = keyVal.getValue().getBatteTime() + battleInterval; i < offlineEndTime; i = i + battleInterval) {
//复活玩家 //复活玩家
if (keyVal.getValue().getPlayerHp() == 0 && keyVal.getValue().getPlayerReliveTime() <= i) { if (keyVal.getValue().getPlayerHp() == 0 && keyVal.getValue().getPlayerReliveTime() <= i) {
int teamForce = HeroLogic.getInstance().calTeamTotalForce(user, keyVal.getKey(), false); int teamForce = HeroLogic.getInstance().calTeamTotalForce(user, keyVal.getKey(), false);
keyVal.getValue().setPlayerHp(teamForce); keyVal.getValue().setPlayerHp(teamForce);
LOGGER.info("复活玩家:"); LOGGER.info("离线复活玩家:"+i);
} }
//复活怪物 //复活怪物
if (keyVal.getValue().getEnemyHp() == 0 && keyVal.getValue().getEnemyReliveTime() <= i) { if (keyVal.getValue().getEnemyHp() == 0 && keyVal.getValue().getEnemyReliveTime() <= i) {
SExplore exploreConfig = STableManager.getConfig(SExplore.class).get(keyVal.getValue().getMapId()); exploreConfig = STableManager.getConfig(SExplore.class).get(keyVal.getValue().getMapId());
if (exploreConfig == null) { if (exploreConfig == null) {
continue; continue;
} }
//怪物的初始血量 //怪物的初始血量
int mapMonsterForce = exploreConfig.getMonsterForce(); int mapMonsterForce = exploreConfig.getMonsterForce();
LOGGER.info("复活怪物:"); LOGGER.info("离线复活怪物:"+i);
keyVal.getValue().setEnemyHp(mapMonsterForce); keyVal.getValue().setEnemyHp(mapMonsterForce);
} }
LOGGER.info("离线战斗:"+i);
singleBattle(user, keyVal.getValue(), keyVal.getKey(), i); singleBattle(user, keyVal.getValue(), keyVal.getKey(), i);
} }
} }