mirror of
https://github.com/AltarikMC/Launcher
synced 2024-11-22 06:19:50 +01:00
fix ms login + updated msmc
This commit is contained in:
parent
cac1afbd31
commit
c8f598897d
18
package-lock.json
generated
18
package-lock.json
generated
@ -3386,9 +3386,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"minecraft-launcher-core": {
|
"minecraft-launcher-core": {
|
||||||
"version": "3.16.6",
|
"version": "3.16.8",
|
||||||
"resolved": "https://registry.npmjs.org/minecraft-launcher-core/-/minecraft-launcher-core-3.16.6.tgz",
|
"resolved": "https://registry.npmjs.org/minecraft-launcher-core/-/minecraft-launcher-core-3.16.8.tgz",
|
||||||
"integrity": "sha512-AQ9t3Gb86c8ju37ZSkhfHqxJQ6rv1I9mnxgrALqawpC0IuelykUF7So9k2QUzoD+sbwRxXMgllj9YymNkreL4A==",
|
"integrity": "sha512-0amflttrl/Ad+Q7DSPXbWYRdUdTCquZB+H/K/JbU6ZAx4VwfjSa08ancEYDktAlEBUwswzhiEpkf+Xgs0PWWng==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"adm-zip": "^0.4.13",
|
"adm-zip": "^0.4.13",
|
||||||
"checksum": "^0.1.1",
|
"checksum": "^0.1.1",
|
||||||
@ -3460,9 +3460,9 @@
|
|||||||
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
|
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
|
||||||
},
|
},
|
||||||
"msmc": {
|
"msmc": {
|
||||||
"version": "2.1.3",
|
"version": "2.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/msmc/-/msmc-2.1.3.tgz",
|
"resolved": "https://registry.npmjs.org/msmc/-/msmc-2.2.0.tgz",
|
||||||
"integrity": "sha512-g2X/VbdarLfT76reSKGgBKmnllliZnEx2KSxBTt53Y/BWek3WD6e1WfsYb3AOpNV34O9FEO2kbgelUb9FLmviQ==",
|
"integrity": "sha512-nUvxPXpy/tnVcLbx4zUyEn88bAvWVJhhYNavnGVd4cebGMgiRv0SAxVE5pVMJAr5mtAqb9klxqZPNurIfvYdcg==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"node-fetch": "^2.6.1"
|
"node-fetch": "^2.6.1"
|
||||||
}
|
}
|
||||||
@ -3944,9 +3944,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"path-parse": {
|
"path-parse": {
|
||||||
"version": "1.0.6",
|
"version": "1.0.7",
|
||||||
"resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz",
|
"resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz",
|
||||||
"integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==",
|
"integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"path-type": {
|
"path-type": {
|
||||||
|
@ -35,8 +35,8 @@
|
|||||||
"electron-squirrel-startup": "^1.0.0",
|
"electron-squirrel-startup": "^1.0.0",
|
||||||
"extract-zip": "^2.0.1",
|
"extract-zip": "^2.0.1",
|
||||||
"hasha": "^5.2.2",
|
"hasha": "^5.2.2",
|
||||||
"minecraft-launcher-core": "^3.16.6",
|
"minecraft-launcher-core": "^3.16.7",
|
||||||
"msmc": "^2.1.3"
|
"msmc": "^2.2.0"
|
||||||
},
|
},
|
||||||
"config": {
|
"config": {
|
||||||
"forge": "./config.forge.js"
|
"forge": "./config.forge.js"
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<html lang="fr">
|
<html lang="fr">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<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';" />
|
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';" />
|
||||||
<link href="assets/css/fonts.css" rel="stylesheet" />
|
<link href="assets/css/fonts.css" rel="stylesheet" />
|
||||||
<link href="assets/css/index.css" rel="stylesheet" />
|
<link href="assets/css/index.css" rel="stylesheet" />
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<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';" />
|
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';" />
|
||||||
<link href="assets/css/fonts.css" rel="stylesheet" />
|
<link href="assets/css/fonts.css" rel="stylesheet" />
|
||||||
<link href="assets/css/login.css" rel="stylesheet" />
|
<link href="assets/css/login.css" rel="stylesheet" />
|
||||||
|
@ -80,7 +80,7 @@ ipcMain.on("launch", (event, args) => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
function showNotification(title, body="") {
|
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) => {
|
ipcMain.on("notification", (event, args) => {
|
||||||
|
@ -30,7 +30,7 @@ class Minecraft {
|
|||||||
})
|
})
|
||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
event.sender.send("loginError")
|
event.sender.send("loginError")
|
||||||
logger.error(err)
|
logger.error("[MJ login] User haven't purchase the game")
|
||||||
showNotification("Erreur de connexion")
|
showNotification("Erreur de connexion")
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
@ -42,36 +42,37 @@ class Minecraft {
|
|||||||
* Used to login through a Microsoft account
|
* Used to login through a Microsoft account
|
||||||
*/
|
*/
|
||||||
microsoftLogin(event, win, showNotification) {
|
microsoftLogin(event, win, showNotification) {
|
||||||
msmc.getElectron().FastLaunch(
|
msmc.fastLaunch("electron",
|
||||||
(callback) => {
|
(update) => {
|
||||||
this.auth = msmc.getMCLC().getAuth(callback)
|
switch (update.type) {
|
||||||
this.auth.then(v => {
|
case "Error":
|
||||||
win.loadFile('src/client/index.html').then(() => {
|
|
||||||
event.sender.send("nick", { name: v.name })
|
|
||||||
})
|
|
||||||
}).catch((err) => {
|
|
||||||
event.sender.send("loginError")
|
event.sender.send("loginError")
|
||||||
logger.error(err)
|
showNotification("Une erreur est survenue", update.data)
|
||||||
showNotification("Erreur de connexion")
|
logger.error("MC-Account error:", update.data);
|
||||||
})
|
break;
|
||||||
},
|
}
|
||||||
(update) => {
|
}).then(result => {
|
||||||
switch (update.type) {
|
if(msmc.errorCheck(result)) {
|
||||||
case "Rejection":
|
event.sender.send("loginError")
|
||||||
event.sender.send("loginError")
|
logger.error(result.reason)
|
||||||
showNotification("Connexion rejetée")
|
showNotification("Erreur de connexion", result.reason)
|
||||||
logger.error("Fetch rejected!", update.data);
|
} else {
|
||||||
break;
|
if(!msmc.isDemoUser(result)) {
|
||||||
case "Error":
|
this.auth = msmc.getMCLC().getAuth(result)
|
||||||
event.sender.send("loginError")
|
win.loadFile('src/client/index.html').then(() => {
|
||||||
showNotification("Une erreur est survenue", update.data)
|
event.sender.send("nick", { name: this.auth.name })
|
||||||
logger.error("MC-Account error:", update.data);
|
})
|
||||||
break;
|
} else {
|
||||||
case "Cancelled":
|
event.sender.send("loginError")
|
||||||
logger.warn("Connexion annulée");
|
logger.error("[MS login] User haven't purchase the game")
|
||||||
event.sender.send("loginError")
|
showNotification("Erreur de connexion", "Vous ne possèdez pas de licence Minecraft sur ce compte")
|
||||||
}
|
}
|
||||||
}, "login")
|
}
|
||||||
|
}).catch(reason => {
|
||||||
|
event.sender.send("loginError")
|
||||||
|
logger.error(reason)
|
||||||
|
showNotification("Erreur de connexion")
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
launch(event, showNotification, args) {
|
launch(event, showNotification, args) {
|
||||||
|
Loading…
Reference in New Issue
Block a user