大闹天宫,默认怪物阵容

back_recharge
duhui 2021-03-17 15:30:01 +08:00
parent 1c518d0f73
commit a6a71fa7c0
2 changed files with 16 additions and 3 deletions

View File

@ -15,6 +15,8 @@ import com.ljsd.jieling.logic.rank.rankImpl.AbstractRank;
import com.ljsd.jieling.network.server.GlobalidHelper;
import com.ljsd.jieling.network.server.WorldHelper;
import com.ljsd.jieling.network.session.ISession;
import config.SExpeditionSetting;
import manager.STableManager;
import rpc.protocols.CommonProto;
import rpc.protocols.MessageTypeProto;
import rpc.protocols.PlayerInfoProto;
@ -28,8 +30,10 @@ import util.MathUtils;
import util.TimeUtils;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @author lvxinran
@ -132,6 +136,7 @@ public class RankLogic {
* @throws Exception
*/
public List<List<Integer>> getRandomUserByRank(User user,int counts) throws Exception {
List<List<Integer>> result = new ArrayList<>();
// 获取排行信息
PlayerInfoProto.RankResponse rankResponse = getRankInfo(user,1,50);
// 计时器
@ -139,10 +144,12 @@ public class RankLogic {
int rankSize = rankResponse.getRanksCount();
if (rankSize <= 0){
throw new ErrorCodeException(ErrorCode.SYS_ERROR_CODE,"战力排行榜暂无数据,没有人上榜");
// 排行榜没有玩家,走默认表配置
int[] defaults = STableManager.getConfig(SExpeditionSetting.class).get(1).getDefaultLineup();
List<Integer> collect = Arrays.stream(defaults).boxed().collect(Collectors.toList());
result.add(collect);
return result;
}
List<List<Integer>> result = new ArrayList<>();
// 计数器
int count = 0;
do {

View File

@ -36,6 +36,8 @@ public class SExpeditionSetting implements BaseConfig {
private int[][] playerLevelfix;
private int specialReward;
private int[] defaultLineup;
@Override
public void init() throws Exception {
@ -106,4 +108,8 @@ public class SExpeditionSetting implements BaseConfig {
public int getSpecialReward() {
return specialReward;
}
public int[] getDefaultLineup() {
return defaultLineup;
}
}