diff --git a/src/core/launch.ts b/src/core/launch.ts index 45ddc62..1ad2d6a 100644 --- a/src/core/launch.ts +++ b/src/core/launch.ts @@ -8,8 +8,8 @@ export function launch( logger: logger, detached = false, ) { - logger("launch", `[nlk ${packageVersion}] Working directory : ${gameRoot}`); - logger("launch", + logger("launch-process", `[nlk ${packageVersion}] Working directory : ${gameRoot}`); + logger("launch-process", `[nlk ${packageVersion}] Launching command : ${launchArguments.command} ${launchArguments.args.join(" ")}`, ); diff --git a/src/launcher/instance.ts b/src/launcher/instance.ts index 184f681..7652a4b 100644 --- a/src/launcher/instance.ts +++ b/src/launcher/instance.ts @@ -99,6 +99,9 @@ export class Instance extends EventEmitter { throw new InstallError("An error occured while initializing instance", "install-init", this.config, this.logger, { cause: error }) } + + this.log("libraries", "Downloading libraries") + try { const librariesDownloader = await LibrariesDownloader( this.config.paths.libraries, @@ -121,6 +124,8 @@ export class Instance extends EventEmitter { throw new InstallError("An error occured while downloading libraries", "libraries", this.config, this.logger, { cause: error }) } + this.log("assets", "Downloading assets") + try { const assetsDownloader = await AssetsDownloader( this.config.paths.assets, @@ -143,6 +148,8 @@ export class Instance extends EventEmitter { throw new InstallError("An error occured while downloading assets", "assets", this.config, this.logger, { cause: error }) } + this.log("natives", "Downloading natives") + try { const nativesDownloader = await NativesDownloader( path.join(this.config.paths.instance, "natives"), @@ -160,15 +167,18 @@ export class Instance extends EventEmitter { }); await nativesDownloader.run(); } catch (error) { - throw new InstallError("An error occured while downloadng natives", "natives", this.config, this.logger, { cause: error }) + throw new InstallError("An error occured while downloading natives", "natives", this.config, this.logger, { cause: error }) } + this.log("java", "Checking java") + const javaError = await checkJava(this.config.javaExecutable) if (javaError) { throw new InstallError("Invalid java provided", "java", this.config, this.logger, { cause: javaError }) } if (this.config.modloader) { + this.log("install-modloader", "Installing modloader") try { switch (this.config.modloader.name) { case "forge": @@ -185,7 +195,7 @@ export class Instance extends EventEmitter { throw new Error("Unknown modloader"); } } catch (error) { - throw new InstallError("An error occured while installing the modloader", "modloader", this.config, this.logger, { cause: error }) + throw new InstallError("An error occured while installing the modloader", "install-modloader", this.config, this.logger, { cause: error }) } } } @@ -198,6 +208,7 @@ export class Instance extends EventEmitter { } if (this.config.modloader) { + this.log("launch-modloader", "Preparing modloader") try { switch (this.config.modloader.name) { case "forge": @@ -209,10 +220,12 @@ export class Instance extends EventEmitter { throw new Error("Unknown modloader"); } } catch (error) { - throw new LaunchError("An error occured while preparing the modloader", "modloader", this.config, this.logger, { cause: error }) + throw new LaunchError("An error occured while preparing the modloader", "launch-modloader", this.config, this.logger, { cause: error }) } } + this.log("arguments", "Preparing launch arguments") + let args; try { args = await argumentsGenerator.generateLaunchArguments( @@ -224,6 +237,8 @@ export class Instance extends EventEmitter { throw new LaunchError("An error occured while generating launch arguments", "arguments", this.config, this.logger, { cause: error }) } + + this.log("launch-process", "Preparing launch arguments") try { const process = launch(args!, this.config.paths.instance, this.logger);