From bd763bcb1cbb4f500ba4b8999c6a62d51492ab19 Mon Sep 17 00:00:00 2001 From: wangyuan Date: Wed, 3 Jul 2019 14:08:51 +0800 Subject: [PATCH 1/3] fix map sweep --- .../ljsd/jieling/handler/map/MapLogic.java | 47 +++++++++---------- .../ljsd/jieling/handler/map/MapManager.java | 13 +++++ 2 files changed, 36 insertions(+), 24 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 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); + } } From 49c738a616b1ba1a6c421bc9c42489e0561ee2f4 Mon Sep 17 00:00:00 2001 From: wangyuan Date: Wed, 3 Jul 2019 14:11:15 +0800 Subject: [PATCH 2/3] conf file --- conf/application.properties | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/conf/application.properties b/conf/application.properties index 7dca5c4e9..345031ffb 100644 --- a/conf/application.properties +++ b/conf/application.properties @@ -54,5 +54,13 @@ netty.writeTimeout=32 netty.allTimeout=35 +#core +services.core.ip=60.1.1.153 +services.core.port=7900 +services.core.area=1000 +services.core.id=1 +services.core.weight=5 + + logging.config = conf/logback-boot.xml \ No newline at end of file From becff88ad7ed25c50bec1d33206e47c7f788e5d4 Mon Sep 17 00:00:00 2001 From: wangyuan Date: Wed, 3 Jul 2019 14:22:54 +0800 Subject: [PATCH 3/3] kill reward --- .../java/com/ljsd/jieling/logic/fight/CombatLogic.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/fight/CombatLogic.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/fight/CombatLogic.java index b4c2f9a06..bdd7dee99 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/logic/fight/CombatLogic.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/fight/CombatLogic.java @@ -672,7 +672,8 @@ public class CombatLogic { //发送击杀boss奖励和发现者奖励 if(fightResult == 1){ i = i+1; - sendRewardOfBossKilled(adventureBoss.getFindUserId(),uid,bossGroupId,adventureBoss.getArenaId(),adventureBoss.getArenaLevel()); + String killReward = sendRewardOfBossKilled(adventureBoss.getFindUserId(), uid, bossGroupId, adventureBoss.getArenaId(), adventureBoss.getArenaLevel()); + builder.setKillRewards(killReward); user.getUserMissionManager().onGameEvent(user, GameEvent.KILLINVASIONBOSS); RedisUtil.getInstence().removeMapEntrys(RedisKey.ADVENTRUEN_BOSS_INFO,"",bossId); ISession findSession = OnlineUserManager.getSessionByUid(adventureBoss.getFindUserId()); @@ -706,7 +707,7 @@ public class CombatLogic { MessageUtil.sendMessage(session,1, MessageTypeProto.MessageType.ADVENTURE_BOSS_CHALLENGE_RESPONSE_VALUE,build,true); } - private void sendRewardOfBossKilled(int findUserId,int killUid,int killBossGroupId, int arenaId,int arenaLevel) throws Exception { + private String sendRewardOfBossKilled(int findUserId,int killUid,int killBossGroupId, int arenaId,int arenaLevel) throws Exception { SMonsterGroup sMonsterGroup = SMonsterGroup.getsMonsterGroupMap().get(killBossGroupId); int[] killReward = sMonsterGroup.getRewardgroup(); SAdventureConfig sAdventureConfig = SAdventureConfig.getConfig().get(arenaId); @@ -728,7 +729,7 @@ public class CombatLogic { title = SErrorCodeEerverConfig.getI18NMessage("adventuren_boss_kill_reward_title"); content = SErrorCodeEerverConfig.getI18NMessage("adventuren_boss_kill_reward__txt"); MailLogic.getInstance().sendMail(killUid,title,content,killRewardMail,nowTime, Global.MAIL_EFFECTIVE_TIME); - + return killRewardMail; } public int updateBossAndGetHurtForFight(int[] checkResult,AdventureBoss adventureBoss){