静态配置
parent
c3aa2c15f7
commit
c9f2e3514d
|
@ -38,7 +38,7 @@ public class MapStaticConfig extends AbstractClassStaticConfig {
|
|||
public void figureConfigs() {
|
||||
|
||||
try {
|
||||
setDifficult(difficultyMonster,difficultyReward);
|
||||
setDifficult();
|
||||
} catch (Exception e) {
|
||||
LOGGER.error("SEndlessDifficulty init fail");
|
||||
}
|
||||
|
@ -76,17 +76,17 @@ public class MapStaticConfig extends AbstractClassStaticConfig {
|
|||
return monsterMap;
|
||||
}
|
||||
|
||||
public static void setDifficult(Map<Integer, Integer> temp1,Map<Integer, Integer> temp2) throws Exception {
|
||||
public void setDifficult() throws Exception {
|
||||
SEndlessDifficulty baseDiff = STableManager.getConfig(SEndlessDifficulty.class).get(1);
|
||||
temp1 = new HashMap<>();
|
||||
temp2 = new HashMap<>();
|
||||
difficultyMonster = new HashMap<>();
|
||||
difficultyReward = new HashMap<>();
|
||||
ServerConfig serverConfigTmp = MongoUtil.getInstence().getMyMongoTemplate().findById(1, ServerConfig.class);
|
||||
if (serverConfigTmp.getWorldLevel() == 0) {
|
||||
for (int i = 0; i < baseDiff.getMonsterId().length; i++) {
|
||||
temp1.put(baseDiff.getMonsterId()[i], baseDiff.getMonsterId()[i]);
|
||||
difficultyMonster.put(baseDiff.getMonsterId()[i], baseDiff.getMonsterId()[i]);
|
||||
}
|
||||
for (int i = 0; i < baseDiff.getRewardId().length; i++) {
|
||||
temp2.put(baseDiff.getRewardId()[i], baseDiff.getRewardId()[i]);
|
||||
difficultyReward.put(baseDiff.getRewardId()[i], baseDiff.getRewardId()[i]);
|
||||
}
|
||||
} else {
|
||||
for (Map.Entry<Integer, SEndlessDifficulty> entry : STableManager.getConfig(SEndlessDifficulty.class).entrySet()) {
|
||||
|
@ -94,10 +94,10 @@ public class MapStaticConfig extends AbstractClassStaticConfig {
|
|||
continue;
|
||||
}
|
||||
for (int i = 0; i < baseDiff.getMonsterId().length; i++) {
|
||||
temp1.put(baseDiff.getMonsterId()[i], entry.getValue().getMonsterId()[i]);
|
||||
difficultyMonster.put(baseDiff.getMonsterId()[i], entry.getValue().getMonsterId()[i]);
|
||||
}
|
||||
for (int i = 0; i < baseDiff.getRewardId().length; i++) {
|
||||
temp2.put(baseDiff.getRewardId()[i], entry.getValue().getRewardId()[i]);
|
||||
difficultyReward.put(baseDiff.getRewardId()[i], entry.getValue().getRewardId()[i]);
|
||||
}
|
||||
|
||||
break;
|
||||
|
|
|
@ -173,7 +173,7 @@ public class GlobalDataManaager {
|
|||
MapLogic.getInstance().updateEndlessSeason(timeControllerOfFunction.getTimes());
|
||||
int level = calWorldLevel();
|
||||
serverConfigTmp.setWorldLevel(level);
|
||||
MapStaticConfig.setDifficult(STableManager.getFigureConfig(MapStaticConfig.class).getDifficultyMonster(),STableManager.getFigureConfig(MapStaticConfig.class).getDifficultyReward());
|
||||
STableManager.getFigureConfig(MapStaticConfig.class).setDifficult();
|
||||
MongoUtil.getLjsdMongoTemplate().save(serverConfigTmp);
|
||||
MapLogic.getInstance().setEndlessMapId(getEndleeMapIdByLevel());
|
||||
Map<Integer, ISession> onlineUserMap = OnlineUserManager.sessionMap;
|
||||
|
|
Loading…
Reference in New Issue