diff --git a/serverlogic/src/main/java/com/ljsd/jieling/handler/map/mapType/TowerMap.java b/serverlogic/src/main/java/com/ljsd/jieling/handler/map/mapType/TowerMap.java index 3e4e82bb2..a4cd3468d 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/handler/map/mapType/TowerMap.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/handler/map/mapType/TowerMap.java @@ -169,6 +169,9 @@ public class TowerMap extends AbstractMap { return; } int floor = mapManager.getTrialInfo().getFloor(); + if(floor==101){ + throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE); + } STrialConfig sTrialConfig; if(floor>10000){ TreeMap sTrialConfigMap = (TreeMap) STrialConfig.sTrialConfigMap; @@ -270,7 +273,7 @@ public class TowerMap extends AbstractMap { int i = 0; int[] monster = MathUtils.randomFromWeightWithTaking(sTrialConfig.getMonsterPoint(),4); while (cellMap4.size() < 4 ) { - if (i >= 10000) { + if (i >= 100) { break; } int cellLength = scMap1.getGroups().length; @@ -282,13 +285,13 @@ public class TowerMap extends AbstractMap { int y = scMap1.getGroups()[i][1]; int xy = CellUtil.xy2Pos(x, y); MapPointConfig mapPointConfig = MapPointConfig.scMapEventMap.get(monster[i]); + i++; if (mapPointConfig == null) { - LOGGER.info("====initTrialMap()====mapPointConfig == null======>{}", scMap1.getEvent()); + LOGGER.info("====initTrialMap()====mapPointConfig == null======>{}",monster[i]); continue; } Cell cellValue = new Cell(xy, mapPointConfig.getInitialEventId(), mapPointConfig.getId()); cellMap4.put(xy, cellValue); - i++; } } else { diff --git a/serverlogic/src/main/java/com/ljsd/jieling/kefu/Cmd_restart.java b/serverlogic/src/main/java/com/ljsd/jieling/kefu/Cmd_restart.java new file mode 100644 index 000000000..9076100e6 --- /dev/null +++ b/serverlogic/src/main/java/com/ljsd/jieling/kefu/Cmd_restart.java @@ -0,0 +1,36 @@ +package com.ljsd.jieling.kefu; + +import com.ljsd.jieling.core.HandlerLogicThread; +import com.ljsd.jieling.network.server.ProtocolsManager; + + +//restart +public class Cmd_restart extends GmRoleAbstract{ + @Override + public boolean exec(String[] args) throws Exception { + // User user = getUser(); +// user = MongoUtil.getInstence().getMyMongoTemplate().findById(User.getCollectionName(), user.getId(), User.class); +// if (user == null) { +// return false; +// } +// UserManager.addUser(user); +// HeroLogic.getInstance().calTeamTotalForce(user,1,true); + // BuyGoodsLogic.initOwernBagInfo(user); + if(args.length!=1){ + return true; + } + String name = ProtocolsManager.handlerThreads[Integer.valueOf(args[0])].getName(); + LOGGER.error("Exception to change thread name"+ name); + System.out.println("name = " + name); + try { + ProtocolsManager.handlerThreads[Integer.valueOf(args[0])].interrupt(); + }catch (Exception e){LOGGER.error(e.toString());} + + ProtocolsManager.handlerThreads[Integer.valueOf(args[0])]= new HandlerLogicThread(); + ProtocolsManager.handlerThreads[Integer.valueOf(args[0])].setPriority(9);//优先级最高 + ProtocolsManager.handlerThreads[Integer.valueOf(args[0])].setName("h-n" + Integer.valueOf(args[0])); + ProtocolsManager.handlerThreads[Integer.valueOf(args[0])].start(); + LOGGER.error("Exception new change thread ok"); + return true; + } +}