diff --git a/README.md b/README.md index fbd6615b..847de555 100644 --- a/README.md +++ b/README.md @@ -87,6 +87,13 @@ console.log(SteamUser.formatCurrency(123.45, SteamUser.ECurrencyCode.EUR)); // 1 There are a number of options which can control the behavior of the `SteamUser` object. They are: +### accountIdentifier + +A string which identifies the account. This is not the same as your SteamID. +It's used as salt for internal methods, for example when generating the machineId. + +Defaults to `null`, which means internal methods will be used to select a proper identifier. + ### dataDirectory Controls where the Steam server list and machine auth token files are written. If `null`, no data will be automatically diff --git a/components/09-logon.js b/components/09-logon.js index 010914b2..20a4b486 100644 --- a/components/09-logon.js +++ b/components/09-logon.js @@ -596,7 +596,8 @@ class SteamUserLogon extends SteamUserMachineAuth { } _getAccountIdentifier() { - return this._logOnDetails.account_name + return this.options.accountIdentifier + || this._logOnDetails.account_name || this._logOnDetails._newAuthAccountName || this._logOnDetails._steamid.toString(); } diff --git a/resources/default_options.js b/resources/default_options.js index bdd51483..6250985d 100644 --- a/resources/default_options.js +++ b/resources/default_options.js @@ -3,6 +3,7 @@ const EMachineIDType = require('./EMachineIDType.js'); /** * @typedef {object} OptionsObject + * @property {string|null} [accountIdentifier] * @property {string|null} [dataDirectory] * @property {boolean} [autoRelogin=true] * @property {EMachineIDType} [machineIdType] @@ -25,6 +26,7 @@ const EMachineIDType = require('./EMachineIDType.js'); module.exports = { autoRelogin: true, + accountIdentifier: null, machineIdType: EMachineIDType.AccountNameGenerated, machineIdFormat: ['SteamUser Hash BB3 {account_name}', 'SteamUser Hash FF2 {account_name}', 'SteamUser Hash 3B3 {account_name}'], enablePicsCache: false,