玉虚论道排行榜

back_recharge
xuexinpeng 2021-09-27 03:15:14 +08:00
parent 53de5be768
commit dc74736fdb
3 changed files with 17 additions and 15 deletions

View File

@ -66,7 +66,7 @@ public class CrossYuxulundaoChallengeHandler extends BaseHandler<ArenaInfoProto.
int day = calendar.get(Calendar.DAY_OF_WEEK);
int hour = calendar.get(Calendar.HOUR_OF_DAY);
int minute = calendar.get(Calendar.MINUTE);
if(day ==1 && hour ==23 && minute>30){
if (day == 1 && hour == 23 && minute > 30) {
throw new ErrorCodeException(ErrorCode.CROSS_YXLD_OVER);
}
ArenaManager arenaManager = user.getArenaManager();
@ -201,14 +201,14 @@ public class CrossYuxulundaoChallengeHandler extends BaseHandler<ArenaInfoProto.
res.setDefScore(loserGetScore);
myQuery.setCrossYuxulundaoNewScore(myQuery.getCrossYuxulundaoNewScore() + winerGetScore);
myQuery.setCrossYuxulundaoOldScore(myQuery.getCrossYuxulundaoOldScore() + winerGetScore);
rank.incrementRankScore(user.getId(), String.valueOf(crossGroup), winerGetScore);
rank.addRank(user.getId(), String.valueOf(crossGroup), myQuery.getCrossYuxulundaoNewScore());
if (defUid >= 1000) {
if (defQuery.getCrossYuxulundaoNewScore() >= winerGetScore) {
defQuery.setCrossYuxulundaoNewScore(defQuery.getCrossYuxulundaoNewScore() + loserGetScore);
rank.incrementRankScore(defUid, String.valueOf(crossGroup), loserGetScore);
rank.addRank(user.getId(), String.valueOf(crossGroup), defQuery.getCrossYuxulundaoNewScore());
} else {
//分数不够扣
rank.incrementRankScore(defUid, String.valueOf(crossGroup), -defQuery.getCrossYuxulundaoNewScore());
rank.addRank(user.getId(), String.valueOf(crossGroup), 0);
defQuery.setCrossYuxulundaoNewScore(0);
}
}
@ -219,17 +219,16 @@ public class CrossYuxulundaoChallengeHandler extends BaseHandler<ArenaInfoProto.
if (myQuery.getCrossYuxulundaoNewScore() + loserGetScore >= 0) {
myQuery.setCrossYuxulundaoNewScore(myQuery.getCrossYuxulundaoNewScore() + loserGetScore);
myQuery.setCrossYuxulundaoOldScore(myQuery.getCrossYuxulundaoOldScore() + loserGetScore);
rank.incrementRankScore(user.getId(), String.valueOf(crossGroup), loserGetScore);
rank.addRank(user.getId(), String.valueOf(crossGroup), myQuery.getCrossYuxulundaoNewScore());
} else {
//分数不够扣
rank.incrementRankScore(user.getId(), String.valueOf(crossGroup), -myQuery.getCrossYuxulundaoNewScore());
rank.addRank(user.getId(), String.valueOf(crossGroup), 0);
myQuery.setCrossYuxulundaoNewScore(0);
myQuery.setCrossYuxulundaoOldScore(0);
}
if (defUid >= 1000) {
//defQuery = CrossServiceLogic.getInstance().query(defUid);
defQuery.setCrossYuxulundaoNewScore(defQuery.getCrossYuxulundaoNewScore() + winerGetScore);
rank.incrementRankScore(defUid, String.valueOf(crossGroup), winerGetScore);
rank.addRank(user.getId(), String.valueOf(crossGroup), defQuery.getCrossYuxulundaoNewScore());
}
}
int id = SMServerRankConfig.getIdByScore(myQuery.getCrossYuxulundaoNewScore());
@ -283,15 +282,15 @@ public class CrossYuxulundaoChallengeHandler extends BaseHandler<ArenaInfoProto.
.append(ip).append("|")
.append(port).toString();
ClientAdapterPo<RPCRequestIFace.Client> rPCClient = null;
try{
try {
rPCClient = ClientAdapterPo.getClientAdapterPo(sb.toString());
crossArenaManager = rPCClient.getClient().getHeroManagerInfo(uid);
}catch (Exception e) {
} catch (Exception e) {
LOGGER.info("callback=>", e);
} finally {
if(rPCClient != null){
if (rPCClient != null) {
rPCClient.returnObject(sb.toString());
}else{
} else {
LOGGER.info("callback=> rPCClient is null ");
return null;
}

View File

@ -69,6 +69,9 @@ public class CrossYuxulundaoGetInfoHandler extends BaseHandler<ArenaInfoProto.Cr
builder.setIsFirst(false);
} else {
//赛季内第一次登陆请求
//删除上赛季的挑战记录
String key = RedisKey.getKey(RedisKey.CROSS_YUXULUNDAO_RECORD, String.valueOf(uid), false);
RedisUtil.getInstence().del(key);
//主线编队复制到第一队伍
TeamPosManager teamPosManager = user.getTeamPosManager();
Map<Integer, List<TeamPosHeroInfo>> teamPosForHero = teamPosManager.getTeamPosForHero();

View File

@ -81,8 +81,8 @@ public class CrossYuxulundaoLogic {
//TODO 删除初始化一些数据
String key1 = RedisUtil.getInstence().getKey(RedisKey.CROSS_YUXULUNDAO_RANK, String.valueOf(crossGroup));
String key2 = RedisUtil.getInstence().getKey(RedisKey.CROSS_YUXULUNDAO_ROBOT_INFO, String.valueOf(crossGroup));
String key3 = RedisUtil.getInstence().getKey(RedisKey.CROSS_YUXULUNDAO_RECORD, String.valueOf(crossGroup));
RedisUtil.getInstence().del(key1, key2, key3);
//String key3 = RedisUtil.getInstence().getKey(RedisKey.CROSS_YUXULUNDAO_RECORD, String.valueOf(crossGroup));
RedisUtil.getInstence().del(key1, key2);
AbstractRank rank = RankContext.getRankEnum(RankEnum.CROSS_YUXULUNDAO_RANK.getType());
int robotIndex = 100;
Random random = new Random();
@ -100,8 +100,8 @@ public class CrossYuxulundaoLogic {
}
while (--robotIndex >= 0) {
int server = random.nextInt(groupList.size());
rank.addRank(robotIndex, String.valueOf(crossGroup), 100 - robotIndex);
SArenaRobotConfig config = SArenaRobotConfig.getsArenaRobotConfigById(robotIds.get(robotIndex));
rank.addRank(robotIndex, String.valueOf(crossGroup), config.getMsScroe());
robotInfo.put(String.valueOf(robotIndex), new CrossArenaEnemy(robotIds.get(robotIndex), robotIndex, groupList.get(server), 0, config.getMsScroe(), random.nextBoolean(), PlayerLogic.getInstance().getRandomName2WithOutVerify(), config.getTotalForce(), config.getRoleLv()));
}
LOGGER.info("跨服玉虚论道初始化结束");