diff --git a/components/handler.js b/components/handler.js index f0d17fc..ef1d4c4 100644 --- a/components/handler.js +++ b/components/handler.js @@ -551,14 +551,14 @@ class Handler { if (args.length < minArgs) args = args.concat(this.version.minecraftArguments ? this.version.minecraftArguments.split(' ') : this.version.arguments.game) this.options.authorization = await Promise.resolve(this.options.authorization) - + this.options.authorization.meta = this.options.authorization.meta ? this.options.authorization.meta : { type: 'mojang' } const fields = { '${auth_access_token}': this.options.authorization.access_token, '${auth_session}': this.options.authorization.access_token, '${auth_player_name}': this.options.authorization.name, '${auth_uuid}': this.options.authorization.uuid, '${user_properties}': this.options.authorization.user_properties, - '${user_type}': 'mojang', + '${user_type}': this.options.authorization.meta.type, '${version_name}': this.options.version.number, '${assets_index_name}': this.version.assetIndex.id, '${game_directory}': this.options.overrides.gameDirectory || this.options.root, @@ -567,6 +567,10 @@ class Handler { '${version_type}': this.options.version.type } + if (this.options.authorization.meta.demo) { + args.push('--demo') + } + for (let index = 0; index < args.length; index++) { if (typeof args[index] === 'object') args.splice(index, 2) if (Object.keys(fields).includes(args[index])) { diff --git a/index.d.ts b/index.d.ts index bb5391e..19c55cc 100644 --- a/index.d.ts +++ b/index.d.ts @@ -143,12 +143,18 @@ declare module "minecraft-launcher-core" { authorization: Promise; } + + interface IUser { access_token: string; client_token: string; uuid: string; name: string; user_properties: Partial; + meta?: { + type: "mojang" | "msa", + demo?: boolean + }; } interface IProfile {