山河社稷该表容错
parent
c610caaf41
commit
84ce7b9a1b
|
@ -9,10 +9,8 @@ import com.ljsd.jieling.logic.dao.root.User;
|
|||
import com.ljsd.jieling.logic.fight.specialparm.SpecialForTeamBuildEnum;
|
||||
import com.ljsd.jieling.logic.hero.HeroLogic;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.util.ItemMap;
|
||||
import com.ljsd.jieling.util.ItemUtil;
|
||||
import com.ljsd.jieling.util.MessageUtil;
|
||||
import com.sun.codemodel.internal.JForEach;
|
||||
import config.*;
|
||||
import org.assertj.core.util.Lists;
|
||||
import org.slf4j.Logger;
|
||||
|
@ -22,12 +20,8 @@ import rpc.protocols.MessageTypeProto;
|
|||
import rpc.protocols.PlayerInfoProto;
|
||||
import util.StringUtil;
|
||||
|
||||
import javax.swing.text.StyledEditorKit;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Arrays;
|
||||
import java.util.stream.Stream;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class HardStageLogic {
|
||||
|
||||
|
@ -47,6 +41,30 @@ public class HardStageLogic {
|
|||
CommonProto.HardStageInfo.Builder builder = CommonProto.HardStageInfo.newBuilder();
|
||||
int needSaveChapterId = 0;
|
||||
int needSaveStarNum = 0;
|
||||
//对策划改表的容错
|
||||
//int maxChapter = map.keySet().stream().mapToInt(Integer::intValue).max().getAsInt();
|
||||
OptionalInt maxChapter = map.keySet().stream().mapToInt(Integer::intValue).max();
|
||||
if(maxChapter.isPresent()){
|
||||
if(map.containsKey(maxChapter.getAsInt())){
|
||||
int maxId = map.get(maxChapter.getAsInt()).getNodeList().stream().mapToInt(n->n.getId()).max().getAsInt();
|
||||
|
||||
if(map.get(maxChapter.getAsInt()).getNodeList().stream().filter(n -> n.getId()== maxId&& n.isHasPass()==true).collect(Collectors.toList()).size()>0){
|
||||
SHardStage config = SHardStage.getConfigMap().get(maxId);
|
||||
if(config != null){
|
||||
if (SHardStage.getPreList(config.getId()) != null) {
|
||||
SHardStage.getPreList(config.getId()).stream().forEach(n -> {
|
||||
if (n != null) {
|
||||
if(user.getHardStageManager().openNewNode(user.getPlayerInfoManager().getLevel(), n)){
|
||||
user.getHardStageManager().updateString("chapterMap." + maxChapter.getAsInt(), map.get(maxChapter.getAsInt()));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (Map.Entry<Integer, HardStageChapter> entry : map.entrySet()) {
|
||||
//章节信息
|
||||
CommonProto.HardStageChapter.Builder chapterBuilder = CommonProto.HardStageChapter.newBuilder();
|
||||
|
|
Loading…
Reference in New Issue