地图修改

back_recharge
lvxinran 2019-11-04 18:11:16 +08:00
parent 6255cabae5
commit 67d0f78d5b
3 changed files with 22 additions and 6 deletions

View File

@ -1,7 +1,6 @@
package com.ljsd.jieling.handler.activity;
import com.ljsd.jieling.chat.logic.ChatLogic;
import com.ljsd.jieling.config.*;
import com.ljsd.jieling.globals.BIReason;
import com.ljsd.jieling.globals.Global;
import com.ljsd.jieling.handler.BaseHandler;

View File

@ -108,9 +108,9 @@ public abstract class AbstractMap implements IMap {
mapEnterResponse.setReviveTime(reviveTime);
}
mapEnterResponse.addAllWakeCells(mapManager.getWalkCells() == null ? new ArrayList<>() : mapManager.getWalkCells());
mapEnterResponse.setDieCount(mapManager.getDieCount());
mapEnterResponse.addAllMapList(cells);
mapEnterResponse.addAllWakeCells(mapManager.getWalkCells() == null ? new ArrayList<>() : mapManager.getWalkCells());
if (mapManager.getTemporaryItems() != null) {
mapEnterResponse.setTemporaryItems(CBean2Proto.getDrop(mapManager.getTemporaryItems()));
}
@ -139,6 +139,7 @@ public abstract class AbstractMap implements IMap {
.build();
mapEnterResponse.addHeroInfos(heroInfo);
}
LOGGER.info("enterMap() uid=>{} mapId =>{}", uid, mapManager.getCurMapId());
}
@ -214,7 +215,7 @@ public abstract class AbstractMap implements IMap {
Poster.getPoster().dispatchEvent(new StoryEvent(user.getId(),1));
}
private void cellToProto(List<CommonProto.Cell> cells, Map.Entry<Integer, Cell> entry) {
protected void cellToProto(List<CommonProto.Cell> cells, Map.Entry<Integer, Cell> entry) {
Cell cell = entry.getValue();
if (cell.getEventId() == -1) {
return;
@ -633,4 +634,10 @@ public abstract class AbstractMap implements IMap {
MapLogic.getInstance().initMapMission(mapManager);
}
public void enterResponseInfoBuild(MapInfoProto.MapEnterResponse.Builder mapEnterResponse,List<CommonProto.Cell> cells,Set<Integer> walkCells,int curXY){
mapEnterResponse.setCurXY(curXY);
mapEnterResponse.addAllMapList(cells);
mapEnterResponse.addAllWakeCells(walkCells);
}
}

View File

@ -70,10 +70,20 @@ public class EndlessMap extends AbstractMap{
mapManager.setMapInfo(endlessMapCellInfo);
}
Set<Integer> walkCell = mapManager.getEndlessMapInfo().getWalkCell();
if(walkCell!=null&&walkCell.size()>0){
if(!walkCell.isEmpty()){
mapManager.setWalkCells(walkCell);
}
if(endlessMapInfo.getCurCell()!=0){
mapManager.setCurXY(endlessMapInfo.getCurCell());
}
}
List<CommonProto.Cell> cells = new ArrayList<>(mapManager.getMapInfo().size());
for (Map.Entry<Integer, Cell> entry : mapManager.getMapInfo().entrySet()) {
cellToProto(cells, entry);
}
mapEnterResponse.setCurXY(mapManager.getCurXY());
mapEnterResponse.addAllMapList(cells);
mapEnterResponse.addAllWakeCells(mapManager.getWalkCells() == null ? new ArrayList<>() : mapManager.getWalkCells());
mapManager.updateEndlessMapId(mapId);
for(Map.Entry<Integer,Map<Integer,String>> entry :endlessMapInfo.getMapSign().entrySet()){
int curMapId = entry.getKey();
@ -100,7 +110,6 @@ public class EndlessMap extends AbstractMap{
@Override
public void outMap(int uid,int outType, int curXY,MapInfoProto.MapOutResponse.Builder builder) throws Exception{
super.outMap(uid, outType, curXY, builder);
MapManager mapManager = UserManager.getUser(uid).getMapManager();
if(outType!=1){
if(MapLogic.endlessSeason!=mapManager.getEndlessMapInfo().getSeason()){
@ -114,6 +123,7 @@ public class EndlessMap extends AbstractMap{
//无尽副本信息保存
mapManager.endlessWalkCellSave(mapManager.getWalkCells());
mapManager.endlessMapInfoSave(mapManager.getMapInfo());
super.outMap(uid, outType, curXY, builder);
}
@Override
@ -315,7 +325,7 @@ public class EndlessMap extends AbstractMap{
@Override
public int getXY(MapManager mapManager) {
int xy = super.getXY(mapManager);
if(mapManager.getEndlessMapInfo().getSeason()!=endlessSeason) {
if(mapManager.getEndlessMapInfo().getSeason()!=MapLogic.endlessSeason) {
for(Map.Entry<String,Integer> entry:mapManager.getEndlessMapInfo().getEndlessHeroInfo().entrySet()){
mapManager.updateEndlessHeroHp(entry.getKey(),10000);
}