fix get map event id

back_recharge
wangyuan 2019-03-29 19:10:51 +08:00
parent 74d7139b5e
commit c922681143
1 changed files with 7 additions and 2 deletions

View File

@ -456,6 +456,7 @@ public class MapLogic {
int[][] behaviorTypeValues = sOptionConfig.getBehaviorTypeValues();
BaseBehavior baseBehavior = baseBehaviorMap.get(behaviorType);
MapInfoProto.EventUpdateResponse.Builder eventUpdateResponse = MapInfoProto.EventUpdateResponse.newBuilder();
int targetEventId = cell.getEventId();
if (baseBehavior != null) {
boolean isSuccess = baseBehavior.process(user, behaviorTypeValues, eventUpdateResponse);
if (!isSuccess) {
@ -524,9 +525,11 @@ public class MapLogic {
else if (cell != null && nextEventId != 0) {
cell.setEventId(nextEventId);
mapManager.addOrUpdateCell(mapManager.getCurXY(), cell);
updateMapMission(mapManager,EventType.updateEvent, cell.getEventId(),0);
updateMapMission(mapManager,EventType.updateEvent, pointId,0);
targetEventId = nextEventId;
}
updateMapMission(mapManager,EventType.updateEvent, targetEventId,0);
updateMapMission(mapManager,EventType.updateEvent, pointId,0);
if (behaviorType == EventType.dun && eventUpdateResponse.getMissionCount() > 0) {
for (CommonProto.Mission missionProto : eventUpdateResponse.getMissionList()) {
Mission mission = user.getMissionManager().getDoingMissions().get(missionProto.getItemId());
@ -562,6 +565,7 @@ public class MapLogic {
// LOGGER.info("updateEvent =====>success<====== xy=>{}, getPointId=>{} eventId={}, mission=>{}, nextEventId=>{}, eventBehaviorCommon=>{} {} sOptionConfig.getReward()=>{}", mapManager.getCurXY(), cell == null ? 0 : cell.getPointId(),
// cell == null ? 0 : cell.getEventId(), eventUpdateResponse.getMissionList(), nextEventId, eventBehaviorCommon,eventUpdateResponse.getDrop(), sOptionConfig.getReward());
saveRefreshInfo(pointId, mapManager, mapPointConfig, nextEventId);
LOGGER.info("updatemap() uid=>{},nextEventId={},eventId={}", uid, nextEventId, cell == null ? 0 : cell.getEventId());
MessageUtil.sendMessage(session, 1, messageType.getNumber(), eventUpdateResponse.build(), true);
}
@ -937,6 +941,7 @@ public class MapLogic {
updateMapMission(user.getMapManager(),EventType.updateEvent,cell.getEventId(),0);
}
}
LOGGER.info("endFight() uid=>{},nextEventId", uid, nextEventId);
updateMapMission(user.getMapManager(),EventType.fightEvent,0,monsterGroupId);
// LOGGER.info("endFight() uid=>{} sMonsterGroup.getRewardgroup()=>{} drop=>{}", uid, sMonsterGroup.getRewardgroup(), fightEndResponse.getDrop());
MessageUtil.sendMessage(session, 1, messageType.getNumber(), fightEndResponse.build(), true);