4
0
mirror of https://github.com/AltarikMC/Launcher synced 2024-11-21 06:09:51 +01:00

fix ms login + updated msmc

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

18
package-lock.json generated
View File

@ -3386,9 +3386,9 @@
"dev": true
},
"minecraft-launcher-core": {
"version": "3.16.6",
"resolved": "https://registry.npmjs.org/minecraft-launcher-core/-/minecraft-launcher-core-3.16.6.tgz",
"integrity": "sha512-AQ9t3Gb86c8ju37ZSkhfHqxJQ6rv1I9mnxgrALqawpC0IuelykUF7So9k2QUzoD+sbwRxXMgllj9YymNkreL4A==",
"version": "3.16.8",
"resolved": "https://registry.npmjs.org/minecraft-launcher-core/-/minecraft-launcher-core-3.16.8.tgz",
"integrity": "sha512-0amflttrl/Ad+Q7DSPXbWYRdUdTCquZB+H/K/JbU6ZAx4VwfjSa08ancEYDktAlEBUwswzhiEpkf+Xgs0PWWng==",
"requires": {
"adm-zip": "^0.4.13",
"checksum": "^0.1.1",
@ -3460,9 +3460,9 @@
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
},
"msmc": {
"version": "2.1.3",
"resolved": "https://registry.npmjs.org/msmc/-/msmc-2.1.3.tgz",
"integrity": "sha512-g2X/VbdarLfT76reSKGgBKmnllliZnEx2KSxBTt53Y/BWek3WD6e1WfsYb3AOpNV34O9FEO2kbgelUb9FLmviQ==",
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/msmc/-/msmc-2.2.0.tgz",
"integrity": "sha512-nUvxPXpy/tnVcLbx4zUyEn88bAvWVJhhYNavnGVd4cebGMgiRv0SAxVE5pVMJAr5mtAqb9klxqZPNurIfvYdcg==",
"requires": {
"node-fetch": "^2.6.1"
}
@ -3944,9 +3944,9 @@
"dev": true
},
"path-parse": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz",
"integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==",
"version": "1.0.7",
"resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz",
"integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==",
"dev": true
},
"path-type": {

View File

@ -35,8 +35,8 @@
"electron-squirrel-startup": "^1.0.0",
"extract-zip": "^2.0.1",
"hasha": "^5.2.2",
"minecraft-launcher-core": "^3.16.6",
"msmc": "^2.1.3"
"minecraft-launcher-core": "^3.16.7",
"msmc": "^2.2.0"
},
"config": {
"forge": "./config.forge.js"

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) {