From 1dce1ea9643d7ebff81efe1f5235c0ecdd501879 Mon Sep 17 00:00:00 2001 From: grimm <1769111741@qq.com> Date: Thu, 21 Dec 2023 18:32:18 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BF=83=E9=AD=94=E5=BF=AB=E9=80=9F=E6=88=98?= =?UTF-8?q?=E6=96=97=E9=80=82=E7=94=A8=E6=88=98=E5=8A=9B=E5=89=8A=E5=BC=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/ljsd/fight/FightType.java | 3 - .../ljsd/jieling/handler/map/MapLogic.java | 97 +++---------------- .../QuickStartMonsterFighter.java | 2 +- .../jieling/logic/fight/GameFightType.java | 11 +-- 4 files changed, 14 insertions(+), 99 deletions(-) diff --git a/fightmanager/src/main/java/com/ljsd/fight/FightType.java b/fightmanager/src/main/java/com/ljsd/fight/FightType.java index 70abc5916..a2292d28f 100644 --- a/fightmanager/src/main/java/com/ljsd/fight/FightType.java +++ b/fightmanager/src/main/java/com/ljsd/fight/FightType.java @@ -12,11 +12,8 @@ public enum FightType { MonterFight(8), // 兽潮 TOPFight(9), // 巅峰赛 GuildBossFight(10), // 工会boss - - CarBossFight(11), // 车迟斗法挑战boss CarPersonFight(12), // 车迟斗法抢夺 - EXPEDITION(13), // 远征 GuildChallenge(14), //公会副本 NewGeneral(15),//新将 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 0f40dec4e..34afe5d4e 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 @@ -1604,11 +1604,6 @@ public class MapLogic { /** * 校验主线战斗 - * @param user - * @param fightId - * @param teamId - * @return - * @throws Exception */ public boolean checkMainFight(User user, int fightId, int teamId) throws Exception { MainLevelManager mainLevelManager = user.getMainLevelManager(); @@ -1810,7 +1805,7 @@ public class MapLogic { for (Map.Entry equipEntry : user.getItemManager().getItemMap().entrySet()) { if (SItem.getsItemMap().get(equipEntry.getKey()).getItemType() == 3) { if (equipConfig.get(equipEntry.getKey()).getStar() >= ints[1]) { - num+=equipEntry.getValue().getItemNum(); + num+= (int) equipEntry.getValue().getItemNum(); } } } @@ -2272,7 +2267,7 @@ public class MapLogic { if (mapManager.getCurMapId() == 0) { throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE); } - if (heroInfo.size() < 1 || !heroInfo.containsKey(heroId)) { + if (heroInfo.isEmpty() || !heroInfo.containsKey(heroId)) { throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE); } int[] healing = STrialSetting.sTrialSetting.getHealingId(); @@ -2311,9 +2306,6 @@ public class MapLogic { /** * 获取无尽副本英雄信息 - * - * @param session - * @param messageType */ public void getEndlessHero(ISession session, MessageTypeProto.MessageType messageType) throws Exception { User user = UserManager.getUser(session.getUid()); @@ -2328,7 +2320,7 @@ public class MapLogic { MapInfoProto.GetEndlessHeroResponse.Builder response = MapInfoProto.GetEndlessHeroResponse.newBuilder(); //已开启地图处理 Map sEndlessMapConfigMap = SEndlessMapConfig.sEndlessMapConfigMap; - if (endlessMapInfo.getOpenMap() == null || endlessMapInfo.getOpenMap().size() < 1) { + if (endlessMapInfo.getOpenMap() == null || endlessMapInfo.getOpenMap().isEmpty()) { Set openMap = new HashSet<>(); for (Map.Entry entry : sEndlessMapConfigMap.entrySet()) { openMap.add(entry.getKey()); @@ -2383,9 +2375,6 @@ public class MapLogic { /** * 无尽副本复位 - * - * @param session - * @param messageType */ public void resetEndlessHero(ISession session, MessageTypeProto.MessageType messageType) throws Exception { User user = UserManager.getUser(session.getUid()); @@ -2411,11 +2400,6 @@ public class MapLogic { /** * 无尽副本设置标记 - * - * @param session - * @param cellId - * @param content - * @param messageType */ public void setEndlessSign(ISession session, int type, int mapId, int cellId, String content, MessageTypeProto.MessageType messageType) throws Exception { User user = UserManager.getUser(session.getUid()); @@ -2449,10 +2433,6 @@ public class MapLogic { /** * 刷新获取行动力 - * - * @param session - * @param messageType - * @throws Exception */ public void refreshEndlessExecution(ISession session, MessageTypeProto.MessageType messageType) throws Exception { User user = UserManager.getUser(session.getUid()); @@ -2462,9 +2442,6 @@ public class MapLogic { /** * 获取出图统计数据 - * - * @param session - * @param messageType */ public void endlessOutMapConsume(ISession session, MessageTypeProto.MessageType messageType) throws Exception { User user = UserManager.getUser(session.getUid()); @@ -2479,9 +2456,6 @@ public class MapLogic { /** * 无尽副本复活消耗行动力 - * - * @param user - * @throws Exception */ public void reviveConsumeExecution(User user) throws Exception { MapManager mapManager = user.getMapManager(); @@ -2507,19 +2481,13 @@ public class MapLogic { /** * 清理无尽副本道具 - * - * @param uid - * @throws Exception */ - public void clearEndLessDrop(int uid) throws Exception { + public void clearEndLessDrop(int uid) { ItemLogic.getInstance().functionEndClearItem(uid, FunctionIdEnum.Endless.getFunctionType(), BIReason.ENDLESS_REASON_CHANGE); } /** * 无尽副本小地图信息 - * - * @param session - * @param messageType */ public void endlessMinMapInfo(ISession session, MessageTypeProto.MessageType messageType) throws Exception { MapManager mapManager = UserManager.getUser(session.getUid()).getMapManager(); @@ -2527,15 +2495,15 @@ public class MapLogic { MapInfoProto.EndlessMinMapResponse.Builder response = MapInfoProto.EndlessMinMapResponse.newBuilder(); Map scMap = SCMap.sCMap.get(mapManager.getEndlessMapInfo().getCurMapId()); for (Map.Entry entry : scMap.entrySet()) { - for (int i = 0; i < endlessMinMapPoint.length; i++) { - if (entry.getValue().getEvent() == endlessMinMapPoint[i][0]) { + for (int[] ints : endlessMinMapPoint) { + if (entry.getValue().getEvent() == ints[0]) { int[][] groups = entry.getValue().getGroups(); - for (int j = 0; j < groups.length; j++) { + for (int[] group : groups) { CommonProto.EndlessPoint.Builder point = CommonProto.EndlessPoint.newBuilder(); - int x = groups[j][0]; - int y = groups[j][1]; + int x = group[0]; + int y = group[1]; int xy = CellUtil.xy2Pos(x, y); - point.setLocation(xy).setMonsterId(endlessMinMapPoint[i][1]); + point.setLocation(xy).setMonsterId(ints[1]); response.addPoints(point); LOGGER.info("小地图怪物坐标点{}", xy); } @@ -2596,8 +2564,6 @@ public class MapLogic { /** * 无尽副本赛季更换,用户信息清除 - * - * @throws Exception */ public void resetEndlessInfo() throws Exception { Map onlineUserMap = OnlineUserManager.sessionMap; @@ -2640,44 +2606,12 @@ public class MapLogic { /** * 设置无尽副本是否跳过战斗 - * - * @param session - * @param type - * @param messageType */ public void setEndlessSkipType(ISession session, int type, MessageTypeProto.MessageType messageType) throws Exception { UserManager.getUser(session.getUid()).getMapManager().updateEndlessSkipFight(type); MessageUtil.sendMessage(session, 1, messageType.getNumber(), null, true); } - public void getDifficult() throws Exception { - SEndlessDifficulty baseDiff = STableManager.getConfig(SEndlessDifficulty.class).get(1); - -// if (serverConfigTmp.getWorldLevel() == 0) { -// for (int i = 0; i < baseDiff.getMonsterId().length; i++) { -// difficultyMonster.put(baseDiff.getMonsterId()[i], baseDiff.getMonsterId()[i]); -// } -// for (int i = 0; i < baseDiff.getRewardId().length; i++) { -// difficultyReward.put(baseDiff.getRewardId()[i], baseDiff.getRewardId()[i]); -// } -// } else { -// for (Map.Entry entry : STableManager.getConfig(SEndlessDifficulty.class).entrySet()) { -// if (serverConfigTmp.getWorldLevel() <= entry.getValue().getWorldLevel()[0] || serverConfigTmp.getWorldLevel() > entry.getValue().getWorldLevel()[1]) { -// continue; -// } -// for (int i = 0; i < baseDiff.getMonsterId().length; i++) { -// difficultyMonster.put(baseDiff.getMonsterId()[i], entry.getValue().getMonsterId()[i]); -// } -// for (int i = 0; i < baseDiff.getRewardId().length; i++) { -// difficultyReward.put(baseDiff.getRewardId()[i], entry.getValue().getRewardId()[i]); -// } -// -// break; -// } -// } - } - - public void dailyChallenge(ISession session, int type, int id, MessageTypeProto.MessageType messageType) throws Exception { User user = UserManager.getUser(session.getUid()); PlayerInfoProto.DailyChallengeResponse.Builder builder = PlayerInfoProto.DailyChallengeResponse.newBuilder(); @@ -2783,11 +2717,6 @@ public class MapLogic { /** * 试炼副本保存阵容 - * - * @param session - * @param heroes - * @param messageType - * @throws Exception */ public void saveTrailTeam(ISession session, List heroes, MessageTypeProto.MessageType messageType) throws Exception { User user = UserManager.getUser(session.getUid()); @@ -2848,10 +2777,6 @@ public class MapLogic { /** * 获取宝箱 - * - * @param session - * @param messageType - * @throws Exception */ public void trialGetBox(ISession session, int type, MessageTypeProto.MessageType messageType) throws Exception { User user = UserManager.getUser(session.getUid()); @@ -3111,7 +3036,7 @@ public class MapLogic { } - public void flushEndlessTreasure(User user) throws Exception { + public void flushEndlessTreasure(User user) { if (user.getMapManager().getEndlessTreasureReward().getCreateTime() < TimeUtils.nowInt()) { user.getMapManager().resetEndlessTreasure(); Item item = user.getItemManager().getItem(102);//升级积分清除 diff --git a/serverlogic/src/main/java/com/ljsd/jieling/handler/monsterAttack/QuickStartMonsterFighter.java b/serverlogic/src/main/java/com/ljsd/jieling/handler/monsterAttack/QuickStartMonsterFighter.java index a38cda73b..4f46d55cd 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/handler/monsterAttack/QuickStartMonsterFighter.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/handler/monsterAttack/QuickStartMonsterFighter.java @@ -66,7 +66,7 @@ public class QuickStartMonsterFighter extends BaseHandler teamPosHeroInfos = user.getTeamPosManager().getTeamPosForHero().get(teamId); - if (teamPosHeroInfos == null || teamPosHeroInfos.size() == 0) { + if (teamPosHeroInfos == null || teamPosHeroInfos.isEmpty()) { LOGGER.info("startLevelDifficultyFight==> uid={},fightId={},teamId={}", uid, fightId, teamId); throw new ErrorCodeException(ErrorCode.newDefineCode("阵容有误")); } diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/fight/GameFightType.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/fight/GameFightType.java index 57439b483..592ba1b6d 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/logic/fight/GameFightType.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/fight/GameFightType.java @@ -19,25 +19,18 @@ import com.ljsd.jieling.logic.fight.eventhandler.*; */ public enum GameFightType { StoryFight(FightType.StoryFight,new MainLineOrInnerDemonFightHandler(), RedisKey.LEVE_DIFFICULTY_FIGHT), - MapFastFight(FightType.MapExploreFight,new DefaultWithoutHandFightHandler(),null), - MapEndFight(FightType.MapExploreFight,new DefaultOfRedisCacheFightHandler(),RedisKey.FIGHT), EndSuddlenlyFight(FightType.MapExploreFight,new DefaultOfRedisCacheFightHandler(),RedisKey.SUDDLENLY_FIGHT), - EndMonsterAttackFight(FightType.MapExploreFight,new MainLineOrInnerDemonFightHandler(),RedisKey.CHALLENGE_MONSTER_ATTACK), - + EndMonsterAttackFight(FightType.MonterFight,new MainLineOrInnerDemonFightHandler(),RedisKey.CHALLENGE_MONSTER_ATTACK), + MonterFight(FightType.MonterFight,new MainLineOrInnerDemonFightHandler(),null), ArenaPersonFight(FightType.ArenaFight,new PVPFightHandler(),null), ArenaRobotFight(FightType.ArenaFight,new PVPFightHandler(),null), Expediton(FightType.EXPEDITION,new PVPFightHandler(),null), - TOPArenaPersonFight(FightType.TOPFight,new PVPFightHandler(),null), TOPArenaRobotFight(FightType.TOPFight,new PVPFightHandler(),null), TOPArena2RobotFight(FightType.TOPFight,new PVPFightHandler(),null), - - MonterFight(FightType.MonterFight,new DefaultWithoutHandFightHandler(),null), - GuildFight(FightType.GuildFight,new PVPFightHandler(),null), - GuildBossFight(FightType.GuildBossFight,new DefaultOfRedisCacheFightHandler(),RedisKey.GUILD_MONSTER_FIGHT), DailyChallenge(FightType.StoryFight,new DefaultWithoutHandFightHandler(),null), DeathPathChallenge(FightType.CarBossFight,new DefaultWithoutHandFightHandler(),null),