mirror of
https://github.com/dscalzi/HeliosLauncher.git
synced 2024-12-22 11:42:14 -08:00
Cleaning up jsdocs to be more aligned with the standard.
This commit is contained in:
parent
d3c5997baa
commit
4fd202d180
@ -39,11 +39,11 @@ class Asset {
|
|||||||
/**
|
/**
|
||||||
* Create an asset.
|
* Create an asset.
|
||||||
*
|
*
|
||||||
* @param {any} id - id of the asset.
|
* @param {any} id The id of the asset.
|
||||||
* @param {String} hash - hash value of the asset.
|
* @param {string} hash The hash value of the asset.
|
||||||
* @param {Number} size - size in bytes of the asset.
|
* @param {number} size The size in bytes of the asset.
|
||||||
* @param {String} from - url where the asset can be found.
|
* @param {string} from The url where the asset can be found.
|
||||||
* @param {String} to - absolute local file path of the asset.
|
* @param {string} to The absolute local file path of the asset.
|
||||||
*/
|
*/
|
||||||
constructor(id, hash, size, from, to){
|
constructor(id, hash, size, from, to){
|
||||||
this.id = id
|
this.id = id
|
||||||
@ -80,8 +80,8 @@ class Library extends Asset {
|
|||||||
* property has instead specified an OS, the library can be downloaded on any OS EXCLUDING
|
* property has instead specified an OS, the library can be downloaded on any OS EXCLUDING
|
||||||
* the one specified.
|
* the one specified.
|
||||||
*
|
*
|
||||||
* @param {Object} rules - the Library's download rules.
|
* @param {Object} rules The Library's download rules.
|
||||||
* @returns {Boolean} - true if the Library follows the specified rules, otherwise false.
|
* @returns {boolean} True if the Library follows the specified rules, otherwise false.
|
||||||
*/
|
*/
|
||||||
static validateRules(rules){
|
static validateRules(rules){
|
||||||
if(rules == null) return true
|
if(rules == null) return true
|
||||||
@ -115,12 +115,12 @@ class DistroModule extends Asset {
|
|||||||
* not equivalent to the module objects in the
|
* not equivalent to the module objects in the
|
||||||
* distro index.
|
* distro index.
|
||||||
*
|
*
|
||||||
* @param {any} id - id of the asset.
|
* @param {any} id The id of the asset.
|
||||||
* @param {String} hash - hash value of the asset.
|
* @param {string} hash The hash value of the asset.
|
||||||
* @param {Number} size - size in bytes of the asset.
|
* @param {number} size The size in bytes of the asset.
|
||||||
* @param {String} from - url where the asset can be found.
|
* @param {string} from The url where the asset can be found.
|
||||||
* @param {String} to - absolute local file path of the asset.
|
* @param {string} to The absolute local file path of the asset.
|
||||||
* @param {String} type - the module type.
|
* @param {string} type The the module type.
|
||||||
*/
|
*/
|
||||||
constructor(id, hash, size, from, to, type){
|
constructor(id, hash, size, from, to, type){
|
||||||
super(id, hash, size, from, to)
|
super(id, hash, size, from, to)
|
||||||
@ -138,9 +138,9 @@ class DLTracker {
|
|||||||
/**
|
/**
|
||||||
* Create a DLTracker
|
* Create a DLTracker
|
||||||
*
|
*
|
||||||
* @param {Array.<Asset>} dlqueue - an array containing assets queued for download.
|
* @param {Array.<Asset>} dlqueue An array containing assets queued for download.
|
||||||
* @param {Number} dlsize - the combined size of each asset in the download queue array.
|
* @param {number} dlsize The combined size of each asset in the download queue array.
|
||||||
* @param {function(Asset)} callback - optional callback which is called when an asset finishes downloading.
|
* @param {function(Asset)} callback Optional callback which is called when an asset finishes downloading.
|
||||||
*/
|
*/
|
||||||
constructor(dlqueue, dlsize, callback = null){
|
constructor(dlqueue, dlsize, callback = null){
|
||||||
this.dlqueue = dlqueue
|
this.dlqueue = dlqueue
|
||||||
@ -167,8 +167,8 @@ class AssetGuard extends EventEmitter {
|
|||||||
* On creation the object's properties are never-null default
|
* On creation the object's properties are never-null default
|
||||||
* values. Each identifier is resolved to an empty DLTracker.
|
* values. Each identifier is resolved to an empty DLTracker.
|
||||||
*
|
*
|
||||||
* @param {String} basePath - base path for asset validation (game root).
|
* @param {string} basePath The base path for asset validation (game root).
|
||||||
* @param {String} javaexec - path to a java executable which will be used
|
* @param {string} javaexec The path to a java executable which will be used
|
||||||
* to finalize installation.
|
* to finalize installation.
|
||||||
*/
|
*/
|
||||||
constructor(basePath, javaexec){
|
constructor(basePath, javaexec){
|
||||||
@ -190,9 +190,9 @@ class AssetGuard extends EventEmitter {
|
|||||||
* 'net.minecraftforge:forge:1.11.2-13.20.0.2282', '.jar' becomes
|
* 'net.minecraftforge:forge:1.11.2-13.20.0.2282', '.jar' becomes
|
||||||
* net\minecraftforge\forge\1.11.2-13.20.0.2282\forge-1.11.2-13.20.0.2282.jar
|
* net\minecraftforge\forge\1.11.2-13.20.0.2282\forge-1.11.2-13.20.0.2282.jar
|
||||||
*
|
*
|
||||||
* @param {String} artifactid - the artifact id string.
|
* @param {string} artifactid The artifact id string.
|
||||||
* @param {String} extension - the extension of the file at the resolved path.
|
* @param {string} extension The extension of the file at the resolved path.
|
||||||
* @returns {String} - the resolved relative path from the artifact id.
|
* @returns {string} The resolved relative path from the artifact id.
|
||||||
*/
|
*/
|
||||||
static _resolvePath(artifactid, extension){
|
static _resolvePath(artifactid, extension){
|
||||||
let ps = artifactid.split(':')
|
let ps = artifactid.split(':')
|
||||||
@ -210,9 +210,9 @@ class AssetGuard extends EventEmitter {
|
|||||||
* 'net.minecraftforge:forge:1.11.2-13.20.0.2282', '.jar' becomes
|
* 'net.minecraftforge:forge:1.11.2-13.20.0.2282', '.jar' becomes
|
||||||
* net/minecraftforge/forge/1.11.2-13.20.0.2282/forge-1.11.2-13.20.0.2282.jar
|
* net/minecraftforge/forge/1.11.2-13.20.0.2282/forge-1.11.2-13.20.0.2282.jar
|
||||||
*
|
*
|
||||||
* @param {String} artifactid - the artifact id string.
|
* @param {string} artifactid The artifact id string.
|
||||||
* @param {String} extension - the extension of the file at the resolved url.
|
* @param {string} extension The extension of the file at the resolved url.
|
||||||
* @returns {String} - the resolved relative URL from the artifact id.
|
* @returns {string} The resolved relative URL from the artifact id.
|
||||||
*/
|
*/
|
||||||
static _resolveURL(artifactid, extension){
|
static _resolveURL(artifactid, extension){
|
||||||
let ps = artifactid.split(':')
|
let ps = artifactid.split(':')
|
||||||
@ -228,9 +228,9 @@ class AssetGuard extends EventEmitter {
|
|||||||
/**
|
/**
|
||||||
* Calculates the hash for a file using the specified algorithm.
|
* Calculates the hash for a file using the specified algorithm.
|
||||||
*
|
*
|
||||||
* @param {Buffer} buf - the buffer containing file data.
|
* @param {Buffer} buf The buffer containing file data.
|
||||||
* @param {String} algo - the hash algorithm.
|
* @param {string} algo The hash algorithm.
|
||||||
* @returns {String} - the calculated hash in hex.
|
* @returns {string} The calculated hash in hex.
|
||||||
*/
|
*/
|
||||||
static _calculateHash(buf, algo){
|
static _calculateHash(buf, algo){
|
||||||
return crypto.createHash(algo).update(buf).digest('hex')
|
return crypto.createHash(algo).update(buf).digest('hex')
|
||||||
@ -240,8 +240,8 @@ class AssetGuard extends EventEmitter {
|
|||||||
* Used to parse a checksums file. This is specifically designed for
|
* Used to parse a checksums file. This is specifically designed for
|
||||||
* the checksums.sha1 files found inside the forge scala dependencies.
|
* the checksums.sha1 files found inside the forge scala dependencies.
|
||||||
*
|
*
|
||||||
* @param {String} content - the string content of the checksums file.
|
* @param {string} content The string content of the checksums file.
|
||||||
* @returns {Object} - an object with keys being the file names, and values being the hashes.
|
* @returns {Object} An object with keys being the file names, and values being the hashes.
|
||||||
*/
|
*/
|
||||||
static _parseChecksumsFile(content){
|
static _parseChecksumsFile(content){
|
||||||
let finalContent = {}
|
let finalContent = {}
|
||||||
@ -259,10 +259,10 @@ class AssetGuard extends EventEmitter {
|
|||||||
/**
|
/**
|
||||||
* Validate that a file exists and matches a given hash value.
|
* Validate that a file exists and matches a given hash value.
|
||||||
*
|
*
|
||||||
* @param {String} filePath - the path of the file to validate.
|
* @param {string} filePath The path of the file to validate.
|
||||||
* @param {String} algo - the hash algorithm to check against.
|
* @param {string} algo The hash algorithm to check against.
|
||||||
* @param {String} hash - the existing hash to check against.
|
* @param {string} hash The existing hash to check against.
|
||||||
* @returns {Boolean} - true if the file exists and calculated hash matches the given hash, otherwise false.
|
* @returns {boolean} True if the file exists and calculated hash matches the given hash, otherwise false.
|
||||||
*/
|
*/
|
||||||
static _validateLocal(filePath, algo, hash){
|
static _validateLocal(filePath, algo, hash){
|
||||||
if(fs.existsSync(filePath)){
|
if(fs.existsSync(filePath)){
|
||||||
@ -281,10 +281,10 @@ class AssetGuard extends EventEmitter {
|
|||||||
/**
|
/**
|
||||||
* Statically retrieve the distribution data.
|
* Statically retrieve the distribution data.
|
||||||
*
|
*
|
||||||
* @param {String} basePath - base path for asset validation (game root).
|
* @param {string} basePath The base path for asset validation (game root).
|
||||||
* @param {Boolean} cached - optional. False if the distro should be freshly downloaded, else
|
* @param {boolean} cached Optional. False if the distro should be freshly downloaded, else
|
||||||
* a cached copy will be returned.
|
* a cached copy will be returned.
|
||||||
* @returns {Promise.<Object>} - A promise which resolves to the distribution data object.
|
* @returns {Promise.<Object>} A promise which resolves to the distribution data object.
|
||||||
*/
|
*/
|
||||||
static retrieveDistributionData(basePath, cached = true){
|
static retrieveDistributionData(basePath, cached = true){
|
||||||
return new Promise(function(fulfill, reject){
|
return new Promise(function(fulfill, reject){
|
||||||
@ -308,10 +308,10 @@ class AssetGuard extends EventEmitter {
|
|||||||
/**
|
/**
|
||||||
* Statically retrieve the distribution data.
|
* Statically retrieve the distribution data.
|
||||||
*
|
*
|
||||||
* @param {String} basePath - base path for asset validation (game root).
|
* @param {string} basePath The base path for asset validation (game root).
|
||||||
* @param {Boolean} cached - optional. False if the distro should be freshly downloaded, else
|
* @param {boolean} cached Optional. False if the distro should be freshly downloaded, else
|
||||||
* a cached copy will be returned.
|
* a cached copy will be returned.
|
||||||
* @returns {Object} - The distribution data object.
|
* @returns {Object} The distribution data object.
|
||||||
*/
|
*/
|
||||||
static retrieveDistributionDataSync(basePath, cached = true){
|
static retrieveDistributionDataSync(basePath, cached = true){
|
||||||
if(!cached || distributionData == null){
|
if(!cached || distributionData == null){
|
||||||
@ -323,8 +323,8 @@ class AssetGuard extends EventEmitter {
|
|||||||
/**
|
/**
|
||||||
* Resolve the default selected server from the distribution index.
|
* Resolve the default selected server from the distribution index.
|
||||||
*
|
*
|
||||||
* @param {String} basePath - base path for asset validation (game root).
|
* @param {string} basePath The base path for asset validation (game root).
|
||||||
* @returns {Object} - An object resolving to the default selected server.
|
* @returns {Object} An object resolving to the default selected server.
|
||||||
*/
|
*/
|
||||||
static resolveSelectedServer(basePath){
|
static resolveSelectedServer(basePath){
|
||||||
const distro = AssetGuard.retrieveDistributionDataSync(basePath)
|
const distro = AssetGuard.retrieveDistributionDataSync(basePath)
|
||||||
@ -343,9 +343,9 @@ class AssetGuard extends EventEmitter {
|
|||||||
* Returns null if the ID could not be found or the distro index has
|
* Returns null if the ID could not be found or the distro index has
|
||||||
* not yet been loaded.
|
* not yet been loaded.
|
||||||
*
|
*
|
||||||
* @param {String} basePath - base path for asset validation (game root).
|
* @param {string} basePath The base path for asset validation (game root).
|
||||||
* @param {String} serverID - The id of the server to retrieve.
|
* @param {string} serverID The id of the server to retrieve.
|
||||||
* @returns {Object} - The server object whose id matches the parameter.
|
* @returns {Object} The server object whose id matches the parameter.
|
||||||
*/
|
*/
|
||||||
static getServerById(basePath, serverID){
|
static getServerById(basePath, serverID){
|
||||||
if(distributionData == null){
|
if(distributionData == null){
|
||||||
@ -364,9 +364,9 @@ class AssetGuard extends EventEmitter {
|
|||||||
/**
|
/**
|
||||||
* Validates a file in the style used by forge's version index.
|
* Validates a file in the style used by forge's version index.
|
||||||
*
|
*
|
||||||
* @param {String} filePath - the path of the file to validate.
|
* @param {string} filePath The path of the file to validate.
|
||||||
* @param {Array.<String>} checksums - the checksums listed in the forge version index.
|
* @param {Array.<string>} checksums The checksums listed in the forge version index.
|
||||||
* @returns {Boolean} - true if the file exists and the hashes match, otherwise false.
|
* @returns {boolean} True if the file exists and the hashes match, otherwise false.
|
||||||
*/
|
*/
|
||||||
static _validateForgeChecksum(filePath, checksums){
|
static _validateForgeChecksum(filePath, checksums){
|
||||||
if(fs.existsSync(filePath)){
|
if(fs.existsSync(filePath)){
|
||||||
@ -389,9 +389,9 @@ class AssetGuard extends EventEmitter {
|
|||||||
* This can be an expensive task as it usually requires that we calculate thousands
|
* This can be an expensive task as it usually requires that we calculate thousands
|
||||||
* of hashes.
|
* of hashes.
|
||||||
*
|
*
|
||||||
* @param {Buffer} buf - the buffer of the jar file.
|
* @param {Buffer} buf The buffer of the jar file.
|
||||||
* @param {Array.<String>} checksums - the checksums listed in the forge version index.
|
* @param {Array.<string>} checksums The checksums listed in the forge version index.
|
||||||
* @returns {Boolean} - true if all hashes declared in the checksums.sha1 file match the actual hashes.
|
* @returns {boolean} True if all hashes declared in the checksums.sha1 file match the actual hashes.
|
||||||
*/
|
*/
|
||||||
static _validateForgeJar(buf, checksums){
|
static _validateForgeJar(buf, checksums){
|
||||||
// Double pass method was the quickest I found. I tried a version where we store data
|
// Double pass method was the quickest I found. I tried a version where we store data
|
||||||
@ -429,8 +429,8 @@ class AssetGuard extends EventEmitter {
|
|||||||
/**
|
/**
|
||||||
* Extracts and unpacks a file from .pack.xz format.
|
* Extracts and unpacks a file from .pack.xz format.
|
||||||
*
|
*
|
||||||
* @param {Array.<String>} filePaths - The paths of the files to be extracted and unpacked.
|
* @param {Array.<string>} filePaths The paths of the files to be extracted and unpacked.
|
||||||
* @returns {Promise.<Void>} - An empty promise to indicate the extraction has completed.
|
* @returns {Promise.<void>} An empty promise to indicate the extraction has completed.
|
||||||
*/
|
*/
|
||||||
static _extractPackXZ(filePaths, javaExecutable){
|
static _extractPackXZ(filePaths, javaExecutable){
|
||||||
return new Promise(function(fulfill, reject){
|
return new Promise(function(fulfill, reject){
|
||||||
@ -456,9 +456,9 @@ class AssetGuard extends EventEmitter {
|
|||||||
* instance already exists, the contents of the version.json file are read and returned
|
* instance already exists, the contents of the version.json file are read and returned
|
||||||
* in a promise.
|
* in a promise.
|
||||||
*
|
*
|
||||||
* @param {Asset} asset - The Asset object representing Forge.
|
* @param {Asset} asset The Asset object representing Forge.
|
||||||
* @param {String} basePath - Base path for asset validation (game root).
|
* @param {string} basePath Base path for asset validation (game root).
|
||||||
* @returns {Promise.<Object>} - A promise which resolves to the contents of forge's version.json.
|
* @returns {Promise.<Object>} A promise which resolves to the contents of forge's version.json.
|
||||||
*/
|
*/
|
||||||
static _finalizeForgeAsset(asset, basePath){
|
static _finalizeForgeAsset(asset, basePath){
|
||||||
return new Promise(function(fulfill, reject){
|
return new Promise(function(fulfill, reject){
|
||||||
@ -491,9 +491,9 @@ class AssetGuard extends EventEmitter {
|
|||||||
/**
|
/**
|
||||||
* Initiate an async download process for an AssetGuard DLTracker.
|
* Initiate an async download process for an AssetGuard DLTracker.
|
||||||
*
|
*
|
||||||
* @param {String} identifier - the identifier of the AssetGuard DLTracker.
|
* @param {string} identifier The identifier of the AssetGuard DLTracker.
|
||||||
* @param {Number} limit - optional. The number of async processes to run in parallel.
|
* @param {number} limit Optional. The number of async processes to run in parallel.
|
||||||
* @returns {Boolean} - true if the process began, otherwise false.
|
* @returns {boolean} True if the process began, otherwise false.
|
||||||
*/
|
*/
|
||||||
startAsyncProcess(identifier, limit = 5){
|
startAsyncProcess(identifier, limit = 5){
|
||||||
const self = this
|
const self = this
|
||||||
@ -559,9 +559,9 @@ class AssetGuard extends EventEmitter {
|
|||||||
/**
|
/**
|
||||||
* Loads the version data for a given minecraft version.
|
* Loads the version data for a given minecraft version.
|
||||||
*
|
*
|
||||||
* @param {String} version - the game version for which to load the index data.
|
* @param {string} version The game version for which to load the index data.
|
||||||
* @param {Boolean} force - optional. If true, the version index will be downloaded even if it exists locally. Defaults to false.
|
* @param {boolean} force Optional. If true, the version index will be downloaded even if it exists locally. Defaults to false.
|
||||||
* @returns {Promise.<Object>} - Promise which resolves to the version data object.
|
* @returns {Promise.<Object>} Promise which resolves to the version data object.
|
||||||
*/
|
*/
|
||||||
loadVersionData(version, force = false){
|
loadVersionData(version, force = false){
|
||||||
const self = this
|
const self = this
|
||||||
@ -592,9 +592,9 @@ class AssetGuard extends EventEmitter {
|
|||||||
* asset entry. In this analysis it will check to see if the local file exists and is valid.
|
* asset entry. In this analysis it will check to see if the local file exists and is valid.
|
||||||
* If not, it will be added to the download queue for the 'assets' identifier.
|
* If not, it will be added to the download queue for the 'assets' identifier.
|
||||||
*
|
*
|
||||||
* @param {Object} versionData - the version data for the assets.
|
* @param {Object} versionData The version data for the assets.
|
||||||
* @param {Boolean} force - optional. If true, the asset index will be downloaded even if it exists locally. Defaults to false.
|
* @param {boolean} force Optional. If true, the asset index will be downloaded even if it exists locally. Defaults to false.
|
||||||
* @returns {Promise.<Void>} - An empty promise to indicate the async processing has completed.
|
* @returns {Promise.<void>} An empty promise to indicate the async processing has completed.
|
||||||
*/
|
*/
|
||||||
validateAssets(versionData, force = false){
|
validateAssets(versionData, force = false){
|
||||||
const self = this
|
const self = this
|
||||||
@ -610,8 +610,8 @@ class AssetGuard extends EventEmitter {
|
|||||||
* Private function used to chain the asset validation process. This function retrieves
|
* Private function used to chain the asset validation process. This function retrieves
|
||||||
* the index data.
|
* the index data.
|
||||||
* @param {Object} versionData
|
* @param {Object} versionData
|
||||||
* @param {Boolean} force
|
* @param {boolean} force
|
||||||
* @returns {Promise.<Void>} - An empty promise to indicate the async processing has completed.
|
* @returns {Promise.<void>} An empty promise to indicate the async processing has completed.
|
||||||
*/
|
*/
|
||||||
_assetChainIndexData(versionData, force = false){
|
_assetChainIndexData(versionData, force = false){
|
||||||
const self = this
|
const self = this
|
||||||
@ -646,8 +646,8 @@ class AssetGuard extends EventEmitter {
|
|||||||
* Private function used to chain the asset validation process. This function processes
|
* Private function used to chain the asset validation process. This function processes
|
||||||
* the assets and enqueues missing or invalid files.
|
* the assets and enqueues missing or invalid files.
|
||||||
* @param {Object} versionData
|
* @param {Object} versionData
|
||||||
* @param {Boolean} force
|
* @param {boolean} force
|
||||||
* @returns {Promise.<Void>} - An empty promise to indicate the async processing has completed.
|
* @returns {Promise.<void>} An empty promise to indicate the async processing has completed.
|
||||||
*/
|
*/
|
||||||
_assetChainValidateAssets(versionData, indexData){
|
_assetChainValidateAssets(versionData, indexData){
|
||||||
const self = this
|
const self = this
|
||||||
@ -685,8 +685,8 @@ class AssetGuard extends EventEmitter {
|
|||||||
* check to see if the local file exists and is valid. If not, it will be added to the download
|
* check to see if the local file exists and is valid. If not, it will be added to the download
|
||||||
* queue for the 'libraries' identifier.
|
* queue for the 'libraries' identifier.
|
||||||
*
|
*
|
||||||
* @param {Object} versionData - the version data for the assets.
|
* @param {Object} versionData The version data for the assets.
|
||||||
* @returns {Promise.<Void>} - An empty promise to indicate the async processing has completed.
|
* @returns {Promise.<void>} An empty promise to indicate the async processing has completed.
|
||||||
*/
|
*/
|
||||||
validateLibraries(versionData){
|
validateLibraries(versionData){
|
||||||
const self = this
|
const self = this
|
||||||
@ -720,8 +720,8 @@ class AssetGuard extends EventEmitter {
|
|||||||
* Public miscellaneous mojang file validation function. These files will be enqueued under
|
* Public miscellaneous mojang file validation function. These files will be enqueued under
|
||||||
* the 'files' identifier.
|
* the 'files' identifier.
|
||||||
*
|
*
|
||||||
* @param {Object} versionData - the version data for the assets.
|
* @param {Object} versionData The version data for the assets.
|
||||||
* @returns {Promise.<Void>} - An empty promise to indicate the async processing has completed.
|
* @returns {Promise.<void>} An empty promise to indicate the async processing has completed.
|
||||||
*/
|
*/
|
||||||
validateMiscellaneous(versionData){
|
validateMiscellaneous(versionData){
|
||||||
const self = this
|
const self = this
|
||||||
@ -735,9 +735,9 @@ class AssetGuard extends EventEmitter {
|
|||||||
/**
|
/**
|
||||||
* Validate client file - artifact renamed from client.jar to '{version}'.jar.
|
* Validate client file - artifact renamed from client.jar to '{version}'.jar.
|
||||||
*
|
*
|
||||||
* @param {Object} versionData - the version data for the assets.
|
* @param {Object} versionData The version data for the assets.
|
||||||
* @param {Boolean} force - optional. If true, the asset index will be downloaded even if it exists locally. Defaults to false.
|
* @param {boolean} force Optional. If true, the asset index will be downloaded even if it exists locally. Defaults to false.
|
||||||
* @returns {Promise.<Void>} - An empty promise to indicate the async processing has completed.
|
* @returns {Promise.<void>} An empty promise to indicate the async processing has completed.
|
||||||
*/
|
*/
|
||||||
validateClient(versionData, force = false){
|
validateClient(versionData, force = false){
|
||||||
const self = this
|
const self = this
|
||||||
@ -762,9 +762,9 @@ class AssetGuard extends EventEmitter {
|
|||||||
/**
|
/**
|
||||||
* Validate log config.
|
* Validate log config.
|
||||||
*
|
*
|
||||||
* @param {Object} versionData - the version data for the assets.
|
* @param {Object} versionData The version data for the assets.
|
||||||
* @param {Boolean} force - optional. If true, the asset index will be downloaded even if it exists locally. Defaults to false.
|
* @param {boolean} force Optional. If true, the asset index will be downloaded even if it exists locally. Defaults to false.
|
||||||
* @returns {Promise.<Void>} - An empty promise to indicate the async processing has completed.
|
* @returns {Promise.<void>} An empty promise to indicate the async processing has completed.
|
||||||
*/
|
*/
|
||||||
validateLogConfig(versionData){
|
validateLogConfig(versionData){
|
||||||
const self = this
|
const self = this
|
||||||
@ -788,8 +788,8 @@ class AssetGuard extends EventEmitter {
|
|||||||
/**
|
/**
|
||||||
* Validate the distribution.
|
* Validate the distribution.
|
||||||
*
|
*
|
||||||
* @param {String} serverpackid - The id of the server to validate.
|
* @param {string} serverpackid The id of the server to validate.
|
||||||
* @returns {Promise.<Object>} - A promise which resolves to the server distribution object.
|
* @returns {Promise.<Object>} A promise which resolves to the server distribution object.
|
||||||
*/
|
*/
|
||||||
validateDistribution(serverpackid){
|
validateDistribution(serverpackid){
|
||||||
const self = this
|
const self = this
|
||||||
@ -889,8 +889,8 @@ class AssetGuard extends EventEmitter {
|
|||||||
/**
|
/**
|
||||||
* Loads Forge's version.json data into memory for the specified server id.
|
* Loads Forge's version.json data into memory for the specified server id.
|
||||||
*
|
*
|
||||||
* @param {String} serverpack - The id of the server to load Forge data for.
|
* @param {string} serverpack The id of the server to load Forge data for.
|
||||||
* @returns {Promise.<Object>} - A promise which resolves to Forge's version.json data.
|
* @returns {Promise.<Object>} A promise which resolves to Forge's version.json data.
|
||||||
*/
|
*/
|
||||||
loadForgeData(serverpack){
|
loadForgeData(serverpack){
|
||||||
const self = this
|
const self = this
|
||||||
@ -938,7 +938,7 @@ class AssetGuard extends EventEmitter {
|
|||||||
* immediately. Once all downloads are complete, this function will fire the 'dlcomplete' event on the
|
* immediately. Once all downloads are complete, this function will fire the 'dlcomplete' event on the
|
||||||
* global object instance.
|
* global object instance.
|
||||||
*
|
*
|
||||||
* @param {Array.<{id: string, limit: number}>} identifiers - optional. The identifiers to process and corresponding parallel async task limit.
|
* @param {Array.<{id: string, limit: number}>} identifiers Optional. The identifiers to process and corresponding parallel async task limit.
|
||||||
*/
|
*/
|
||||||
processDlQueues(identifiers = [{id:'assets', limit:20}, {id:'libraries', limit:5}, {id:'files', limit:5}, {id:'forge', limit:5}]){
|
processDlQueues(identifiers = [{id:'assets', limit:20}, {id:'libraries', limit:5}, {id:'files', limit:5}, {id:'forge', limit:5}]){
|
||||||
this.progress = 0;
|
this.progress = 0;
|
||||||
|
@ -84,7 +84,7 @@ exports.load = function(){
|
|||||||
* Retrieve the launcher's Client Token.
|
* Retrieve the launcher's Client Token.
|
||||||
* There is no default client token.
|
* There is no default client token.
|
||||||
*
|
*
|
||||||
* @returns {String} - the launcher's Client Token.
|
* @returns {string} The launcher's Client Token.
|
||||||
*/
|
*/
|
||||||
exports.getClientToken = function(){
|
exports.getClientToken = function(){
|
||||||
return config.clientToken
|
return config.clientToken
|
||||||
@ -93,7 +93,7 @@ exports.getClientToken = function(){
|
|||||||
/**
|
/**
|
||||||
* Set the launcher's Client Token.
|
* Set the launcher's Client Token.
|
||||||
*
|
*
|
||||||
* @param {String} clientToken - the launcher's new Client Token.
|
* @param {string} clientToken The launcher's new Client Token.
|
||||||
*/
|
*/
|
||||||
exports.setClientToken = function(clientToken){
|
exports.setClientToken = function(clientToken){
|
||||||
config.clientToken = clientToken
|
config.clientToken = clientToken
|
||||||
@ -102,8 +102,8 @@ exports.setClientToken = function(clientToken){
|
|||||||
/**
|
/**
|
||||||
* Retrieve the ID of the selected serverpack.
|
* Retrieve the ID of the selected serverpack.
|
||||||
*
|
*
|
||||||
* @param {Boolean} def - optional. If true, the default value will be returned.
|
* @param {boolean} def Optional. If true, the default value will be returned.
|
||||||
* @returns {String} - the ID of the selected serverpack.
|
* @returns {string} The ID of the selected serverpack.
|
||||||
*/
|
*/
|
||||||
exports.getSelectedServer = function(def = false){
|
exports.getSelectedServer = function(def = false){
|
||||||
return !def ? config.selectedServer : DEFAULT_CONFIG.clientToken
|
return !def ? config.selectedServer : DEFAULT_CONFIG.clientToken
|
||||||
@ -112,7 +112,7 @@ exports.getSelectedServer = function(def = false){
|
|||||||
/**
|
/**
|
||||||
* Set the ID of the selected serverpack.
|
* Set the ID of the selected serverpack.
|
||||||
*
|
*
|
||||||
* @param {String} serverID - the ID of the new selected serverpack.
|
* @param {string} serverID The ID of the new selected serverpack.
|
||||||
*/
|
*/
|
||||||
exports.setSelectedServer = function(serverID){
|
exports.setSelectedServer = function(serverID){
|
||||||
config.selectedServer = serverID
|
config.selectedServer = serverID
|
||||||
@ -121,7 +121,7 @@ exports.setSelectedServer = function(serverID){
|
|||||||
/**
|
/**
|
||||||
* Get an array of each account currently authenticated by the launcher.
|
* Get an array of each account currently authenticated by the launcher.
|
||||||
*
|
*
|
||||||
* @returns {Array.<Object>} - an array of each stored authenticated account.
|
* @returns {Array.<Object>} An array of each stored authenticated account.
|
||||||
*/
|
*/
|
||||||
exports.getAuthAccounts = function(){
|
exports.getAuthAccounts = function(){
|
||||||
return config.authenticationDatabase
|
return config.authenticationDatabase
|
||||||
@ -131,8 +131,8 @@ exports.getAuthAccounts = function(){
|
|||||||
* Returns the authenticated account with the given uuid. Value may
|
* Returns the authenticated account with the given uuid. Value may
|
||||||
* be null.
|
* be null.
|
||||||
*
|
*
|
||||||
* @param {String} uuid - the uuid of the authenticated account.
|
* @param {string} uuid The uuid of the authenticated account.
|
||||||
* @returns {Object} - the authenticated account with the given uuid.
|
* @returns {Object} The authenticated account with the given uuid.
|
||||||
*/
|
*/
|
||||||
exports.getAuthAccount = function(uuid){
|
exports.getAuthAccount = function(uuid){
|
||||||
return config.authenticationDatabase[uuid]
|
return config.authenticationDatabase[uuid]
|
||||||
@ -141,10 +141,10 @@ exports.getAuthAccount = function(uuid){
|
|||||||
/**
|
/**
|
||||||
* Update the access token of an authenticated account.
|
* Update the access token of an authenticated account.
|
||||||
*
|
*
|
||||||
* @param {String} uuid - uuid of the authenticated account.
|
* @param {string} uuid The uuid of the authenticated account.
|
||||||
* @param {String} accessToken - the new Access Token.
|
* @param {string} accessToken The new Access Token.
|
||||||
*
|
*
|
||||||
* @returns {Object} - the authenticated account object created by this action.
|
* @returns {Object} The authenticated account object created by this action.
|
||||||
*/
|
*/
|
||||||
exports.updateAuthAccount = function(uuid, accessToken){
|
exports.updateAuthAccount = function(uuid, accessToken){
|
||||||
config.authenticationDatabase[uuid].accessToken = accessToken
|
config.authenticationDatabase[uuid].accessToken = accessToken
|
||||||
@ -154,12 +154,12 @@ exports.updateAuthAccount = function(uuid, accessToken){
|
|||||||
/**
|
/**
|
||||||
* Adds an authenticated account to the database to be stored.
|
* Adds an authenticated account to the database to be stored.
|
||||||
*
|
*
|
||||||
* @param {String} uuid - uuid of the authenticated account.
|
* @param {string} uuid The uuid of the authenticated account.
|
||||||
* @param {String} accessToken - accessToken of the authenticated account.
|
* @param {string} accessToken The accessToken of the authenticated account.
|
||||||
* @param {String} username - username (usually email) of the authenticated account.
|
* @param {string} username The username (usually email) of the authenticated account.
|
||||||
* @param {String} displayName - in game name of the authenticated account.
|
* @param {string} displayName The in game name of the authenticated account.
|
||||||
*
|
*
|
||||||
* @returns {Object} - the authenticated account object created by this action.
|
* @returns {Object} The authenticated account object created by this action.
|
||||||
*/
|
*/
|
||||||
exports.addAuthAccount = function(uuid, accessToken, username, displayName){
|
exports.addAuthAccount = function(uuid, accessToken, username, displayName){
|
||||||
config.selectedAccount = uuid
|
config.selectedAccount = uuid
|
||||||
@ -175,7 +175,7 @@ exports.addAuthAccount = function(uuid, accessToken, username, displayName){
|
|||||||
/**
|
/**
|
||||||
* Get the currently selected authenticated account.
|
* Get the currently selected authenticated account.
|
||||||
*
|
*
|
||||||
* @returns {Object} - the selected authenticated account.
|
* @returns {Object} The selected authenticated account.
|
||||||
*/
|
*/
|
||||||
exports.getSelectedAccount = function(){
|
exports.getSelectedAccount = function(){
|
||||||
return config.authenticationDatabase[config.selectedAccount]
|
return config.authenticationDatabase[config.selectedAccount]
|
||||||
@ -190,8 +190,8 @@ exports.getSelectedAccount = function(){
|
|||||||
* contains the units of memory. For example, '5G' = 5 GigaBytes, '1024M' =
|
* contains the units of memory. For example, '5G' = 5 GigaBytes, '1024M' =
|
||||||
* 1024 MegaBytes, etc.
|
* 1024 MegaBytes, etc.
|
||||||
*
|
*
|
||||||
* @param {Boolean} def - optional. If true, the default value will be returned.
|
* @param {boolean} def Optional. If true, the default value will be returned.
|
||||||
* @returns {String} - the minimum amount of memory for JVM initialization.
|
* @returns {string} The minimum amount of memory for JVM initialization.
|
||||||
*/
|
*/
|
||||||
exports.getMinRAM = function(def = false){
|
exports.getMinRAM = function(def = false){
|
||||||
return !def ? config.settings.java.minRAM : DEFAULT_CONFIG.settings.java.minRAM
|
return !def ? config.settings.java.minRAM : DEFAULT_CONFIG.settings.java.minRAM
|
||||||
@ -202,7 +202,7 @@ exports.getMinRAM = function(def = false){
|
|||||||
* contain the units of memory. For example, '5G' = 5 GigaBytes, '1024M' =
|
* contain the units of memory. For example, '5G' = 5 GigaBytes, '1024M' =
|
||||||
* 1024 MegaBytes, etc.
|
* 1024 MegaBytes, etc.
|
||||||
*
|
*
|
||||||
* @param {String} minRAM - the new minimum amount of memory for JVM initialization.
|
* @param {string} minRAM The new minimum amount of memory for JVM initialization.
|
||||||
*/
|
*/
|
||||||
exports.setMinRAM = function(minRAM){
|
exports.setMinRAM = function(minRAM){
|
||||||
config.settings.java.minRAM = minRAM
|
config.settings.java.minRAM = minRAM
|
||||||
@ -213,8 +213,8 @@ exports.setMinRAM = function(minRAM){
|
|||||||
* contains the units of memory. For example, '5G' = 5 GigaBytes, '1024M' =
|
* contains the units of memory. For example, '5G' = 5 GigaBytes, '1024M' =
|
||||||
* 1024 MegaBytes, etc.
|
* 1024 MegaBytes, etc.
|
||||||
*
|
*
|
||||||
* @param {Boolean} def - optional. If true, the default value will be returned.
|
* @param {boolean} def Optional. If true, the default value will be returned.
|
||||||
* @returns {String} - the maximum amount of memory for JVM initialization.
|
* @returns {string} The maximum amount of memory for JVM initialization.
|
||||||
*/
|
*/
|
||||||
exports.getMaxRAM = function(def = false){
|
exports.getMaxRAM = function(def = false){
|
||||||
return !def ? config.settings.java.maxRAM : resolveMaxRAM()
|
return !def ? config.settings.java.maxRAM : resolveMaxRAM()
|
||||||
@ -225,7 +225,7 @@ exports.getMaxRAM = function(def = false){
|
|||||||
* contain the units of memory. For example, '5G' = 5 GigaBytes, '1024M' =
|
* contain the units of memory. For example, '5G' = 5 GigaBytes, '1024M' =
|
||||||
* 1024 MegaBytes, etc.
|
* 1024 MegaBytes, etc.
|
||||||
*
|
*
|
||||||
* @param {String} maxRAM - the new maximum amount of memory for JVM initialization.
|
* @param {string} maxRAM The new maximum amount of memory for JVM initialization.
|
||||||
*/
|
*/
|
||||||
exports.setMaxRAM = function(maxRAM){
|
exports.setMaxRAM = function(maxRAM){
|
||||||
config.settings.java.maxRAM = maxRAM
|
config.settings.java.maxRAM = maxRAM
|
||||||
@ -236,7 +236,7 @@ exports.setMaxRAM = function(maxRAM){
|
|||||||
*
|
*
|
||||||
* This is a resolved configuration value and defaults to null until externally assigned.
|
* This is a resolved configuration value and defaults to null until externally assigned.
|
||||||
*
|
*
|
||||||
* @returns {String} - the path of the Java Executable.
|
* @returns {string} The path of the Java Executable.
|
||||||
*/
|
*/
|
||||||
exports.getJavaExecutable = function(){
|
exports.getJavaExecutable = function(){
|
||||||
return config.settings.java.executable
|
return config.settings.java.executable
|
||||||
@ -245,7 +245,7 @@ exports.getJavaExecutable = function(){
|
|||||||
/**
|
/**
|
||||||
* Set the path of the Java Executable.
|
* Set the path of the Java Executable.
|
||||||
*
|
*
|
||||||
* @param {String} executable - the new path of the Java Executable.
|
* @param {string} executable The new path of the Java Executable.
|
||||||
*/
|
*/
|
||||||
exports.setJavaExecutable = function(executable){
|
exports.setJavaExecutable = function(executable){
|
||||||
config.settings.java.executable = executable
|
config.settings.java.executable = executable
|
||||||
@ -256,8 +256,8 @@ exports.setJavaExecutable = function(executable){
|
|||||||
* such as memory allocation, will be dynamically resolved and will not be included
|
* such as memory allocation, will be dynamically resolved and will not be included
|
||||||
* in this value.
|
* in this value.
|
||||||
*
|
*
|
||||||
* @param {Boolean} def - optional. If true, the default value will be returned.
|
* @param {boolean} def Optional. If true, the default value will be returned.
|
||||||
* @returns {Array.<String>} - an array of the additional arguments for JVM initialization.
|
* @returns {Array.<string>} An array of the additional arguments for JVM initialization.
|
||||||
*/
|
*/
|
||||||
exports.getJVMOptions = function(def = false){
|
exports.getJVMOptions = function(def = false){
|
||||||
return !def ? config.settings.java.jvmOptions : DEFAULT_CONFIG.settings.java.jvmOptions
|
return !def ? config.settings.java.jvmOptions : DEFAULT_CONFIG.settings.java.jvmOptions
|
||||||
@ -268,7 +268,7 @@ exports.getJVMOptions = function(def = false){
|
|||||||
* such as memory allocation, will be dynamically resolved and should not be
|
* such as memory allocation, will be dynamically resolved and should not be
|
||||||
* included in this value.
|
* included in this value.
|
||||||
*
|
*
|
||||||
* @param {Array.<String>} jvmOptions - an array of the new additional arguments for JVM
|
* @param {Array.<string>} jvmOptions An array of the new additional arguments for JVM
|
||||||
* initialization.
|
* initialization.
|
||||||
*/
|
*/
|
||||||
exports.setJVMOptions = function(jvmOptions){
|
exports.setJVMOptions = function(jvmOptions){
|
||||||
@ -280,8 +280,8 @@ exports.setJVMOptions = function(jvmOptions){
|
|||||||
/**
|
/**
|
||||||
* Retrieve the absolute path of the game directory.
|
* Retrieve the absolute path of the game directory.
|
||||||
*
|
*
|
||||||
* @param {Boolean} def - optional. If true, the default value will be returned.
|
* @param {boolean} def Optional. If true, the default value will be returned.
|
||||||
* @returns {String} - the absolute path of the game directory.
|
* @returns {string} The absolute path of the game directory.
|
||||||
*/
|
*/
|
||||||
exports.getGameDirectory = function(def = false){
|
exports.getGameDirectory = function(def = false){
|
||||||
return !def ? config.settings.game.directory : DEFAULT_CONFIG.settings.game.directory
|
return !def ? config.settings.game.directory : DEFAULT_CONFIG.settings.game.directory
|
||||||
@ -290,7 +290,7 @@ exports.getGameDirectory = function(def = false){
|
|||||||
/**
|
/**
|
||||||
* Set the absolute path of the game directory.
|
* Set the absolute path of the game directory.
|
||||||
*
|
*
|
||||||
* @param {String} directory - the absolute path of the new game directory.
|
* @param {string} directory The absolute path of the new game directory.
|
||||||
*/
|
*/
|
||||||
exports.setGameDirectory = function(directory){
|
exports.setGameDirectory = function(directory){
|
||||||
config.settings.game.directory = directory
|
config.settings.game.directory = directory
|
||||||
@ -299,8 +299,8 @@ exports.setGameDirectory = function(directory){
|
|||||||
/**
|
/**
|
||||||
* Retrieve the width of the game window.
|
* Retrieve the width of the game window.
|
||||||
*
|
*
|
||||||
* @param {Boolean} def - optional. If true, the default value will be returned.
|
* @param {boolean} def Optional. If true, the default value will be returned.
|
||||||
* @returns {Number} - the width of the game window.
|
* @returns {number} The width of the game window.
|
||||||
*/
|
*/
|
||||||
exports.getGameWidth = function(def = false){
|
exports.getGameWidth = function(def = false){
|
||||||
return !def ? config.settings.game.resWidth : DEFAULT_CONFIG.settings.game.resWidth
|
return !def ? config.settings.game.resWidth : DEFAULT_CONFIG.settings.game.resWidth
|
||||||
@ -309,7 +309,7 @@ exports.getGameWidth = function(def = false){
|
|||||||
/**
|
/**
|
||||||
* Set the width of the game window.
|
* Set the width of the game window.
|
||||||
*
|
*
|
||||||
* @param {Number} resWidth - the new width of the game window.
|
* @param {number} resWidth The new width of the game window.
|
||||||
*/
|
*/
|
||||||
exports.setGameWidth = function(resWidth){
|
exports.setGameWidth = function(resWidth){
|
||||||
config.settings.game.resWidth = resWidth
|
config.settings.game.resWidth = resWidth
|
||||||
@ -318,8 +318,8 @@ exports.setGameWidth = function(resWidth){
|
|||||||
/**
|
/**
|
||||||
* Retrieve the height of the game window.
|
* Retrieve the height of the game window.
|
||||||
*
|
*
|
||||||
* @param {Boolean} def - optional. If true, the default value will be returned.
|
* @param {boolean} def Optional. If true, the default value will be returned.
|
||||||
* @returns {Number} - the height of the game window.
|
* @returns {number} The height of the game window.
|
||||||
*/
|
*/
|
||||||
exports.getGameHeight = function(def = false){
|
exports.getGameHeight = function(def = false){
|
||||||
return !def ? config.settings.game.resHeight : DEFAULT_CONFIG.settings.game.resHeight
|
return !def ? config.settings.game.resHeight : DEFAULT_CONFIG.settings.game.resHeight
|
||||||
@ -328,7 +328,7 @@ exports.getGameHeight = function(def = false){
|
|||||||
/**
|
/**
|
||||||
* Set the height of the game window.
|
* Set the height of the game window.
|
||||||
*
|
*
|
||||||
* @param {Number} resHeight - the new height of the game window.
|
* @param {number} resHeight The new height of the game window.
|
||||||
*/
|
*/
|
||||||
exports.setGameHeight = function(resHeight){
|
exports.setGameHeight = function(resHeight){
|
||||||
config.settings.game.resHeight = resHeight
|
config.settings.game.resHeight = resHeight
|
||||||
@ -337,8 +337,8 @@ exports.setGameHeight = function(resHeight){
|
|||||||
/**
|
/**
|
||||||
* Check if the game should be launched in fullscreen mode.
|
* Check if the game should be launched in fullscreen mode.
|
||||||
*
|
*
|
||||||
* @param {Boolean} def - optional. If true, the default value will be returned.
|
* @param {boolean} def Optional. If true, the default value will be returned.
|
||||||
* @returns {Boolean} - whether or not the game is set to launch in fullscreen mode.
|
* @returns {boolean} Whether or not the game is set to launch in fullscreen mode.
|
||||||
*/
|
*/
|
||||||
exports.isFullscreen = function(def = false){
|
exports.isFullscreen = function(def = false){
|
||||||
return !def ? config.settings.game.fullscreen : DEFAULT_CONFIG.settings.game.fullscreen
|
return !def ? config.settings.game.fullscreen : DEFAULT_CONFIG.settings.game.fullscreen
|
||||||
@ -347,7 +347,7 @@ exports.isFullscreen = function(def = false){
|
|||||||
/**
|
/**
|
||||||
* Change the status of if the game should be launched in fullscreen mode.
|
* Change the status of if the game should be launched in fullscreen mode.
|
||||||
*
|
*
|
||||||
* @param {Boolean} fullscreen - whether or not the game should launch in fullscreen mode.
|
* @param {boolean} fullscreen Whether or not the game should launch in fullscreen mode.
|
||||||
*/
|
*/
|
||||||
exports.setFullscreen = function(fullscreen){
|
exports.setFullscreen = function(fullscreen){
|
||||||
config.settings.game.fullscreen = fullscreen
|
config.settings.game.fullscreen = fullscreen
|
||||||
@ -356,8 +356,8 @@ exports.setFullscreen = function(fullscreen){
|
|||||||
/**
|
/**
|
||||||
* Check if the game should auto connect to servers.
|
* Check if the game should auto connect to servers.
|
||||||
*
|
*
|
||||||
* @param {Boolean} def - optional. If true, the default value will be returned.
|
* @param {boolean} def Optional. If true, the default value will be returned.
|
||||||
* @returns {Boolean} - whether or not the game should auto connect to servers.
|
* @returns {boolean} Whether or not the game should auto connect to servers.
|
||||||
*/
|
*/
|
||||||
exports.isAutoConnect = function(def = false){
|
exports.isAutoConnect = function(def = false){
|
||||||
return !def ? config.settings.game.autoConnect : DEFAULT_CONFIG.settings.game.autoConnect
|
return !def ? config.settings.game.autoConnect : DEFAULT_CONFIG.settings.game.autoConnect
|
||||||
@ -366,7 +366,7 @@ exports.isAutoConnect = function(def = false){
|
|||||||
/**
|
/**
|
||||||
* Change the status of whether or not the game should auto connect to servers.
|
* Change the status of whether or not the game should auto connect to servers.
|
||||||
*
|
*
|
||||||
* @param {Boolean} autoConnect - whether or not the game should auto connect to servers.
|
* @param {boolean} autoConnect Whether or not the game should auto connect to servers.
|
||||||
*/
|
*/
|
||||||
exports.setAutoConnect = function(autoConnect){
|
exports.setAutoConnect = function(autoConnect){
|
||||||
config.settings.game.autoConnect = autoConnect
|
config.settings.game.autoConnect = autoConnect
|
||||||
|
@ -143,10 +143,10 @@ function _scanRegistry(){
|
|||||||
const javaVer = javaVers[j]
|
const javaVer = javaVers[j]
|
||||||
const vKey = javaVer.key.substring(javaVer.key.lastIndexOf('\\')+1)
|
const vKey = javaVer.key.substring(javaVer.key.lastIndexOf('\\')+1)
|
||||||
// Only Java 8 is supported currently.
|
// Only Java 8 is supported currently.
|
||||||
if(parseFloat(vKey) == 1.8){
|
if(parseFloat(vKey) === 1.8){
|
||||||
javaVer.get('JavaHome', (err, res) => {
|
javaVer.get('JavaHome', (err, res) => {
|
||||||
const jHome = res.value
|
const jHome = res.value
|
||||||
if(jHome.indexOf('(x86)') == -1){
|
if(jHome.indexOf('(x86)') === -1){
|
||||||
candidates.add(jHome)
|
candidates.add(jHome)
|
||||||
cbAcc++
|
cbAcc++
|
||||||
}
|
}
|
||||||
|
@ -43,8 +43,8 @@ const statuses = [
|
|||||||
* are 'green', 'yellow', 'red', and 'grey'. Grey is a custom status
|
* are 'green', 'yellow', 'red', and 'grey'. Grey is a custom status
|
||||||
* to our project which represends an unknown status.
|
* to our project which represends an unknown status.
|
||||||
*
|
*
|
||||||
* @param {String} status - a valid status code.
|
* @param {string} status A valid status code.
|
||||||
* @returns {String} - the hex color of the status code.
|
* @returns {string} The hex color of the status code.
|
||||||
*/
|
*/
|
||||||
exports.statusToHex = function(status){
|
exports.statusToHex = function(status){
|
||||||
switch(status.toLowerCase()){
|
switch(status.toLowerCase()){
|
||||||
@ -97,11 +97,11 @@ exports.status = function(){
|
|||||||
/**
|
/**
|
||||||
* Authenticate a user with their Mojang credentials.
|
* Authenticate a user with their Mojang credentials.
|
||||||
*
|
*
|
||||||
* @param {String} username - user's username, this is often an email.
|
* @param {string} username The user's username, this is often an email.
|
||||||
* @param {String} password - user's password.
|
* @param {string} password The user's password.
|
||||||
* @param {String} clientToken - launcher's Client Token.
|
* @param {string} clientToken The launcher's Client Token.
|
||||||
* @param {Boolean} requestUser - optional. Adds user object to the reponse.
|
* @param {boolean} requestUser Optional. Adds user object to the reponse.
|
||||||
* @param {Object} agent - optional. Provided by default. Adds user info to the response.
|
* @param {Object} agent Optional. Provided by default. Adds user info to the response.
|
||||||
*
|
*
|
||||||
* @see http://wiki.vg/Authentication#Authenticate
|
* @see http://wiki.vg/Authentication#Authenticate
|
||||||
*/
|
*/
|
||||||
@ -132,8 +132,8 @@ exports.authenticate = function(username, password, clientToken, requestUser = t
|
|||||||
* Validate an access token. This should always be done before launching.
|
* Validate an access token. This should always be done before launching.
|
||||||
* The client token should match the one used to create the access token.
|
* The client token should match the one used to create the access token.
|
||||||
*
|
*
|
||||||
* @param {String} accessToken - the access token to validate.
|
* @param {string} accessToken The access token to validate.
|
||||||
* @param {String} clientToken - the launcher's client token.
|
* @param {string} clientToken The launcher's client token.
|
||||||
*
|
*
|
||||||
* @see http://wiki.vg/Authentication#Validate
|
* @see http://wiki.vg/Authentication#Validate
|
||||||
*/
|
*/
|
||||||
@ -162,8 +162,8 @@ exports.validate = function(accessToken, clientToken){
|
|||||||
* Invalidates an access token. The clientToken must match the
|
* Invalidates an access token. The clientToken must match the
|
||||||
* token used to create the provided accessToken.
|
* token used to create the provided accessToken.
|
||||||
*
|
*
|
||||||
* @param {String} accessToken - the access token to invalidate.
|
* @param {string} accessToken The access token to invalidate.
|
||||||
* @param {String} clientToken - the launcher's client token.
|
* @param {string} clientToken The launcher's client token.
|
||||||
*
|
*
|
||||||
* @see http://wiki.vg/Authentication#Invalidate
|
* @see http://wiki.vg/Authentication#Invalidate
|
||||||
*/
|
*/
|
||||||
@ -192,9 +192,9 @@ exports.invalidate = function(accessToken, clientToken){
|
|||||||
* in without asking them for their credentials again. A new access token will
|
* in without asking them for their credentials again. A new access token will
|
||||||
* be generated using a recent invalid access token. See Wiki for more info.
|
* be generated using a recent invalid access token. See Wiki for more info.
|
||||||
*
|
*
|
||||||
* @param {String} accessToken - the old access token.
|
* @param {string} accessToken The old access token.
|
||||||
* @param {String} clientToken - the launcher's client token.
|
* @param {string} clientToken The launcher's client token.
|
||||||
* @param {Boolean} requestUser - optional. Adds user object to the reponse.
|
* @param {boolean} requestUser Optional. Adds user object to the reponse.
|
||||||
*
|
*
|
||||||
* @see http://wiki.vg/Authentication#Refresh
|
* @see http://wiki.vg/Authentication#Refresh
|
||||||
*/
|
*/
|
||||||
|
@ -93,8 +93,8 @@ class ProcessBuilder {
|
|||||||
/**
|
/**
|
||||||
* Construct the argument array that will be passed to the JVM process.
|
* Construct the argument array that will be passed to the JVM process.
|
||||||
*
|
*
|
||||||
* @param {Array.<Object>} mods - An array of enabled mods which will be launched with this process.
|
* @param {Array.<Object>} mods An array of enabled mods which will be launched with this process.
|
||||||
* @returns {Array.<String>} - An array containing the full JVM arguments for this process.
|
* @returns {Array.<string>} An array containing the full JVM arguments for this process.
|
||||||
*/
|
*/
|
||||||
constructJVMArguments(mods){
|
constructJVMArguments(mods){
|
||||||
|
|
||||||
@ -118,7 +118,7 @@ class ProcessBuilder {
|
|||||||
/**
|
/**
|
||||||
* Resolve the arguments required by forge.
|
* Resolve the arguments required by forge.
|
||||||
*
|
*
|
||||||
* @returns {Array.<String>} - An array containing the arguments required by forge.
|
* @returns {Array.<string>} An array containing the arguments required by forge.
|
||||||
*/
|
*/
|
||||||
_resolveForgeArgs(){
|
_resolveForgeArgs(){
|
||||||
const mcArgs = this.forgeData.minecraftArguments.split(' ')
|
const mcArgs = this.forgeData.minecraftArguments.split(' ')
|
||||||
@ -196,8 +196,8 @@ class ProcessBuilder {
|
|||||||
* libraries as well as the libraries declared by the server. Since mods are permitted to declare libraries,
|
* libraries as well as the libraries declared by the server. Since mods are permitted to declare libraries,
|
||||||
* this method requires all enabled mods as an input
|
* this method requires all enabled mods as an input
|
||||||
*
|
*
|
||||||
* @param {Array.<Object>} mods - An array of enabled mods which will be launched with this process.
|
* @param {Array.<Object>} mods An array of enabled mods which will be launched with this process.
|
||||||
* @returns {Array.<String>} - An array containing the paths of each library required by this process.
|
* @returns {Array.<string>} An array containing the paths of each library required by this process.
|
||||||
*/
|
*/
|
||||||
classpathArg(mods){
|
classpathArg(mods){
|
||||||
let cpArgs = []
|
let cpArgs = []
|
||||||
@ -223,7 +223,7 @@ class ProcessBuilder {
|
|||||||
*
|
*
|
||||||
* TODO - clean up function
|
* TODO - clean up function
|
||||||
*
|
*
|
||||||
* @returns {Array.<String>} - An array containing the paths of each library mojang declares.
|
* @returns {Array.<string>} An array containing the paths of each library mojang declares.
|
||||||
*/
|
*/
|
||||||
_resolveMojangLibraries(){
|
_resolveMojangLibraries(){
|
||||||
const libs = []
|
const libs = []
|
||||||
@ -293,8 +293,8 @@ class ProcessBuilder {
|
|||||||
* This method will also check each enabled mod for libraries, as mods are permitted to
|
* This method will also check each enabled mod for libraries, as mods are permitted to
|
||||||
* declare libraries.
|
* declare libraries.
|
||||||
*
|
*
|
||||||
* @param {Array.<Object>} mods - An array of enabled mods which will be launched with this process.
|
* @param {Array.<Object>} mods An array of enabled mods which will be launched with this process.
|
||||||
* @returns {Array.<String>} - An array containing the paths of each library this server requires.
|
* @returns {Array.<string>} An array containing the paths of each library this server requires.
|
||||||
*/
|
*/
|
||||||
_resolveServerLibraries(mods){
|
_resolveServerLibraries(mods){
|
||||||
const mdles = this.server.modules
|
const mdles = this.server.modules
|
||||||
@ -330,8 +330,8 @@ class ProcessBuilder {
|
|||||||
/**
|
/**
|
||||||
* Recursively resolve the path of each library required by this module.
|
* Recursively resolve the path of each library required by this module.
|
||||||
*
|
*
|
||||||
* @param {Object} mdle - A module object from the server distro index.
|
* @param {Object} mdle A module object from the server distro index.
|
||||||
* @returns {Array.<String>} - An array containing the paths of each library this module requires.
|
* @returns {Array.<string>} An array containing the paths of each library this module requires.
|
||||||
*/
|
*/
|
||||||
_resolveModuleLibraries(mdle){
|
_resolveModuleLibraries(mdle){
|
||||||
if(mdle.sub_modules == null){
|
if(mdle.sub_modules == null){
|
||||||
|
Loading…
Reference in New Issue
Block a user