Version bump, warnings, code refactor!

This commit is contained in:
Pierce 2019-08-27 17:30:44 -04:00
parent 69a754721f
commit d83aadc4c3
3 changed files with 4 additions and 4 deletions

View file

@ -20,6 +20,8 @@ const launcher = new Client();
let opts = { let opts = {
clientPackage: null, clientPackage: null,
// For production launchers, I recommend not passing the getAuth function through the authorization field and instead
// handling authentication outside before you initialize MCLC so you can handle auth based errors and validation!
authorization: Authenticator.getAuth("username", "password"), authorization: Authenticator.getAuth("username", "password"),
root: "./minecraft", root: "./minecraft",
os: "windows", os: "windows",

View file

@ -417,9 +417,7 @@ class Handler {
const minArgs = this.options.overrides.minArgs || 5; const minArgs = this.options.overrides.minArgs || 5;
if(args.length < minArgs) args = args.concat(this.version.minecraftArguments ? this.version.minecraftArguments.split(' ') : this.version.arguments.game); if(args.length < minArgs) args = args.concat(this.version.minecraftArguments ? this.version.minecraftArguments.split(' ') : this.version.arguments.game);
if({}.toString.call(this.options.authorization) === "[object Promise]") { this.options.authorization = await Promise.resolve(this.options.authorization);
this.options.authorization = await this.options.authorization;
}
const fields = { const fields = {
'${auth_access_token}': this.options.authorization.access_token, '${auth_access_token}': this.options.authorization.access_token,

View file

@ -1,6 +1,6 @@
{ {
"name": "minecraft-launcher-core", "name": "minecraft-launcher-core",
"version": "3.10.0", "version": "3.10.1",
"description": "Lightweight module that downloads and runs Minecraft using javascript / NodeJS", "description": "Lightweight module that downloads and runs Minecraft using javascript / NodeJS",
"main": "index.js", "main": "index.js",
"dependencies": { "dependencies": {