Working on concepts for login UI.

This commit is contained in:
Daniel Scalzi
2017-05-23 01:45:20 -04:00
parent bb566471b8
commit f8a0805c8c
6 changed files with 246 additions and 58 deletions

View File

@@ -186,7 +186,7 @@ const instance = new AssetGuard()
* '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
*
* @param {String} artifact - the artifact id string.
* @param {String} artifactid - the artifact id string.
* @param {String} extension - the extension of the file at the resolved path.
* @returns {String} - the resolved relative path from the artifact id.
*/
@@ -201,6 +201,26 @@ function _resolvePath(artifactid, extension){
return path.join.apply(path, cs)
}
/**
* Resolve an artifact id into a URL. For example,
* '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
*
* @param {String} artifactid - the artifact id string.
* @param {String} extension - the extension of the file at the resolved url.
* @returns {String} - the resolved relative URL from the artifact id.
*/
function _resolveURL(artifactid, extension){
let ps = artifactid.split(':')
let cs = ps[0].split('.')
cs.push(ps[1])
cs.push(ps[2])
cs.push(ps[1].concat('-').concat(ps[2]).concat(extension))
return cs.join('/')
}
/**
* Calculates the hash for a file using the specified algorithm.
*
@@ -724,17 +744,19 @@ function _parseDistroModules(modules, basePath, version){
let obPath = obArtifact.path == null ? _resolvePath(ob.id, obArtifact.extension) : obArtifact.path
switch(obType){
case 'forge-hosted':
case 'forge':
obPath = path.join(basePath, 'libraries', obPath)
break;
break
case 'library':
obPath = path.join(basePath, 'libraries', obPath)
break;
break
case 'forgemod':
obPath = path.join(basePath, 'mods', obPath)
break;
break
case 'litemod':
obPath = path.join(basePath, 'mods', version, obPath)
break;
break
case 'file':
default:
obPath = path.join(basePath, obPath)
}
@@ -788,6 +810,10 @@ function loadForgeData(serverpack, basePath){
})
}
function _parseForgeLibraries(){
}
/**
* This function will initiate the download processed for the specified identifiers. If no argument is
* given, all identifiers will be initiated. Note that in order for files to be processed you need to run