ConfigManager improvements. v0.0.1-alpha.1

Added new configuration option, launchDetached.
Added validation function to ConfigManager to add missing keys (due to updates).
Updated westeroscraft.json
Game process can now be detached from the launcher.
This commit is contained in:
Daniel Scalzi
2018-05-10 00:01:38 -04:00
parent f1a98f2d45
commit d33476bcf9
6 changed files with 67 additions and 16 deletions

View File

@@ -44,9 +44,14 @@ class ProcessBuilder {
console.log(args)
const child = child_process.spawn(ConfigManager.getJavaExecutable(), args, {
cwd: ConfigManager.getGameDirectory()
cwd: ConfigManager.getGameDirectory(),
detached: ConfigManager.isLaunchDetached()
})
if(ConfigManager.isLaunchDetached()){
child.unref()
}
child.stdout.on('data', (data) => {
console.log('Minecraft:', data.toString('utf8'))
})