地图修改
parent
6255cabae5
commit
67d0f78d5b
|
@ -1,7 +1,6 @@
|
||||||
package com.ljsd.jieling.handler.activity;
|
package com.ljsd.jieling.handler.activity;
|
||||||
|
|
||||||
import com.ljsd.jieling.chat.logic.ChatLogic;
|
import com.ljsd.jieling.chat.logic.ChatLogic;
|
||||||
import com.ljsd.jieling.config.*;
|
|
||||||
import com.ljsd.jieling.globals.BIReason;
|
import com.ljsd.jieling.globals.BIReason;
|
||||||
import com.ljsd.jieling.globals.Global;
|
import com.ljsd.jieling.globals.Global;
|
||||||
import com.ljsd.jieling.handler.BaseHandler;
|
import com.ljsd.jieling.handler.BaseHandler;
|
||||||
|
|
|
@ -108,9 +108,9 @@ public abstract class AbstractMap implements IMap {
|
||||||
mapEnterResponse.setReviveTime(reviveTime);
|
mapEnterResponse.setReviveTime(reviveTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mapEnterResponse.addAllWakeCells(mapManager.getWalkCells() == null ? new ArrayList<>() : mapManager.getWalkCells());
|
||||||
mapEnterResponse.setDieCount(mapManager.getDieCount());
|
mapEnterResponse.setDieCount(mapManager.getDieCount());
|
||||||
mapEnterResponse.addAllMapList(cells);
|
mapEnterResponse.addAllMapList(cells);
|
||||||
mapEnterResponse.addAllWakeCells(mapManager.getWalkCells() == null ? new ArrayList<>() : mapManager.getWalkCells());
|
|
||||||
if (mapManager.getTemporaryItems() != null) {
|
if (mapManager.getTemporaryItems() != null) {
|
||||||
mapEnterResponse.setTemporaryItems(CBean2Proto.getDrop(mapManager.getTemporaryItems()));
|
mapEnterResponse.setTemporaryItems(CBean2Proto.getDrop(mapManager.getTemporaryItems()));
|
||||||
}
|
}
|
||||||
|
@ -139,6 +139,7 @@ public abstract class AbstractMap implements IMap {
|
||||||
.build();
|
.build();
|
||||||
mapEnterResponse.addHeroInfos(heroInfo);
|
mapEnterResponse.addHeroInfos(heroInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
LOGGER.info("enterMap() uid=>{} mapId =>{}", uid, mapManager.getCurMapId());
|
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));
|
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();
|
Cell cell = entry.getValue();
|
||||||
if (cell.getEventId() == -1) {
|
if (cell.getEventId() == -1) {
|
||||||
return;
|
return;
|
||||||
|
@ -633,4 +634,10 @@ public abstract class AbstractMap implements IMap {
|
||||||
MapLogic.getInstance().initMapMission(mapManager);
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,10 +70,20 @@ public class EndlessMap extends AbstractMap{
|
||||||
mapManager.setMapInfo(endlessMapCellInfo);
|
mapManager.setMapInfo(endlessMapCellInfo);
|
||||||
}
|
}
|
||||||
Set<Integer> walkCell = mapManager.getEndlessMapInfo().getWalkCell();
|
Set<Integer> walkCell = mapManager.getEndlessMapInfo().getWalkCell();
|
||||||
if(walkCell!=null&&walkCell.size()>0){
|
if(!walkCell.isEmpty()){
|
||||||
mapManager.setWalkCells(walkCell);
|
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);
|
mapManager.updateEndlessMapId(mapId);
|
||||||
for(Map.Entry<Integer,Map<Integer,String>> entry :endlessMapInfo.getMapSign().entrySet()){
|
for(Map.Entry<Integer,Map<Integer,String>> entry :endlessMapInfo.getMapSign().entrySet()){
|
||||||
int curMapId = entry.getKey();
|
int curMapId = entry.getKey();
|
||||||
|
@ -100,7 +110,6 @@ public class EndlessMap extends AbstractMap{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void outMap(int uid,int outType, int curXY,MapInfoProto.MapOutResponse.Builder builder) throws Exception{
|
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();
|
MapManager mapManager = UserManager.getUser(uid).getMapManager();
|
||||||
if(outType!=1){
|
if(outType!=1){
|
||||||
if(MapLogic.endlessSeason!=mapManager.getEndlessMapInfo().getSeason()){
|
if(MapLogic.endlessSeason!=mapManager.getEndlessMapInfo().getSeason()){
|
||||||
|
@ -114,6 +123,7 @@ public class EndlessMap extends AbstractMap{
|
||||||
//无尽副本信息保存
|
//无尽副本信息保存
|
||||||
mapManager.endlessWalkCellSave(mapManager.getWalkCells());
|
mapManager.endlessWalkCellSave(mapManager.getWalkCells());
|
||||||
mapManager.endlessMapInfoSave(mapManager.getMapInfo());
|
mapManager.endlessMapInfoSave(mapManager.getMapInfo());
|
||||||
|
super.outMap(uid, outType, curXY, builder);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -315,7 +325,7 @@ public class EndlessMap extends AbstractMap{
|
||||||
@Override
|
@Override
|
||||||
public int getXY(MapManager mapManager) {
|
public int getXY(MapManager mapManager) {
|
||||||
int xy = super.getXY(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()){
|
for(Map.Entry<String,Integer> entry:mapManager.getEndlessMapInfo().getEndlessHeroInfo().entrySet()){
|
||||||
mapManager.updateEndlessHeroHp(entry.getKey(),10000);
|
mapManager.updateEndlessHeroHp(entry.getKey(),10000);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue