view arena rank
parent
9c60e7b986
commit
2a55d0779d
|
@ -61,6 +61,7 @@ public class ArenaLogic {
|
|||
}
|
||||
|
||||
private int curSeason;
|
||||
private int viewSeason;
|
||||
|
||||
|
||||
|
||||
|
@ -425,9 +426,6 @@ public class ArenaLogic {
|
|||
|
||||
|
||||
public void getWorldRankByPage(ISession session,int page) throws Exception {
|
||||
if(curSeason == 0){
|
||||
throw new ErrorCodeException(ErrorCode.newDefineCode("season_close"));
|
||||
}
|
||||
if (page == 0) {
|
||||
page = 1;
|
||||
}
|
||||
|
@ -436,7 +434,7 @@ public class ArenaLogic {
|
|||
|
||||
int rankEndLine = SSpecialConfig.getIntegerValue(SSpecialConfig.ARENA_RANKINGSHOWNUM);
|
||||
if(end<rankEndLine) {
|
||||
Set<ZSetOperations.TypedTuple<String>> arenaRankInfo = RedisUtil.getInstence().getZsetreverseRangeWithScores(RedisKey.ARENA_RANK, Integer.toString(curSeason), start, end);
|
||||
Set<ZSetOperations.TypedTuple<String>> arenaRankInfo = RedisUtil.getInstence().getZsetreverseRangeWithScores(RedisKey.ARENA_RANK, Integer.toString(viewSeason), start, end);
|
||||
for (ZSetOperations.TypedTuple<String> item : arenaRankInfo) {
|
||||
String value = item.getValue();
|
||||
int score = item.getScore().intValue();
|
||||
|
@ -471,12 +469,12 @@ public class ArenaLogic {
|
|||
}
|
||||
}
|
||||
int uid = session.getUid();
|
||||
int score = RedisUtil.getInstence().getZSetScore(RedisKey.ARENA_RANK,Integer.toString(curSeason), Integer.toString(uid)).intValue();
|
||||
int score = RedisUtil.getInstence().getZSetScore(RedisKey.ARENA_RANK,Integer.toString(viewSeason), Integer.toString(uid)).intValue();
|
||||
int myRank =-1;
|
||||
if(score == -1){
|
||||
score = SArenaSetting.getSArenaSetting().getScore();
|
||||
}else{
|
||||
myRank= RedisUtil.getInstence().getZSetreverseRank(RedisKey.ARENA_RANK,Integer.toString(curSeason),Integer.toString(uid)).intValue();
|
||||
myRank= RedisUtil.getInstence().getZSetreverseRank(RedisKey.ARENA_RANK,Integer.toString(viewSeason),Integer.toString(uid)).intValue();
|
||||
}
|
||||
|
||||
ArenaInfoProto.GetArenaRankInfoResponse buildResponse = ArenaInfoProto.GetArenaRankInfoResponse.newBuilder()
|
||||
|
@ -666,6 +664,9 @@ public class ArenaLogic {
|
|||
|
||||
public void updateArenaSeason(int curSeason){
|
||||
this.curSeason = curSeason;
|
||||
if(this.curSeason!=0){
|
||||
viewSeason = this.curSeason;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue