Merge branch 'master_test_hw' of http://60.1.1.230/backend/jieling_server into master_test_hw
commit
3075948147
|
@ -19,6 +19,9 @@ import com.ljsd.jieling.logic.dao.UserManager;
|
|||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.hero.HeroLogic;
|
||||
import com.ljsd.jieling.logic.mission.GameEvent;
|
||||
import com.ljsd.jieling.logic.rank.RankContext;
|
||||
import com.ljsd.jieling.logic.rank.RankEnum;
|
||||
import com.ljsd.jieling.logic.rank.rankImpl.AbstractRank;
|
||||
import com.ljsd.jieling.network.server.ProtocolsManager;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.protocols.ArenaInfoProto;
|
||||
|
@ -65,8 +68,10 @@ public class ArenaChallengeHandler extends BaseHandler<ArenaInfoProto.ArenaChall
|
|||
int myscoreChange=0;
|
||||
int defScoreChange=0;
|
||||
|
||||
AbstractRank rank = RankContext.getRankEnum(RankEnum.ARENA_RANK.getType());
|
||||
if(arenaManager.getCount()!=0 && arenaManager.getSeason()==curSeason) {
|
||||
myscore = RedisUtil.getInstence().getZSetScore(RedisKey.ARENA_RANK, Integer.toString(curSeason), Integer.toString(uid)).intValue();
|
||||
myscore=(int)(rank.getScoreById(uid, Integer.toString(curSeason)));
|
||||
// myscore = RedisUtil.getInstence().getZSetScore(RedisKey.ARENA_RANK, , Integer.toString(uid)).intValue();
|
||||
}
|
||||
user.getTeamPosManager().setCurTeamPosId(teamId);
|
||||
ArenaInfoProto.ArenaChallengeResponse.Builder builder = ArenaInfoProto.ArenaChallengeResponse.newBuilder();
|
||||
|
@ -79,7 +84,9 @@ public class ArenaChallengeHandler extends BaseHandler<ArenaInfoProto.ArenaChall
|
|||
if(fightResult == -1){
|
||||
throw new ErrorCodeException(ErrorCode.FIGHT_EXCEPTION);
|
||||
}
|
||||
defScore = RedisUtil.getInstence().getZSetScore(RedisKey.ARENA_RANK,Integer.toString(curSeason), Integer.toString(challengeUid)).intValue();
|
||||
defScore =(int)(rank.getScoreById(challengeUid, Integer.toString(curSeason)));
|
||||
|
||||
// defScore = RedisUtil.getInstence().getZSetScore(RedisKey.ARENA_RANK,Integer.toString(curSeason), Integer.toString(challengeUid)).intValue();
|
||||
if(defScore == -1){
|
||||
defScore = SArenaSetting.getSArenaSetting().getScore();
|
||||
}
|
||||
|
@ -92,7 +99,8 @@ public class ArenaChallengeHandler extends BaseHandler<ArenaInfoProto.ArenaChall
|
|||
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);
|
||||
rank.addRank(challengeUid,Integer.toString(curSeason),rank.getScoreById(challengeUid,Integer.toString(curSeason))+defScoreChange);
|
||||
// RedisUtil.getInstence().incrementZsetScore(RedisKey.ARENA_RANK,Integer.toString(curSeason),Integer.toString(challengeUid),defScoreChange);
|
||||
MessageUtil.sendRedIndication(challengeUid,GlobalsDef.ARENA_CHALLENGE_TYPE);
|
||||
}
|
||||
}else{
|
||||
|
@ -106,9 +114,13 @@ public class ArenaChallengeHandler extends BaseHandler<ArenaInfoProto.ArenaChall
|
|||
}
|
||||
LOGGER.info("the uid={},the defUid={},myscore={},defScore={},fightResult={},myScoreChange={},defScoreChange={}",uid,challengeUid,myscore,defScore,fightResult,myscoreChange,defScoreChange);
|
||||
if(arenaManager.getCount() == 0){
|
||||
RedisUtil.getInstence().incrementZsetScore(RedisKey.ARENA_RANK,Integer.toString(curSeason),Integer.toString(uid),myscoreChange + myscore);
|
||||
rank.addRank(uid,Integer.toString(curSeason),rank.getScoreById(uid,Integer.toString(curSeason))+myscoreChange + myscore);
|
||||
|
||||
// RedisUtil.getInstence().incrementZsetScore(RedisKey.ARENA_RANK,Integer.toString(curSeason),Integer.toString(uid),myscoreChange + myscore);
|
||||
}else{
|
||||
RedisUtil.getInstence().incrementZsetScore(RedisKey.ARENA_RANK,Integer.toString(curSeason),Integer.toString(uid),myscoreChange);
|
||||
rank.addRank(uid,Integer.toString(curSeason),rank.getScoreById(uid,Integer.toString(curSeason))+myscoreChange);
|
||||
|
||||
// RedisUtil.getInstence().incrementZsetScore(RedisKey.ARENA_RANK,Integer.toString(curSeason),Integer.toString(uid),myscoreChange);
|
||||
}
|
||||
ArenaLogic.getInstance().setMyArenaEnemys(uid,user);
|
||||
arenaManager.updateChallenge(fightResult);
|
||||
|
|
|
@ -3110,8 +3110,8 @@ public class MapLogic {
|
|||
itemIdList.add(item.getItemNum());
|
||||
});
|
||||
ReportUtil.onReportEvent(user,ReportEventEnum.COMPLETE_DAILY_DUNGEON.getType(),id,sDailyChallengeConfig.getMonsterId(),MonsterUtil.getMonsterForce(new int[]{sDailyChallengeConfig.getMonsterId()}),new Date(),"",0,itemIdList,itemNumList,type==1?"挑战":"扫荡");
|
||||
user.getUserMissionManager().onGameEvent(user,GameEvent.DAILY_CHALLENGE,sDailyChallengeConfig.getType());
|
||||
}
|
||||
user.getUserMissionManager().onGameEvent(user,GameEvent.DAILY_CHALLENGE,sDailyChallengeConfig.getType());
|
||||
MessageUtil.sendMessage(session,1,messageType.getNumber(),builder.build());
|
||||
}
|
||||
|
||||
|
|
|
@ -67,7 +67,9 @@ public class ArenaLogic {
|
|||
return curSeason;
|
||||
}
|
||||
|
||||
|
||||
public int getViewSeason() {
|
||||
return viewSeason;
|
||||
}
|
||||
|
||||
public List<CommonProto.ArenaEnemy> getArenaEnemyList(List<ArenaEnemy> arenaEnemies) throws Exception {
|
||||
List<CommonProto.ArenaEnemy> arenaEnemyList = new ArrayList<>(arenaEnemies.size());
|
||||
|
|
|
@ -33,7 +33,11 @@ public enum RankEnum {
|
|||
//达人排行榜
|
||||
EXPERT_RANK(21,RedisKey.EXPERT_RANK,GoldRank::new),//param1:活动进度 param2:无 param3:无
|
||||
FORCE_CURR_RANK(22,RedisKey.FORCE_CURR_RANK,ForceCurrRank::new),//param1:人物战力 param2:无 param3:无
|
||||
|
||||
ARENA_RANK(23,RedisKey.ARENA_RANK,ArenaRank::new),//param1:竞技场积分 param2:无 param3:无
|
||||
|
||||
SITUATION_RANK(24,RedisKey.SITUATION_RANK,SituationRank::new),//param1:通关次数 param2:无 param3:无
|
||||
|
||||
GUILD_CHALLENGE_RANK(26,RedisKey.GUILD_CHALLENGE_RANK,GuildChallengeRank::new),//param1:伤害 param2:无 param3:无
|
||||
;
|
||||
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
package com.ljsd.jieling.logic.rank.rankImpl;
|
||||
|
||||
import com.ljsd.jieling.logic.arena.ArenaLogic;
|
||||
import com.ljsd.jieling.protocols.PlayerInfoProto;
|
||||
|
||||
/**
|
||||
* @author lvxinran
|
||||
* @date 2020/9/3
|
||||
* @discribe
|
||||
*/
|
||||
public class ArenaRank extends AbstractRank {
|
||||
|
||||
public ArenaRank(int type, String redisKey) {
|
||||
super(type, redisKey);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PlayerInfoProto.RankResponse getRank(int uid, String rkey, int page, int rankEndLine) throws Exception {
|
||||
return super.getRank(uid, String.valueOf(ArenaLogic.getInstance().getViewSeason()), page, rankEndLine);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long[] getDataByScore(Double score) {
|
||||
return new long[]{score.longValue()};
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getScore(double... data) {
|
||||
return data[0];
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue