山河社稷gm
parent
afda78f8e0
commit
3811d59299
|
@ -27,5 +27,6 @@ public interface GlobalGm {
|
|||
int JOURNEY_GM = 24;//逍遥游GM操作
|
||||
// int TECNOLOGY_MAX = 21;//科技树一键满级
|
||||
// int POKEMAN_MAX = 22;//一键获得所有满级异妖
|
||||
int HARD_STAGE =25;//一键通关山河社稷图特定关卡之前的所有关卡
|
||||
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.ljsd.jieling.handler.GameGM;
|
||||
|
||||
import com.fasterxml.jackson.databind.deser.impl.CreatorCandidate;
|
||||
import com.ljsd.GameApplication;
|
||||
import com.ljsd.jieling.config.clazzStaticCfg.CommonStaticConfig;
|
||||
import com.ljsd.jieling.config.clazzStaticCfg.HeroStaticConfig;
|
||||
|
@ -16,6 +17,7 @@ import com.ljsd.jieling.handler.map.*;
|
|||
import com.ljsd.jieling.logic.dao.*;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.fight.CombatLogic;
|
||||
import com.ljsd.jieling.logic.hardStage.HardStageLogic;
|
||||
import com.ljsd.jieling.logic.mission.main.VipMissionIdsType;
|
||||
import com.ljsd.jieling.logic.player.PlayerLogic;
|
||||
import com.ljsd.jieling.netty.cocdex.PacketNetData;
|
||||
|
@ -444,6 +446,12 @@ public class GMRequestHandler extends BaseHandler{
|
|||
}
|
||||
cUser.getMapManager().updateJourneyInfoByMapId(prarm2,pathInfo);
|
||||
break;
|
||||
case GlobalGm.HARD_STAGE:
|
||||
//通关山河社稷图特定关卡的之前所有关卡
|
||||
int id = prarm1;
|
||||
HardStageLogic.test(cUser,id);
|
||||
HardStageLogic.sendHardStageIndication(cUser);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ public class HardStageManager extends MongoBase {
|
|||
return chapterMap;
|
||||
}
|
||||
|
||||
private Map<Integer, HardStageChapter> initChapterMap(User user) throws Exception {
|
||||
public Map<Integer, HardStageChapter> initChapterMap(User user) throws Exception {
|
||||
Map<Integer, HardStageChapter> map = new HashMap<>();
|
||||
SHardStage nodeOne = SHardStage.getConfigMap().get(1);//第一个节点
|
||||
if (user.getPlayerInfoManager().getLevel() < nodeOne.getLevelLimit()) {
|
||||
|
@ -86,6 +86,10 @@ public class HardStageManager extends MongoBase {
|
|||
}
|
||||
HardStageChapter chapter;
|
||||
chapter = chapterMap.computeIfAbsent(config.getChapter(), k -> initChapter(config.getChapter()));
|
||||
|
||||
if(chapter.getNodeList().stream().anyMatch(n->n.getId() == config.getId())){
|
||||
return;
|
||||
}
|
||||
HardStageNode node = initNode(config);
|
||||
chapter.addNodeList(node);
|
||||
/*if(chapterMap.containsKey(config.getChapter())){
|
||||
|
|
|
@ -25,7 +25,7 @@ public class HardStageChapter extends MongoBase {
|
|||
this.chapterId = chapterId;
|
||||
}
|
||||
|
||||
public List<HardStageNode> getNodeList() {
|
||||
public List<HardStageNode> getNodeList() {
|
||||
return nodeList;
|
||||
}
|
||||
|
||||
|
|
|
@ -12,6 +12,7 @@ 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.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
@ -20,6 +21,7 @@ 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;
|
||||
|
@ -330,4 +332,48 @@ public class HardStageLogic {
|
|||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* gm测试
|
||||
*
|
||||
* @param
|
||||
*/
|
||||
public static void test(User user,int id) throws Exception{
|
||||
user.getHardStageManager().getChapterMap(user);
|
||||
|
||||
for(int i=1;i<=id;i++){
|
||||
SHardStage config = SHardStage.getConfigMap().get(i);
|
||||
if(config != null){
|
||||
user.getHardStageManager().openNewNode(user,config);
|
||||
if(i == id){
|
||||
user.getHardStageManager().setCurChapter(config.getChapter());
|
||||
user.getHardStageManager().setCurNode(config.getSection());
|
||||
}
|
||||
}
|
||||
}
|
||||
//user.getHardStageManager().updateString("hardStageManager", user.getHardStageManager());
|
||||
Map<Integer, HardStageChapter> map = user.getHardStageManager().getChapterMap(user);
|
||||
//Set key = map.keySet();
|
||||
for(Integer key:map.keySet()){
|
||||
HardStageChapter chapter = map.get(key);
|
||||
chapter.getNodeList().stream().forEach(n->
|
||||
{
|
||||
if(!n.isHasPass()){
|
||||
if(n.getType()== 1){
|
||||
n.setState(7);
|
||||
chapter.addStars(3);
|
||||
user.getHardStageManager().updateString("chapterMap." + chapter.getChapterId(), chapter);
|
||||
//user.getHardStageManager().updateString("chapterMap",user.getHardStageManager().getChapterMap());
|
||||
|
||||
}else {
|
||||
n.setState(1);
|
||||
}
|
||||
n.setHasPass(true);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
//user.getHardStageManager().updateString("", user.getHardStageManager());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue