罗浮争锋日志

back_recharge
duhui 2023-03-23 17:40:19 +08:00
parent 0de72cce63
commit d7dbcf5828
1 changed files with 27 additions and 21 deletions

View File

@ -172,18 +172,18 @@ public class GetWorldArenaChallengeRequestHandler extends BaseHandler<WorldProto
int teamId = proto.getTeamId();
CommonProto.FightTeamInfo fightTeamInfo = FightUtil.makePersonFightData(UserManager.getUser(iSession.getUid()), teamId, null, null);
FightResult fightResult = getFightForPVP(iSession.getUid(), challengeUid, fightTeamInfo, teamInfo, FightUtil.getFightSeed(),myForce<defendForce,FightType.CrossLuofuFight);
builder1.setFightResult(fightResult.getResult());
int seed = fightResult.getSeed();
int result = fightResult.getResult();
builder1.setFightResult(result);
CommonProto.FightData build = CommonProto.FightData.newBuilder()
.setFightMaxTime(SArenaSetting.getSArenaSetting().getMostTime())
.setFightSeed(seed)
.setFightSeed(fightResult.getSeed())
.setHeroFightInfos(fightResult.getFightTeamInfo())
.addMonsterList(fightResult.getDefFightTeamInfo())
.build();
builder1.setFightData(build);
WorldProto.WroldBattleRecord.Builder builder = WorldProto.WroldBattleRecord.newBuilder();
builder.setFightData(fightResult.getFightData());
builder.setResult(fightResult.getResult());
builder.setResult(result);
String s = KeyGenUtils.produceIdByModule(UUIDEnum.ARENARECORD, iSession.getUid());
builder.setRecordId(s);
builder.setAttackTime(TimeUtils.nowInt());
@ -192,24 +192,29 @@ public class GetWorldArenaChallengeRequestHandler extends BaseHandler<WorldProto
builder.setBlueEnemy(arenaEnemys);
int[][] reward = new int[1][];
LOGGER.info("罗浮争锋,{}挑战{},结果:{},敌我当前排名:{}-{}",user.getId(),challengeUid,result,myRank,challengeRank);
//打赢
if (fightResult.getResult() > 0) {
if (result > 0) {
// if (proto.getChallengeUid() < 1000) {
// RedisUtil.getInstence().set(RedisKey.WORLD_ARENA_RANK_MY_MATH, String.valueOf(iSession.getUid()), new HashSet<>());
double myScore = rank.getScoreById(iSession.getUid(), groupStr);
double defScore = rank.getScoreById(challengeUid, groupStr);
if (myRank == -1) {
//第一次 没有上榜的时候
rank.removeOneRankByPiece(groupStr, String.valueOf(challengeUid));
rank.addRank(iSession.getUid(), groupStr, score);
newRank = rank.getRankIndexByKey(groupStr, iSession.getUid());
LOGGER.info("罗浮争锋,赢了之后得结果:{},我的分数和排名:{}-{},敌人下榜", user.getId(), newRank, score);
// if(challengeUid >1000){
// RedisUtil.getInstence().set(RedisKey.WORLD_ARENA_RANK_MY_MATH, String.valueOf(challengeUid), new HashSet<>());
// ArenaLogic.randomRank(proto.getChallengeUid(),9999, crossGroup);
// }
}else if(rank.getScoreById(iSession.getUid(), groupStr)<rank.getScoreById(challengeUid, groupStr)){
} else if (myScore < defScore) {
//在榜上 且排名要升高
rank.addRank(challengeUid, groupStr,rank.getScoreById(iSession.getUid(), groupStr));
rank.addRank(challengeUid, groupStr, myScore);
rank.addRank(iSession.getUid(), groupStr, score);
newRank = rank.getRankIndexByKey(groupStr, iSession.getUid());
LOGGER.info("罗浮争锋,赢了之后得结果:{},我的分数和排名:{}-{},敌人排名:{}-{}", user.getId(), newRank, score, challengeUid, myScore);
// if(challengeUid >1000){
// RedisUtil.getInstence().set(RedisKey.WORLD_ARENA_RANK_MY_MATH, String.valueOf(challengeUid), new HashSet<>());
// ArenaLogic.randomRank(proto.getChallengeUid(),myRank, crossGroup);
@ -217,6 +222,7 @@ public class GetWorldArenaChallengeRequestHandler extends BaseHandler<WorldProto
} else {
//排名不需升高,拿自己的排名重新匹配
newRank = myRank;
LOGGER.info("罗浮争锋,赢了之后得结果:{},敌我排名不变", user.getId());
}
List<CommonProto.ArenaEnemy> arenaEnemyList = ArenaLogic.randomRank(iSession.getUid(), newRank, crossGroup);
//新的匹配信息给前端