日常本战力校验添加

back_recharge
lvxinran 2020-07-04 06:17:57 +08:00
parent 4971fced7b
commit 0d0acca185
2 changed files with 18 additions and 13 deletions

View File

@ -3075,18 +3075,23 @@ public class MapLogic {
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
}
}
int[] openRules = sDailyChallengeConfig.getOpenRules();
int[][] openRules = sDailyChallengeConfig.getOpenRules();
boolean open = true;
switch (openRules[0]){
case 1:
open = playerInfoManager.getLevel()>=openRules[1];
break;
case 2:
open = SMainLevelConfig.biggerThanFight(user.getMainLevelManager().getFightId(),openRules[1]);
break;
}
if(!open){
throw new ErrorCodeException(ErrorCode.DAILY_NO_OPEN);
for(int[] rule:openRules){
switch (rule[0]){
case 1:
open = playerInfoManager.getLevel()>=rule[1];
break;
case 2:
open = SMainLevelConfig.biggerThanFight(user.getMainLevelManager().getFightId(),rule[1]);
break;
case 3:
open = playerInfoManager.getMaxForce()>=rule[1];
break;
}
if(!open){
throw new ErrorCodeException(ErrorCode.DAILY_NO_OPEN);
}
}

View File

@ -12,7 +12,7 @@ public class SDailyChallengeConfig implements BaseConfig {
private int type;
private int[] openRules;
private int[][] openRules;
private int[] reward;
@ -35,7 +35,7 @@ public class SDailyChallengeConfig implements BaseConfig {
return type;
}
public int[] getOpenRules() {
public int[][] getOpenRules() {
return openRules;
}