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 8cd4163cd..5b5ccc04e 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 @@ -141,16 +141,15 @@ public class MapLogic { return; } int type = sChallengeConfig.getType(); - Map crossInfoMap = mapManager.getCrossInfoMap(); if (type == 1) { - if (crossInfoMap.containsKey(mapId)) { - if (crossInfoMap.get(mapId).getStars().contains(STAR_1)) { - boolean enough = ItemUtil.itemCost(user, new int[][]{{Global.GENERALSTORY_TICKET, 1}}, BIReason.MAP_ENTER_CONSUME, mapId); - if (!enough) { - MessageUtil.sendErrorResponse(iSession, 0, messageType.getNumber(), "no ticket"); - return; - } + if (mapManager.getPlayGenMaps().contains(mapId)) { + boolean enough = ItemUtil.itemCost(user, new int[][]{{Global.GENERALSTORY_TICKET, 1}}, BIReason.MAP_ENTER_CONSUME, mapId); + if (!enough) { + MessageUtil.sendErrorResponse(iSession, 0, messageType.getNumber(), "no ticket"); + return; } + }else{ + mapManager.updatePlayGenMaps(mapId); } }else if(type == 3){ boolean enough = ItemUtil.itemCost(user, new int[][]{{Global.HEROSTORY_TICKET, 1}},BIReason.MAP_ENTER_CONSUME,mapId); @@ -1494,23 +1493,22 @@ public class MapLogic { MessageUtil.sendErrorResponse(session, 0, messageType.getNumber(), ""); return; } - //todo vip - /* SChallengeSetting sChallengeSetting = SChallengeSetting.challengeSetting; - int dailyLimitPrivilege = sChallengeSetting.getDailyLimitPrivilege(); - VipPrivilegeType. - if (mapManager.getDayFightCount() + count > sChallengeSetting.getLimit() + mapManager.getBuyFightCount()) { - LOGGER.info("sweep over max count: {}", (mapManager.getDayFightCount() + count)); - MessageUtil.sendErrorResponse(session,0, messageType.getNumber(), ""); - return; - }*/ - SChallengeMapConfig sChallengeMapConfig = SChallengeMapConfig.integerSChallengeMapConfigMap.get(mapId); - MapInfoProto.MapSweepResponse.Builder mapSweepResponse = MapInfoProto.MapSweepResponse.newBuilder(); - for (int i = 0; i < count; i++) { - CommonProto.Drop.Builder dropBuilder = ItemUtil.drop(user, sChallengeMapConfig.getSweepingAward(), 1, 0, BIReason.MAP_SWEEP_REWARD); - mapSweepResponse.addDrop(dropBuilder); + SChallengeConfig sChallengeConfig = SChallengeConfig.sChallengeConfigs.get(mapId); + int type = sChallengeConfig.getType(); + if(type==3 || type==1){ + SChallengeMapConfig sChallengeMapConfig = SChallengeMapConfig.integerSChallengeMapConfigMap.get(mapId); + MapInfoProto.MapSweepResponse.Builder mapSweepResponse = MapInfoProto.MapSweepResponse.newBuilder(); + for (int i = 0; i < count; i++) { + CommonProto.Drop.Builder dropBuilder = ItemUtil.drop(user, sChallengeMapConfig.getSweepingAward(), 1, 0, BIReason.MAP_SWEEP_REWARD); + mapSweepResponse.addDrop(dropBuilder); + } + user.getUserMissionManager().onGameEvent(user, GameEvent.STORY_FIGHT, mapId,1,count); + MessageUtil.sendMessage(session, 1, messageType.getNumber(), mapSweepResponse.build(), true); + }else{ + LOGGER.info("uid={},type={}",uid,type); + MessageUtil.sendErrorResponse(session, 0, messageType.getNumber(), "now sweep"); } - user.getUserMissionManager().onGameEvent(user, GameEvent.STORY_FIGHT, mapId,1,count); - MessageUtil.sendMessage(session, 1, messageType.getNumber(), mapSweepResponse.build(), true); + } @@ -1578,6 +1576,7 @@ public class MapLogic { .setTowerUseTime((int)(mapManager.getCurrTowerTime()/1000)) .build(); builder.setTowerCopyInfo(towerCopyInfo); + builder.addAllPlayedGenMapId(mapManager.getPlayGenMaps()); LOGGER.info("关卡信息{}",towerCopyInfo.toString()); MessageUtil.sendMessage(iSession, 1, msgId, builder.build(), true); } diff --git a/serverlogic/src/main/java/com/ljsd/jieling/handler/map/MapManager.java b/serverlogic/src/main/java/com/ljsd/jieling/handler/map/MapManager.java index 44b7285bf..d0349472b 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/handler/map/MapManager.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/handler/map/MapManager.java @@ -74,6 +74,10 @@ public class MapManager extends MongoBase { // 副本星级奖励领取进度 challengeStarBox id private int starReward; + //已玩普通副本地图 + private Set playGenMaps = new HashSet<>(); + + // 爬塔副本当前层数 private int tower = 1; // 爬塔副本战斗次数 @@ -581,4 +585,13 @@ public class MapManager extends MongoBase { this.setBossXY(0); this.setBossType(0); } + + public Set getPlayGenMaps() { + return playGenMaps; + } + + public void updatePlayGenMaps(int mapId) { + playGenMaps.add(mapId); + updateString("playGenMaps",playGenMaps); + } }