From 9ff30464930ba4efa5c7cc8f478e14de5e3b269b Mon Sep 17 00:00:00 2001 From: jiahuiwen <1024696487@qq.com> Date: Fri, 1 Mar 2019 13:40:22 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=B0=E5=9B=BE=208=E5=92=8C9=20=E5=85=A8?= =?UTF-8?q?=E5=87=BA=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ljsd/jieling/handler/map/MapLogic.java | 29 ++++++++++++------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/serverlogic/src/main/java/com/ljsd/jieling/handler/map/MapLogic.java b/serverlogic/src/main/java/com/ljsd/jieling/handler/map/MapLogic.java index 7f24f1942..d9384e96e 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/handler/map/MapLogic.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/handler/map/MapLogic.java @@ -96,16 +96,10 @@ public class MapLogic { } List cells = new ArrayList<>(mapManager.getMapInfo().size()); for (Map.Entry entry : mapManager.getMapInfo().entrySet()) { - Cell cell = entry.getValue(); - if (cell.getEventId() == -1) { - continue; - } - CommonProto.Cell cellProto = CommonProto.Cell - .newBuilder() - .setCellId(entry.getKey()) - .setPointId(cell.getPointId()) - .build(); - cells.add(cellProto); + cellToProto(cells, entry); + } + for (Map.Entry entry : mapManager.getTypeEight().entrySet()) { + cellToProto(cells, entry); } MapInfoProto.MapEnterResponse mapEnterResponse = MapInfoProto.MapEnterResponse .newBuilder() @@ -115,6 +109,19 @@ public class MapLogic { MessageUtil.sendMessage(iSession, 1, messageType.getNumber(), mapEnterResponse, true); } + private void cellToProto(List cells, Map.Entry entry) { + Cell cell = entry.getValue(); + if (cell.getEventId() == -1) { + return; + } + CommonProto.Cell cellProto = CommonProto.Cell + .newBuilder() + .setCellId(entry.getKey()) + .setPointId(cell.getPointId()) + .build(); + cells.add(cellProto); + } + public void initMap(MapManager mapManager, User user) throws Exception { Map scMap = SCMap.sCMap.get(mapManager.getCurMapId()); @@ -157,7 +164,7 @@ public class MapLogic { if (mapPointConfig.getStyle() == EventType.enter) { mapManager.setCurXY(xy); } - if (mapPointConfig.getStyle() == EventType.allEvents) { + if (mapPointConfig.getStyle() == EventType.allEvents || mapPointConfig.getStyle() == EventType.hinder) { spicelMap.put(xy, cellValue); } else { newMap.put(xy, cellValue);