From 4a1f019c1a422e3630461e44b0cd254ea8f909a4 Mon Sep 17 00:00:00 2001 From: xuexinpeng Date: Tue, 28 Sep 2021 19:15:13 +0800 Subject: [PATCH] =?UTF-8?q?=E7=8E=89=E8=99=9A=E8=AE=BA=E9=81=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CrossYuxulundaoChallengeHandler.java | 115 +++++++++--------- .../CrossYuxulundaoTeamInfoHandler.java | 3 +- .../ljsd/jieling/logic/hero/HeroLogic.java | 12 +- .../jieling/logic/player/PlayerLogic.java | 6 +- .../main/java/config/SArenaRobotConfig.java | 28 +++++ 5 files changed, 103 insertions(+), 61 deletions(-) diff --git a/serverlogic/src/main/java/com/ljsd/jieling/handler/crossServer/CrossYuxulundaoChallengeHandler.java b/serverlogic/src/main/java/com/ljsd/jieling/handler/crossServer/CrossYuxulundaoChallengeHandler.java index 28a2875b1..9022686c2 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/handler/crossServer/CrossYuxulundaoChallengeHandler.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/handler/crossServer/CrossYuxulundaoChallengeHandler.java @@ -113,61 +113,7 @@ public class CrossYuxulundaoChallengeHandler extends BaseHandler n == 1).count(); - //战斗记录 - if (defUid > 1000) { - if (arenaRecord != null) { - if (winCount >= 2) { - //攻击者赢了 - arenaRecord.setYxldBattleType(1); - arenaRecord.setYxldScoreChange(+25); - } else { - arenaRecord.setYxldBattleType(2); - arenaRecord.setYxldScoreChange(-25); - } - arenaRecord.setYxldResult(result); - //挑战者记录 - RedisUtil redisUtil = RedisUtil.getInstence(); - String key2 = RedisKey.getKey(RedisKey.CROSS_YUXULUNDAO_RECORD, String.valueOf(user.getId()), false); - long defLenth = redisUtil.lGetListSize(key2); - if (defLenth > 20) { - redisUtil.lPop(key2); - } - arenaRecord.setCreateTime(TimeUtils.nowInt()); - String defarenaRecordJson = new Gson().toJson(arenaRecord); - redisUtil.lSet(key2, defarenaRecordJson); - if (winCount >= 2) { - //防守方输了了 - arenaRecord.setYxldBattleType(4); - arenaRecord.setYxldScoreChange(-25); - } else { - //防守方赢了 - arenaRecord.setYxldBattleType(3); - arenaRecord.setYxldScoreChange(+25); - } - //被挑战者记录 - arenaRecord.setCreateTime(TimeUtils.nowInt()); // 时间 - arenaRecord.setAttackId(user.getId()); //id - arenaRecord.setLevel(user.getPlayerInfoManager().getLevel()); //等级 - arenaRecord.setHead(user.getPlayerInfoManager().getHead()); //头像 - arenaRecord.setUserName(user.getPlayerInfoManager().getNickName()); //名字 - arenaRecord.setHeadFrame(user.getPlayerInfoManager().getHeadFrame());//头像框 - arenaRecord.setPracticeLevel(user.getHeroManager().getPracticeLevel());//修行等级 - int[] newResult = new int[3]; - for (int i = 0; i < result.length; i++) { - newResult[i] = result[i] ^ 1; - } - arenaRecord.setYxldResult(newResult); - int myforce = HeroLogic.getInstance().calTeamTotalForce(user, GlobalsDef.CROSS_YU_XU_LUN_DAO_ONE, false) + HeroLogic.getInstance().calTeamTotalForce(user, GlobalsDef.CROSS_YU_XU_LUN_DAO_TWO, false) + HeroLogic.getInstance().calTeamTotalForce(user, GlobalsDef.CROSS_YU_XU_LUN_DAO_THREE, false); - arenaRecord.setAttackForce(myforce); //总战斗力 - String key = RedisKey.getKey(RedisKey.CROSS_YUXULUNDAO_RECORD, String.valueOf(defUid), false); - long def = redisUtil.lGetListSize(key); - if (def > 20) { - redisUtil.lPop(key); - } - String arenaRecordJson = new Gson().toJson(arenaRecord); - redisUtil.lSet(key, arenaRecordJson); - } - } + List enemyList = arenaManager.getCrossYuxulundaoEnemies(); enemyList.forEach(n -> res.addArenaEnemys(CrossYuxulundaoLogic.getInstance().getMatchRivalInfo(n.getEnemyId(), 0, 0))); CSPlayer myQuery = CrossServiceLogic.getPlayerByRedis(user.getId()); @@ -231,6 +177,63 @@ public class CrossYuxulundaoChallengeHandler extends BaseHandler 1000) { + if (arenaRecord != null) { + if (winCount >= 2) { + //攻击者赢了 + arenaRecord.setYxldBattleType(1); + arenaRecord.setYxldScoreChange(winerGetScore); + } else { + arenaRecord.setYxldBattleType(2); + arenaRecord.setYxldScoreChange(loserGetScore); + } + arenaRecord.setYxldResult(result); + //挑战者记录 + RedisUtil redisUtil = RedisUtil.getInstence(); + String key2 = RedisKey.getKey(RedisKey.CROSS_YUXULUNDAO_RECORD, String.valueOf(user.getId()), false); + long defLenth = redisUtil.lGetListSize(key2); + if (defLenth > 20) { + redisUtil.lPop(key2); + } + arenaRecord.setCreateTime(TimeUtils.nowInt()); + String defarenaRecordJson = new Gson().toJson(arenaRecord); + redisUtil.lSet(key2, defarenaRecordJson); + if (winCount >= 2) { + //防守方输了了 + arenaRecord.setYxldBattleType(4); + arenaRecord.setYxldScoreChange(loserGetScore); + } else { + //防守方赢了 + arenaRecord.setYxldBattleType(3); + arenaRecord.setYxldScoreChange(winerGetScore); + } + //被挑战者记录 + arenaRecord.setCreateTime(TimeUtils.nowInt()); // 时间 + arenaRecord.setAttackId(user.getId()); //id + arenaRecord.setLevel(user.getPlayerInfoManager().getLevel()); //等级 + arenaRecord.setHead(user.getPlayerInfoManager().getHead()); //头像 + arenaRecord.setUserName(user.getPlayerInfoManager().getNickName()); //名字 + arenaRecord.setHeadFrame(user.getPlayerInfoManager().getHeadFrame());//头像框 + arenaRecord.setPracticeLevel(user.getHeroManager().getPracticeLevel());//修行等级 + int[] newResult = new int[3]; + for (int i = 0; i < result.length; i++) { + newResult[i] = result[i] ^ 1; + } + arenaRecord.setYxldResult(newResult); + int myforce = HeroLogic.getInstance().calTeamTotalForce(user, GlobalsDef.CROSS_YU_XU_LUN_DAO_ONE, false) + HeroLogic.getInstance().calTeamTotalForce(user, GlobalsDef.CROSS_YU_XU_LUN_DAO_TWO, false) + HeroLogic.getInstance().calTeamTotalForce(user, GlobalsDef.CROSS_YU_XU_LUN_DAO_THREE, false); + arenaRecord.setAttackForce(myforce); //总战斗力 + String key = RedisKey.getKey(RedisKey.CROSS_YUXULUNDAO_RECORD, String.valueOf(defUid), false); + long def = redisUtil.lGetListSize(key); + if (def > 20) { + redisUtil.lPop(key); + } + String arenaRecordJson = new Gson().toJson(arenaRecord); + redisUtil.lSet(key, arenaRecordJson); + } + } + int id = SMServerRankConfig.getIdByScore(myQuery.getCrossYuxulundaoNewScore()); if (myQuery.getCrossYxldMaxLevel() < id) { //首次爬升到该位置发奖励 @@ -273,7 +276,7 @@ public class CrossYuxulundaoChallengeHandler extends BaseHandler robotHeroAttribute = calRobotHeroAttribute(scHero, heroLevel, 0, differDemonsId, differDemonsLv,true); - totalForce+=calForce(robotHeroAttribute); + int add =calForce(robotHeroAttribute); + sArenaRobotConfig.setYxldTotalForce1(sArenaRobotConfig.getYxldTotalForce1()+add); + totalForce+=add; } for(Integer heroTid :heroList2){ SCHero scHero = SCHero.getsCHero().get(heroTid); Map robotHeroAttribute = calRobotHeroAttribute(scHero, heroLevel, 0, differDemonsId, differDemonsLv,true); - totalForce+=calForce(robotHeroAttribute); + int add =calForce(robotHeroAttribute); + sArenaRobotConfig.setYxldTotalForce2(sArenaRobotConfig.getYxldTotalForce2()+add); + totalForce+=add; } for(Integer heroTid :heroList3){ SCHero scHero = SCHero.getsCHero().get(heroTid); Map robotHeroAttribute = calRobotHeroAttribute(scHero, heroLevel, 0, differDemonsId, differDemonsLv,true); - totalForce+=calForce(robotHeroAttribute); + int add =calForce(robotHeroAttribute); + sArenaRobotConfig.setYxldTotalForce3(sArenaRobotConfig.getYxldTotalForce3()+add); + totalForce+=add; } return totalForce; } diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/player/PlayerLogic.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/player/PlayerLogic.java index 6f876d59c..8a5bcf140 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/logic/player/PlayerLogic.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/player/PlayerLogic.java @@ -735,12 +735,15 @@ public class PlayerLogic { Integer heroStar = item.getValue().getStar(); teamInfo.addTeam(CommonProto.TeamSimpleInfo.newBuilder().setHeroid(String.valueOf(heroTid)).setHeroTid(heroTid).setLevel(sArenaRobotConfig.getRoleLv()).setStar(heroStar).setPosition(position++).build()); } + teamInfo.setTotalForce(sArenaRobotConfig.getYxldTotalForce1()); + }else if(id ==GlobalsDef.CROSS_YU_XU_LUN_DAO_TWO){ for(Map.Entry item : sArenaRobotConfig.getHeroMapList2().entrySet()){ Integer heroTid = item.getKey(); Integer heroStar = item.getValue().getStar(); teamInfo.addTeam(CommonProto.TeamSimpleInfo.newBuilder().setHeroid(String.valueOf(heroTid)).setHeroTid(heroTid).setLevel(sArenaRobotConfig.getRoleLv()).setStar(heroStar).setPosition(position++).build()); } + teamInfo.setTotalForce(sArenaRobotConfig.getYxldTotalForce2()); }else if(id ==GlobalsDef.CROSS_YU_XU_LUN_DAO_THREE){ for(Map.Entry item : sArenaRobotConfig.getHeroMapList3().entrySet()){ @@ -748,8 +751,9 @@ public class PlayerLogic { Integer heroStar = item.getValue().getStar(); teamInfo.addTeam(CommonProto.TeamSimpleInfo.newBuilder().setHeroid(String.valueOf(heroTid)).setHeroTid(heroTid).setLevel(sArenaRobotConfig.getRoleLv()).setStar(heroStar).setPosition(position++).build()); } + teamInfo.setTotalForce(sArenaRobotConfig.getYxldTotalForce3()); } - teamInfo.setTotalForce(sArenaRobotConfig.getTotalForce()); + //teamInfo.setTotalForce(sArenaRobotConfig.getYxldTotalForce()); oneInfo.addCrossTeam(teamInfo); } //oneInfo.setTeam(teamInfo); diff --git a/tablemanager/src/main/java/config/SArenaRobotConfig.java b/tablemanager/src/main/java/config/SArenaRobotConfig.java index 4e21d4b7b..132589d97 100644 --- a/tablemanager/src/main/java/config/SArenaRobotConfig.java +++ b/tablemanager/src/main/java/config/SArenaRobotConfig.java @@ -43,6 +43,10 @@ public class SArenaRobotConfig implements BaseConfig { private int yxldTotalForce; + private int yxldTotalForce1; + private int yxldTotalForce2; + private int yxldTotalForce3; + private int breakId; private int starBreakId; @@ -215,4 +219,28 @@ public class SArenaRobotConfig implements BaseConfig { public void setYxldTotalForce(int yxldTotalForce) { this.yxldTotalForce = yxldTotalForce; } + + public int getYxldTotalForce1() { + return yxldTotalForce1; + } + + public void setYxldTotalForce1(int yxldTotalForce1) { + this.yxldTotalForce1 = yxldTotalForce1; + } + + public int getYxldTotalForce2() { + return yxldTotalForce2; + } + + public void setYxldTotalForce2(int yxldTotalForce2) { + this.yxldTotalForce2 = yxldTotalForce2; + } + + public int getYxldTotalForce3() { + return yxldTotalForce3; + } + + public void setYxldTotalForce3(int yxldTotalForce3) { + this.yxldTotalForce3 = yxldTotalForce3; + } } \ No newline at end of file