From 210c75d6fafdb2ef7b1b849f6d00b6d023a57c47 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 21 Mar 2023 22:59:02 +0000 Subject: [PATCH 1/2] Bump msmc from 3.1.4 to 4.0.5 Bumps [msmc](https://github.com/Hanro50/MSMC) from 3.1.4 to 4.0.5. - [Release notes](https://github.com/Hanro50/MSMC/releases) - [Commits](https://github.com/Hanro50/MSMC/commits) --- updated-dependencies: - dependency-name: msmc dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- package.json | 2 +- yarn.lock | 17 +++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index f48c740..5be1008 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ "hasha": "^5.2.2", "izitoast": "^1.4.0", "minecraft-launcher-core": "^3.16.18", - "msmc": "^3.1.4", + "msmc": "^4.0.5", "node-fetch": "^2.6.9", "vue": "^3.2.47" }, diff --git a/yarn.lock b/yarn.lock index c0bf6ca..314bd7a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2481,12 +2481,13 @@ ms@^2.0.0, ms@^2.1.1: resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== -msmc@^3.1.4: - version "3.1.4" - resolved "https://registry.yarnpkg.com/msmc/-/msmc-3.1.4.tgz#2a60cc22445f5ff44115fbe295aff7938b4088a9" - integrity sha512-3UHLlZXtFKRdJ3g6lb0vevC9RpObOE2+oiIS0SWLR2l75I60eXp6mF2XnFoZ7MgSeOmlwcU+lEGuIm3fT9UErg== +msmc@^4.0.5: + version "4.0.5" + resolved "https://registry.yarnpkg.com/msmc/-/msmc-4.0.5.tgz#8451ff18929394cb28dfe680d69b70eebd09b074" + integrity sha512-HT3OY8IAphEQqlDV1mS4ccoffIpE6nCWChmIL7Uxuc2iL3HQinb8ULq8q8jfDRrIUobtI5dqVlG3PlrQa/4s7g== dependencies: node-fetch "2.x" + tslib "^2.4.0" nanoid@^3.3.3: version "3.3.4" @@ -3493,10 +3494,10 @@ trim-repeated@^1.0.0: dependencies: escape-string-regexp "^1.0.2" -tslib@^2.1.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.0.tgz#7cecaa7f073ce680a05847aa77be941098f36dc3" - integrity sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ== +tslib@^2.1.0, tslib@^2.4.0: + version "2.5.0" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.5.0.tgz#42bfed86f5787aeb41d031866c8f402429e0fddf" + integrity sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg== tunnel-agent@^0.6.0: version "0.6.0" From f2056293e8580bb8a85a7e4742c0e6847b545943 Mon Sep 17 00:00:00 2001 From: Quentin Legot Date: Wed, 22 Mar 2023 19:35:10 +0100 Subject: [PATCH 2/2] Update minecraft.js to make it work with last msmc update --- src/server/minecraft.js | 38 ++++++++++++++++---------------------- 1 file changed, 16 insertions(+), 22 deletions(-) diff --git a/src/server/minecraft.js b/src/server/minecraft.js index 32e5dc1..e9e4c62 100644 --- a/src/server/minecraft.js +++ b/src/server/minecraft.js @@ -7,7 +7,7 @@ const { join } = require('path') const constants = require("constants") const zip = require('extract-zip') const logger = require('electron-log') -const msmc = require('msmc') +const { auth, lst } = require('msmc') const decompress = require('decompress') const decompressTar = require('decompress-targz') @@ -49,34 +49,28 @@ class Minecraft { * Used to login through a Microsoft account */ microsoftLogin(event, win) { - msmc.fastLaunch("electron", - (update) => { - switch (update.type) { - case "Error": - event.sender.send("loginError") - this.showNotification("Une erreur est survenue", update.data, "error") - logger.error("MC-Account error:", update.data); - break; - } - }).then(result => { - if(msmc.errorCheck(result)) { - event.sender.send("loginError") - logger.error(result.reason) - this.showNotification("Erreur de connexion", result.reason, "error") - } else { - if(!msmc.isDemoUser(result)) { - this.auth = msmc.getMCLC().getAuth(result) + const authManager = new auth("select_account") + authManager.launch("electron").then(async xboxManager => { + xboxManager.getMinecraft().then(async token => { + if(!token.isDemo()) { + this.auth = token.mclc() win.loadFile('src/client/index.html') } else { event.sender.send("loginError") logger.error("[MS login] User haven't purchase the game") this.showNotification("Erreur de connexion", "Vous ne possèdez pas de licence Minecraft sur ce compte", "error") } - } - }).catch(reason => { + }).catch(err => { + event.sender.send("loginError") + logger.error("[MS login] " + lst(err)) + this.showNotification("Erreur de connexion à Mojang", lst(err), "error") + }) + }).catch(err => { event.sender.send("loginError") - logger.error(reason) - this.showNotification("Erreur de connexion", "Erreur inconnue", "error") + if(err != "error.gui.closed") { + logger.error("[MS login] " + lst(err)) + this.showNotification("Une erreur de connexion à Xbox est survenue", lst(err), "error") + } }) }