fix arena season
parent
d57017535f
commit
c8a03c009d
|
@ -128,7 +128,7 @@ public class ArenaLogic {
|
|||
PlayerManager playerInfoManager = user.getPlayerInfoManager();
|
||||
int score = RedisUtil.getInstence().getZSetScore(RedisKey.ARENA_RANK, Integer.toString(curSeason), Integer.toString(enemyId)).intValue();
|
||||
if(score == -1){
|
||||
score = RedisUtil.getInstence().getZSetScore(RedisKey.ARENA_RANK, Integer.toString(curSeason-1), Integer.toString(enemyId)).intValue();
|
||||
score = SArenaSetting.getSArenaSetting().getScore();
|
||||
}
|
||||
CommonProto.ArenaPersonInfo personInfoBuild = CommonProto.ArenaPersonInfo.newBuilder()
|
||||
.setUid(enemyId)
|
||||
|
@ -168,16 +168,8 @@ public class ArenaLogic {
|
|||
int myscoreChange=0;
|
||||
int defScoreChange=0;
|
||||
|
||||
if(arenaManager.getCount() != 0){
|
||||
myscore = RedisUtil.getInstence().getZSetScore(RedisKey.ARENA_RANK,Integer.toString(curSeason), Integer.toString(uid)).intValue();
|
||||
}else{
|
||||
if(curSeason>1){
|
||||
int lastScore = RedisUtil.getInstence().getZSetScore(RedisKey.ARENA_RANK, Integer.toString(curSeason - 1), Integer.toString(uid)).intValue();
|
||||
if(lastScore!=-1){
|
||||
myscore = lastScore;
|
||||
}
|
||||
}
|
||||
|
||||
if(arenaManager.getCount() != 0) {
|
||||
myscore = RedisUtil.getInstence().getZSetScore(RedisKey.ARENA_RANK, Integer.toString(curSeason), Integer.toString(uid)).intValue();
|
||||
}
|
||||
user.getTeamPosManager().setCurTeamPosId(teamId);
|
||||
|
||||
|
@ -192,15 +184,17 @@ public class ArenaLogic {
|
|||
defScore = RedisUtil.getInstence().getZSetScore(RedisKey.ARENA_RANK,Integer.toString(curSeason), Integer.toString(challengeUid)).intValue();
|
||||
defScoreChange = calScore(defScore, myscore,fightResult==1?0:1);
|
||||
myscoreChange = calScore(myscore, defScore,fightResult);
|
||||
arenaRecord.setAttackId(uid);
|
||||
arenaRecord.setDefScore(defScoreChange);
|
||||
arenaRecord.setAttackForce( HeroLogic.getInstance().calTeamTotalForce(user, GlobalsDef.TEAM_ARENA_DEFENSE,false));
|
||||
arenaRecord.setCreateTime((int)(System.currentTimeMillis()/1000));
|
||||
arenaRecord.setId(KeyGenUtils.produceIdByModule(UUIDEnum.ARENARECORD,uid));
|
||||
arenaRecord.setFightResult(fightResult^1);
|
||||
RedisUtil.getInstence().putMapEntry(RedisKey.ARENA_RRECORD,Integer.toString(challengeUid),arenaRecord.getId(),arenaRecord);
|
||||
RedisUtil.getInstence().incrementZsetScore(RedisKey.ARENA_RANK,Integer.toString(curSeason),Integer.toString(challengeUid),defScoreChange);
|
||||
MessageUtil.sendRedIndication(challengeUid,GlobalsDef.ARENA_CHALLENGE_TYPE);
|
||||
if(defUser.getArenaManager().getCount()!=0){
|
||||
arenaRecord.setAttackId(uid);
|
||||
arenaRecord.setDefScore(defScoreChange);
|
||||
arenaRecord.setAttackForce( HeroLogic.getInstance().calTeamTotalForce(user, GlobalsDef.TEAM_ARENA_DEFENSE,false));
|
||||
arenaRecord.setCreateTime((int)(System.currentTimeMillis()/1000));
|
||||
arenaRecord.setId(KeyGenUtils.produceIdByModule(UUIDEnum.ARENARECORD,uid));
|
||||
arenaRecord.setFightResult(fightResult^1);
|
||||
RedisUtil.getInstence().putMapEntry(RedisKey.ARENA_RRECORD,Integer.toString(challengeUid),arenaRecord.getId(),arenaRecord);
|
||||
RedisUtil.getInstence().incrementZsetScore(RedisKey.ARENA_RANK,Integer.toString(curSeason),Integer.toString(challengeUid),defScoreChange);
|
||||
MessageUtil.sendRedIndication(challengeUid,GlobalsDef.ARENA_CHALLENGE_TYPE);
|
||||
}
|
||||
}else{
|
||||
SArenaRobotConfig sArenaRobotConfig = SArenaRobotConfig.getsArenaRobotConfigById(challengeUid);
|
||||
fightResult = getFightResultByPersonToRobot(user, teamId,sArenaRobotConfig,skipFight,builder);
|
||||
|
@ -616,7 +610,6 @@ public class ArenaLogic {
|
|||
title = SErrorCodeEerverConfig.getI18NMessage("arena_season_reward_title");
|
||||
}
|
||||
Set<ZSetOperations.TypedTuple<String>> arenaRankInfo = RedisUtil.getInstence().getZsetreverseRangeWithScores(RedisKey.ARENA_RANK,Integer.toString(curSeason), 0, -1);
|
||||
int nextSeason = curSeason + 1;
|
||||
if(type == GlobalsDef.ARENA_SEASON_REWARD){
|
||||
curSeason=0;
|
||||
}
|
||||
|
@ -652,9 +645,6 @@ public class ArenaLogic {
|
|||
MailLogic.getInstance().sendMail(user.getId(),title,content,rewardByRank,nowTime, Global.MAIL_EFFECTIVE_TIME);
|
||||
}
|
||||
}
|
||||
if(type == GlobalsDef.ARENA_SEASON_REWARD){
|
||||
RedisUtil.getInstence().updateZsetScores(RedisKey.ARENA_RANK,Integer.toString(nextSeason),arenaRankInfo);
|
||||
}
|
||||
MongoUtil.getInstence().lastUpdate();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue