diff --git a/nge.cfg b/nge.cfg index 6d4d88df..036d6202 100644 --- a/nge.cfg +++ b/nge.cfg @@ -13,5 +13,4 @@ GALAXY_ID=2 GALAXY_NAME=Local Connection XPMULTIPLIER=1.0 MAXNUMBEROFCHARACTERS=2 -LOAD.RESOURCE.SYSTEM=1 MOTD=Welcome to PSWG Test Center! \ No newline at end of file diff --git a/src/main/NGECore.java b/src/main/NGECore.java index 02469dff..b081dc0b 100644 --- a/src/main/NGECore.java +++ b/src/main/NGECore.java @@ -240,6 +240,11 @@ public class NGECore { if (!(config.loadConfigFile())) { config = DefaultConfig.getConfig(); } + + Config options = new Config(); + options.setFilePath("options.cfg"); + boolean optionsConfigLoaded = options.loadConfigFile(); + // Database databaseConnection = new DatabaseConnection(); databaseConnection.connect(config.getString("DB.URL"), config.getString("DB.NAME"), config.getString("DB.USER"), config.getString("DB.PASS"), "postgresql"); @@ -309,7 +314,7 @@ public class NGECore { aiService = new AIService(this); //missionService = new MissionService(this); - if (config.getInt("LOAD.RESOURCE.SYSTEM") == 1) { + if (optionsConfigLoaded && options.getInt("LOAD.RESOURCE.SYSTEM") == 1) { surveyService = new SurveyService(this); resourceService = new ResourceService(this); } @@ -413,7 +418,7 @@ public class NGECore { objectService.loadBuildings(); - if (config.getInt("LOAD.RESOURCE.SYSTEM") == 1) { + if (optionsConfigLoaded && options.getInt("LOAD.RESOURCE.SYSTEM") > 0) { objectService.loadResourceRoots(); objectService.loadResources(); }