4
0
mirror of https://github.com/AltarikMC/Launcher synced 2025-12-13 11:41:45 +00:00

fix ms login + updated msmc

This commit is contained in:
2021-08-29 14:11:34 +02:00
parent cac1afbd31
commit c8f598897d
6 changed files with 45 additions and 44 deletions

View File

@@ -2,7 +2,7 @@
<html lang="fr">
<head>
<meta charset="UTF-8">
<title>Launcher Projet Secret</title>
<title>Altarik Launcher</title>
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';" />
<link href="assets/css/fonts.css" rel="stylesheet" />
<link href="assets/css/index.css" rel="stylesheet" />

View File

@@ -2,7 +2,7 @@
<html>
<head>
<meta charset="UTF-8">
<title>Launcher Projet Secret</title>
<title>Altarik Launcher</title>
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';" />
<link href="assets/css/fonts.css" rel="stylesheet" />
<link href="assets/css/login.css" rel="stylesheet" />

View File

@@ -80,7 +80,7 @@ ipcMain.on("launch", (event, args) => {
})
function showNotification(title, body="") {
new Notification({ title: title, body: body }).show()
new Notification({ title: title, body: body, silent: false, icon: "../../icon.ico"}).show()
}
ipcMain.on("notification", (event, args) => {

View File

@@ -30,7 +30,7 @@ class Minecraft {
})
}).catch((err) => {
event.sender.send("loginError")
logger.error(err)
logger.error("[MJ login] User haven't purchase the game")
showNotification("Erreur de connexion")
})
} else {
@@ -42,36 +42,37 @@ class Minecraft {
* Used to login through a Microsoft account
*/
microsoftLogin(event, win, showNotification) {
msmc.getElectron().FastLaunch(
(callback) => {
this.auth = msmc.getMCLC().getAuth(callback)
this.auth.then(v => {
win.loadFile('src/client/index.html').then(() => {
event.sender.send("nick", { name: v.name })
})
}).catch((err) => {
msmc.fastLaunch("electron",
(update) => {
switch (update.type) {
case "Error":
event.sender.send("loginError")
logger.error(err)
showNotification("Erreur de connexion")
})
},
(update) => {
switch (update.type) {
case "Rejection":
event.sender.send("loginError")
showNotification("Connexion rejetée")
logger.error("Fetch rejected!", update.data);
break;
case "Error":
event.sender.send("loginError")
showNotification("Une erreur est survenue", update.data)
logger.error("MC-Account error:", update.data);
break;
case "Cancelled":
logger.warn("Connexion annulée");
event.sender.send("loginError")
}
}, "login")
showNotification("Une erreur est survenue", update.data)
logger.error("MC-Account error:", update.data);
break;
}
}).then(result => {
if(msmc.errorCheck(result)) {
event.sender.send("loginError")
logger.error(result.reason)
showNotification("Erreur de connexion", result.reason)
} else {
if(!msmc.isDemoUser(result)) {
this.auth = msmc.getMCLC().getAuth(result)
win.loadFile('src/client/index.html').then(() => {
event.sender.send("nick", { name: this.auth.name })
})
} else {
event.sender.send("loginError")
logger.error("[MS login] User haven't purchase the game")
showNotification("Erreur de connexion", "Vous ne possèdez pas de licence Minecraft sur ce compte")
}
}
}).catch(reason => {
event.sender.send("loginError")
logger.error(reason)
showNotification("Erreur de connexion")
})
}
launch(event, showNotification, args) {