断线重连探索

back_recharge
xuexinpeng 2022-01-17 18:34:22 +08:00
parent 6bd1bb83ee
commit 4bbf743013
2 changed files with 9 additions and 4 deletions

View File

@ -53,7 +53,6 @@ public class ExplorerMapLogic {
} }
CommonProto.ExplorerMapInfo mapInfo = CommonProto.ExplorerMapInfo.newBuilder().setTeamId(teamId).setMapId(explorerInfo.getMapId()).setHp(explorerInfo.getPlayerHp()). CommonProto.ExplorerMapInfo mapInfo = CommonProto.ExplorerMapInfo.newBuilder().setTeamId(teamId).setMapId(explorerInfo.getMapId()).setHp(explorerInfo.getPlayerHp()).
setExploreTime(explorerInfo.getSendEndTime()).addAllDropReward(dropKeyValList).build(); setExploreTime(explorerInfo.getSendEndTime()).addAllDropReward(dropKeyValList).build();
PlayerInfoProto.ExplorerMapIndicationResponse.Builder indication = PlayerInfoProto.ExplorerMapIndicationResponse.newBuilder(); PlayerInfoProto.ExplorerMapIndicationResponse.Builder indication = PlayerInfoProto.ExplorerMapIndicationResponse.newBuilder();
indication.setExploreInfo(mapInfo); indication.setExploreInfo(mapInfo);
MessageUtil.sendIndicationMessage(sess, 1, MessageTypeProto.MessageType.ExplorerMapIndicationResponse_VALUE, indication.build(), true); MessageUtil.sendIndicationMessage(sess, 1, MessageTypeProto.MessageType.ExplorerMapIndicationResponse_VALUE, indication.build(), true);
@ -111,7 +110,7 @@ public class ExplorerMapLogic {
explorerInfo.setPlayerHp(explorerInfo.getPlayerHp() - reducePlayer); explorerInfo.setPlayerHp(explorerInfo.getPlayerHp() - reducePlayer);
explorerInfo.setEnemyHp(0); explorerInfo.setEnemyHp(0);
LOGGER.info("{}玩家掉血:=》{},剩余血量-》{}", user.getId(),reducePlayer, explorerInfo.getPlayerHp()); LOGGER.info("{}玩家掉血:=》{},剩余血量-》{}", user.getId(),reducePlayer, explorerInfo.getPlayerHp());
LOGGER.info("玩家赢了 怪物死 怪物走复活逻辑 掉落组=>{}", explorerInfo.getEnemyReliveTime(), exploreConfig.getReward()); LOGGER.info("玩家赢了 怪物死 怪物走复活逻辑=>{} 掉落组=>{}", explorerInfo.getEnemyReliveTime(), exploreConfig.getReward());
for (Map.Entry<Integer, Integer> keyVal : itemMap.entrySet()) { for (Map.Entry<Integer, Integer> keyVal : itemMap.entrySet()) {
if (dropMap.containsKey(keyVal.getKey())) { if (dropMap.containsKey(keyVal.getKey())) {
dropMap.put(keyVal.getKey(), dropMap.get(keyVal.getKey()) + keyVal.getValue()); dropMap.put(keyVal.getKey(), dropMap.get(keyVal.getKey()) + keyVal.getValue());

View File

@ -264,13 +264,19 @@ public class SessionManager implements INetSession<ISession>, INetReceived<ISess
} }
MongoUtil.getLjsdMongoTemplate().lastUpdate(); MongoUtil.getLjsdMongoTemplate().lastUpdate();
MissionEventDistributor.requestEnd(session,true); MissionEventDistributor.requestEnd(session,true);
//挂机探索
ExplorerMapLogic.getInstance().calOfflineReward(userInMem);
} catch (Exception e) { } catch (Exception e) {
LOGGER.error("the uid={} processFlush wrong ,e={}",session.getUid(),e); LOGGER.error("the uid={} processFlush wrong ,e={}",session.getUid(),e);
} }
} }
MessageUtil.sendMessageWithoutBack(session, 1, MessageTypeProto.MessageType.RECONNECT_RESPONSE_VALUE, null, true); MessageUtil.sendMessageWithoutBack(session, 1, MessageTypeProto.MessageType.RECONNECT_RESPONSE_VALUE, null, true);
//挂机探索
try{
ExplorerMapLogic.getInstance().calOfflineReward(userInMem);
}
catch (Exception e) {
LOGGER.error("the uid={} ExplorerMapLogic wrong ,e={}",session.getUid(),e);
}
LOGGER.info("the uid={} process reconnect", session.getUid()); LOGGER.info("the uid={} process reconnect", session.getUid());
} }