快速战斗

back_recharge
jiahuiwen 2019-04-19 19:17:23 +08:00
parent 0367c5fbcb
commit a8cbb93ccb
3 changed files with 28 additions and 7 deletions

View File

@ -608,3 +608,4 @@ int int mut,int#int,1 int int
8150 1 32050#31050 5 0
55001 1 50401 1 0
55002 1 50402 1 0
100001 1 100001 1 0

View File

@ -49,6 +49,7 @@ public class GetPlayerInfoHandler extends BaseHandler{
MapLogic.getInstance().resetDayInfo(user);
}
MapLogic.getInstance().checkIsInMap(user);
Map<Integer, Integer> guidePoints = user.getPlayerInfoManager().getGuidePoints();
List<CommonProto.NewPlayerGuidePoint> list = new ArrayList<>();
for(Map.Entry<Integer,Integer> guideItem : guidePoints.entrySet()){

View File

@ -76,12 +76,7 @@ public class MapLogic {
MessageUtil.sendErrorResponse(iSession, 0, messageType.getNumber(), "");
return;
}
if (mapManager.getCurMapId() > 0) {
int leftTime = getLeftTime(user);
if (leftTime == 0) {
resetMapInfo(user, true);
}
}
checkIsInMap(user);
// 初始序章地图
if (user.getPlayerInfoManager().getMapId() == 0) {
String error = initTeamInfo(teamId, uid, user, mapManager);
@ -191,6 +186,14 @@ public class MapLogic {
}else{
LOGGER.error("the curmap={}",mapManager.getCurMapId());
}
for (Map.Entry<String, Map<Integer, Integer>> entry : mapManager.getHeroAllAttributeMap().entrySet()) {
Map<Integer, Integer> map = entry.getValue();
MapInfoProto.HeroInfo heroInfo = MapInfoProto.HeroInfo.newBuilder()
.setHeroId(entry.getKey())
.setHeroHp(map.get(HeroAttributeEnum.CurHP.getPropertyId()) == null ? 0 : map.get(HeroAttributeEnum.CurHP.getPropertyId()))
.build();
mapEnterResponse.addHeroInfos(heroInfo);
}
MessageUtil.sendMessage(iSession, 1, messageType.getNumber(), mapEnterResponse.build(), true);
}
@ -899,9 +902,12 @@ public class MapLogic {
}
if (!nextEventId.isEmpty()) {
int triggerXY = mapManager.getTriggerXY();
cell = mapManager.getMapInfo().get(mapManager.getTriggerXY());
if (cell.getEventId() != -1) {
cell.setEventId(Integer.parseInt(nextEventId));
mapManager.addOrUpdateCell(triggerXY, cell);
updateMapMission(mapManager,EventType.updateEvent,cell.getEventId(),0);
updateMapMission(mapManager, EventType.updateEvent, cell.getEventId(), 0);
}
}
// LOGGER.info("endFight() uid=>{},nextEventId=>{}", uid, nextEventId);
updateMapMission(mapManager,EventType.fightEvent,0, 1);
@ -1812,4 +1818,17 @@ public class MapLogic {
}
}
public void checkIsInMap(User user) throws Exception {
if (user.getMapManager().getCurMapId() == 0) {
return;
}
int leftTime = getLeftTime(user);
if (leftTime >= 0) {
return;
}
// TODO 发邮件
resetMapInfo(user, true);
}
}