mirror of
https://github.com/AltarikMC/Launcher
synced 2024-11-22 06:19:50 +01:00
Fix launcher still consider downloading assets when download failed (caused by corrupted files)
This commit is contained in:
parent
38fd3ad906
commit
73e4666659
@ -92,6 +92,10 @@ class Minecraft {
|
||||
max: args.maxMem,
|
||||
min: args.minMem
|
||||
}
|
||||
}).then(v => {
|
||||
if(v === null) {
|
||||
this.close(event, -1)
|
||||
}
|
||||
})
|
||||
this.launcher.on('debug', (e) => logger.info(`debug: ${e}`));
|
||||
this.launcher.on('data', (e) => logger.info(`data: ${e}`));
|
||||
@ -105,12 +109,7 @@ class Minecraft {
|
||||
logger.info(e)
|
||||
})
|
||||
this.launcher.on('close', (e) => {
|
||||
event.sender.send("close", e)
|
||||
if(e !== 0) {
|
||||
logger.warn("Minecraft didn't close properly")
|
||||
logger.warn(e)
|
||||
this.showNotification("Une erreur est survenue", "Minecraft ne s'est pas fermé correctement", "error")
|
||||
}
|
||||
this.close(event, e)
|
||||
})
|
||||
}).catch((err) => {
|
||||
this.showNotification("Impossible de lancer le jeu", "Erreur inconnue", "error")
|
||||
@ -127,6 +126,15 @@ class Minecraft {
|
||||
|
||||
}
|
||||
|
||||
close(event, code) {
|
||||
event.sender.send("close", code)
|
||||
if(code !== 0) {
|
||||
logger.warn("Minecraft didn't close properly")
|
||||
logger.warn(code)
|
||||
this.showNotification("Une erreur est survenue", "Minecraft ne s'est pas fermé correctement", "error")
|
||||
}
|
||||
}
|
||||
|
||||
getModsInformations(event) {
|
||||
fetch("https://altarik.fr/launcher.json").then(response => {
|
||||
if(response.ok) {
|
||||
|
Loading…
Reference in New Issue
Block a user