Added Options config field to NGECore class

This commit is contained in:
Waverunner
2014-08-10 21:08:51 -04:00
parent 556c783b1b
commit 291acd5e22
8 changed files with 39 additions and 39 deletions
+15 -7
View File
@@ -154,6 +154,7 @@ public class NGECore {
private static NGECore instance;
private Config config = null;
private Config options = null;
private String motd = "";
private volatile boolean isShuttingDown = false;
private long galacticTime = System.currentTimeMillis();
@@ -272,12 +273,15 @@ public class NGECore {
config = DefaultConfig.getConfig();
}
Config options = new Config();
options = new Config();
options.setFilePath("options.cfg");
boolean optionsConfigLoaded = options.loadConfigFile();
if (!(options.loadConfigFile())) {
System.err.println("Failed to load options.cfg!");
options = DefaultConfig.getConfig();
}
//if (optionsConfigLoaded && options.getInt("CLEAN.ODB.FOLDERS") > 0 || getExcludedDevelopers().contains(System.getProperty("user.name"))){
if (optionsConfigLoaded && options.getInt("CLEAN.ODB.FOLDERS") > 0){
if (options.getInt("CLEAN.ODB.FOLDERS") > 0){
File baseFolder = new File("./odb");
if (baseFolder.isDirectory()) {
@@ -358,7 +362,7 @@ public class NGECore {
reverseEngineeringService = new ReverseEngineeringService(this);
petService = new PetService(this);
if (optionsConfigLoaded && options.getInt("LOAD.RESOURCE.SYSTEM") == 1) {
if (options.getInt("LOAD.RESOURCE.SYSTEM") == 1) {
surveyService = new SurveyService(this);
resourceService = new ResourceService(this);
}
@@ -434,7 +438,7 @@ public class NGECore {
zoneDispatch.addService(petService);
zoneDispatch.addService(invasionService);
if (optionsConfigLoaded && options.getInt("LOAD.RESOURCE.SYSTEM") == 1) {
if (options.getInt("LOAD.RESOURCE.SYSTEM") == 1) {
zoneDispatch.addService(surveyService);
zoneDispatch.addService(resourceService);
}
@@ -505,7 +509,7 @@ public class NGECore {
//end terrainList
if (optionsConfigLoaded && options.getInt("LOAD.RESOURCE.SYSTEM") > 0) {
if (options.getInt("LOAD.RESOURCE.SYSTEM") > 0) {
resourceService.loadResources();
}
@@ -868,5 +872,9 @@ public class NGECore {
// without having to change options.cfg all the time
return excludedDevelopers;
}
public Config getOptions() {
return options;
}
}