断线重连玩家处理/log

back_recharge
xuexinpeng 2022-01-14 13:56:52 +08:00
parent 8aa8865f42
commit 129e31c61f
2 changed files with 9 additions and 9 deletions

View File

@ -65,7 +65,6 @@ public class ExplorerMapLogic {
if (explorerInfo == null) {
return;
}
LOGGER.info("开始战斗");
int teamForce = HeroLogic.getInstance().calTeamTotalForce(user, teamId, false);
SExplore exploreConfig = STableManager.getConfig(SExplore.class).get(explorerInfo.getMapId());
if (exploreConfig == null) {
@ -79,7 +78,7 @@ public class ExplorerMapLogic {
if (exploreFightData == null) {
return;
}
LOGGER.info("探索表id:={}", exploreFightData.getId());
LOGGER.info("玩家开始战斗=>{},探索表id:={}",user.getId(),exploreFightData.getId());
//掉血比例
float reduceRatio = exploreFightData.getLoseFight();
//玩家掉血
@ -98,7 +97,6 @@ public class ExplorerMapLogic {
//输赢判断
if (reduceRatio > reduceRatioMonster) {
//怪物赢了 保留血量 下次打
LOGGER.info("怪物赢了:");
explorerInfo.setEnemyHp(explorerInfo.getEnemyHp() - (reduceMonster));
explorerInfo.setPlayerHp(0);
LOGGER.info("怪物掉血:=》{},剩余血量-》{}", reduceMonster, explorerInfo.getEnemyHp());
@ -142,14 +140,13 @@ public class ExplorerMapLogic {
}
LOGGER.info("怪物死亡=》重生时间{}", explorerInfo.getEnemyReliveTime());
}
if (time == 0) {
explorerInfo.setBatteTime(TimeUtils.nowInt() + exploreConfig.getBattleInterval());//设置下次战斗时间
} else {
explorerInfo.setBatteTime(time + exploreConfig.getBattleInterval());//设置下次战斗时间
}
//user.getPlayerInfoManager().addExplorer(explorerInfo, teamId);
LOGGER.info("战斗结束");
LOGGER.info("战斗结束=>{}",user.getId());
}
@ -249,7 +246,7 @@ public class ExplorerMapLogic {
if (keyVal.getValue().getPlayerHp() == 0 && keyVal.getValue().getPlayerReliveTime() <= TimeUtils.nowInt()) {
int teamForce = HeroLogic.getInstance().calTeamTotalForce(user, keyVal.getKey(), false);
keyVal.getValue().setPlayerHp(teamForce);
LOGGER.info("复活玩家:" + uid);
LOGGER.info("玩家=>{}复活,复活队伍是=>{}",uid,keyVal.getKey());
sendIndication(user.getId(),keyVal.getValue(),keyVal.getKey());
}
//复活怪物
@ -258,7 +255,7 @@ public class ExplorerMapLogic {
if (exploreConfig == null) {
continue;
}
LOGGER.info("复活怪物" + uid);
LOGGER.info("玩家=>{}复活,复活队伍是=>{}",uid,exploreConfig.getId());
//怪物的初始血量
int mapMonsterForce = exploreConfig.getMonsterForce();
keyVal.getValue().setEnemyHp(mapMonsterForce);
@ -282,7 +279,7 @@ public class ExplorerMapLogic {
Set<String> set = redisUtil.sGet(key);
if (set.contains(String.valueOf(user.getId()))) {
long remove = RedisUtil.getInstence().setRemove(key, String.valueOf(uid));
LOGGER.info("remove:" + remove);
LOGGER.info("uid=>{},remove:=>{}",uid,remove);
}
} else {
//跨服分组
@ -290,7 +287,7 @@ public class ExplorerMapLogic {
Set<String> set = redisUtil.sGet(RedisKey.EXPLORER_MAP_PLAYER + RedisKey.Delimiter_colon + key);
if (set.contains(String.valueOf(user.getId()))) {
long remove = RedisUtil.getInstence().setRemove(RedisKey.EXPLORER_MAP_PLAYER + RedisKey.Delimiter_colon + key, String.valueOf(uid));
LOGGER.info("remove cross:" + remove);
LOGGER.info("uid=>{},remove cross:=>{}",uid,remove);
}
}

View File

@ -20,6 +20,7 @@ import com.ljsd.jieling.logic.activity.ActivityType;
import com.ljsd.jieling.logic.dao.PlayerManager;
import com.ljsd.jieling.logic.dao.UserManager;
import com.ljsd.jieling.logic.dao.root.User;
import com.ljsd.jieling.logic.explorerMap.ExplorerMapLogic;
import com.ljsd.jieling.logic.family.GuildLogic;
import com.ljsd.jieling.logic.mission.event.MissionEventDistributor;
import com.ljsd.jieling.logic.store.StoreLogic;
@ -263,6 +264,8 @@ public class SessionManager implements INetSession<ISession>, INetReceived<ISess
}
MongoUtil.getLjsdMongoTemplate().lastUpdate();
MissionEventDistributor.requestEnd(session,true);
//挂机探索
ExplorerMapLogic.getInstance().calOfflineReward(userInMem);
} catch (Exception e) {
LOGGER.error("the uid={} processFlush wrong ,e={}",session.getUid(),e);
}