diff --git a/app/Inworks-index-ignore.html b/app/Inworks-index-ignore.html deleted file mode 100755 index 19cd8eb..0000000 --- a/app/Inworks-index-ignore.html +++ /dev/null @@ -1,180 +0,0 @@ -<<<<<<< HEAD - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- -
-
- -
-
- - - - - - - - - -
-
- - -
-
- -
- -
- -
- - - -
- -
- -

Email

- - -

Password

- - -
- -
- -
- -
- - - -
-
- -
- -

Post title

- -

Posted by: PERSON 23.4.17

- -
    Hello WesterosCraft Builders and Honored Guests! As you know, 
-                            progress on Kingslanding had stalled, but no longer -- we want to finish this big, beautiful, city in style and 
-                            are calling all builders to the capital! 
-                            There has been a lot of progress with Kingslanding planning and we are happy to...
-                            
- -
- -
-
- -
- - - - - - - - - - - - - -======= - - - - - - Westeroscraft Launcher - - - - -
-
- -
-
- -
-
- - - - - - - - - -
-
-
- -
-
-
-
-
-
-
-
-
-
-
- - ->>>>>>> refs/remotes/origin/master diff --git a/app/assets/WesterosCraft-1.11.2-user.json b/app/assets/WesterosCraft-1.11.2-user.json new file mode 100644 index 0000000..1665e9d --- /dev/null +++ b/app/assets/WesterosCraft-1.11.2-user.json @@ -0,0 +1,8 @@ +{ + "repositoryRoot": "/modstore", + "modRef": [ + "my.custom:mod:1.11.2", + "another.custom:mod:1.11.2" + ], + "parentList": "/mods/WesterosCraft-1.11.2.json" +} \ No newline at end of file diff --git a/app/assets/WesterosCraft-1.11.2.json b/app/assets/WesterosCraft-1.11.2.json new file mode 100644 index 0000000..93cc392 --- /dev/null +++ b/app/assets/WesterosCraft-1.11.2.json @@ -0,0 +1,9 @@ +{ + "repositoryRoot": "C:\\Users\\Asus\\Desktop\\LauncherElectron\\mcfiles\\modstore", + "modRef": [ + "com.westeroscraft:westerosblocks:3.0.0-beta-71", + "mezz:jei:1.11.2-4.3.5.277", + "net.optifine:optifine:1.11.2_HD_U_B9", + "chatbubbles:chatbubbles:1.0.1_for_1.11.2" + ] +} \ No newline at end of file diff --git a/app/assets/css/global.css b/app/assets/css/global.css deleted file mode 100755 index 5a0f2fe..0000000 --- a/app/assets/css/global.css +++ /dev/null @@ -1,55 +0,0 @@ - -@font-face { - font-family: ringbearer; - src: url('../fonts/ringbearer.ttf'); -} - -/* Logger font, found on https://fonts.google.com/specimen/Inconsolata?selection.family=Inconsolata */ -@font-face { - font-family: inconsolata; - src: url('../fonts/Inconsolata-Bold.ttf'); -} - - -html , body{ - background: url('../images/BrownWithWignette.jpg') no-repeat center center fixed; - background-size: cover; -} - - -a, a:hover -{ - color: black; - text-decoration:none; - cursor:pointer; -} - - -pre {border: 0; background-color: transparent;} - - - -input{ - width: 100%; - padding-left: 3px; - border: none; - border-bottom: 3px solid #ECECEC; - font-size: 20px; - outline:none; -} - - -p, img, pre, span, label, h1 ,h2 ,h3 { - -webkit-touch-callout: none; - -webkit-user-select: none; - -khtml-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - - -webkit-user-drag: none; - -khtml-user-drag: none; - -moz-user-drag: none; - -o-user-drag: none; - user-drag: none; -} diff --git a/app/assets/css/header.css b/app/assets/css/header.css deleted file mode 100755 index 7e7ff95..0000000 --- a/app/assets/css/header.css +++ /dev/null @@ -1,46 +0,0 @@ -#header_container { - background-color: black; - padding: 5px; - font-size: 0px; - text-align: center; - border-bottom: thick solid #a02d2a; - border-bottom-width: 5px; - position: relative; -} - -/* Div container for the seal image. */ -#header_seal_container { - position: absolute; -} - -/* Div container for the header image. */ -#header_img_container { - display: inline-block; - margin: 0 auto; -} - -/* Seal and header images. */ -#header_seal, -#header_img { - height: 75px; - width: auto; - display: block; -} - -/* Div container for the social buttons. */ -#header_social_container { - position: absolute; - bottom: 0px; - right: 0px; - margin-bottom: 5px; -} - -/* Social buttons. */ -.header_social_img { - height: 25px; - width: auto; - display: inline-block; - cursor: pointer; - margin-right: 5px; -} - diff --git a/app/assets/css/styles.css b/app/assets/css/styles.css deleted file mode 100644 index 9569f3c..0000000 --- a/app/assets/css/styles.css +++ /dev/null @@ -1,351 +0,0 @@ -/******************************************************************************* - * * - * Fonts * - * * - ******************************************************************************/ - - /* Primary font for the application, found on http://www.dafont.com/ringbearer.font */ -@font-face { - font-family: ringbearer; - src: url('../fonts/ringbearer.ttf'); -} - -/* Logger font, found on https://fonts.google.com/specimen/Inconsolata?selection.family=Inconsolata */ -@font-face { - font-family: inconsolata; - src: url('../fonts/Inconsolata-Regular.ttf'); -} - -/******************************************************************************* - * * - * Body * - * * - ******************************************************************************/ - -/* Reset body, html, and div presets. */ -body, html, div { - margin: 0px; - padding: 0px; -} - -html, body { - height: 100%; -} - -html { - background: url('../images/BrownWithWignette.jpg') no-repeat center center fixed; - background-size: cover; -} - -#main_content { - height: calc(100% - 90px); - display: flex; -} - -button { - background-color: #a02d2a; - color: #ffffff; - border: none; - padding: 7px 10px; - text-align: center; - text-decoration: none; - font-size: 14px; -} - -button:hover { - box-shadow: 0 12px 16px 0 rgba(0,0,0,0.24), 0 17px 50px 0 rgba(0,0,0,0.19); -} - -::selection { - background-color: #a02d2a; - color: #ffffff; -} - -/******************************************************************************* - * * - * Header * - * * - ******************************************************************************/ - -/* Main div header container. */ -#header_container { - background-color: black; - padding: 5px; - font-size: 0px; - text-align: center; - border-bottom: thick solid #a02d2a; - border-bottom-width: 5px; - position: relative; -} - -/* Div container for the seal image. */ -#header_seal_container { - position: absolute; -} - -/* Div container for the header image. */ -#header_img_container { - display: inline-block; - margin: 0 auto; -} - -/* Seal and header images. */ -#header_seal, -#header_img { - height: 75px; - width: auto; - display: block; -} - -/* Div container for the social buttons. */ -#header_social_container { - position: absolute; - bottom: 0px; - right: 0px; - margin-bottom: 5px; -} - -/* Social buttons. */ -.header_social_img { - height: 25px; - width: auto; - display: inline-block; - cursor: pointer; - margin-right: 5px; -} - -/******************************************************************************* - * * - * Toggle Buttons * - * * - ******************************************************************************/ - -.toggle-btn { - color: #000000; - font-size: 15px; - font-family: 'ringbearer'; - user-select: none; - background-color: transparent; - display: inline-flex; - cursor: pointer; - width: 90px; - height: 35px; -} - -.toggle-btn-grp .toggle-btn { - border-radius: 0; - align-items: center; - justify-content: center; -} - -.toggle-btn:not(.success):hover { - box-shadow: inset 0 -4.5px 0 0 #000000; -} - -.toggle-btn.success { - background: #a02d2a; - color: #ffffff; - cursor: default; -} - -.visuallyhidden { - border: 0; - clip: rect(0 0 0 0); - height: 1px; - margin: -1px; - overflow: hidden; - padding: 0; - position: absolute; - width: 1px; -} - -.visuallyhidden.focusable:active, .visuallyhidden.focusable:focus { - clip: auto; - height: auto; - margin: 0; - overflow: visible; - position: static; - width: auto; -} - -/******************************************************************************* - * * - * Left Body Container * - * * - ******************************************************************************/ - -#left_pane { - float: left; - width: 30%; -} - -#welcome_text_container { - display: table; - margin: 0 auto; -} - -#welcome_text { - font-family: 'ringbearer'; - font-size: 16px; - display: table-cell; - text-align: center; - vertical-align: middle; - height: 35px; -} - -#login_pane { - background: linear-gradient(141deg, #000000 -5%, #a02d2a 120%, #000000 150%); - padding-top: 5px; - border-radius: 5px; - box-shadow: 0px 0px 5px 2px rgba(0, 0, 0, 0.28); - width: 97%; - margin: 0 auto; -} - -#login_pane_header_container { - margin-left: 10px; -} - -.login_pane_header { - font-size: 14px; - font-family: 'Segoe UI'; - font-weight: 500; - color: white; -} - -#login_container { - display: inline-flex; - width: 100%; -} - -#login_image { - height: 85px; - width: auto; - display: block; - border: 3px solid #000000; -} - -#login_container_right input, -#login_container_right label { - display: flex; - width: 100%; -} - -#login_container_left { - padding: 10px 0 10px 10px; -} - -#login_container_right { - padding: 10px; - width: 100%; -} - -.login_field { - font-size: 12px; - font-family: 'Segoe UI'; - font-weight: 500; - color: white; - /* new */ - display: table; -} - -#button_login { - float: right; - margin-top: 10px; -} - -/******************************************************************************* - * * - * Right Body Container * - * * - ******************************************************************************/ - -#right_pane { - float: right; - width: 70%; -} - -#content_container { - border: 3px solid #a02d2a; - height: calc(98% - 41.33px); - width: 98%; - display: flex; -} - -#launcher-log { - font-family: 'inconsolata'; - font-size: 12px; - color: #ffffff; - background-color: #1a1b1c; - border: none; - outline: none; - overflow-y: scroll; - display: block; - align-items: stretch; - width: 100%; - resize: none; - padding: 5px 10px; - text-shadow: 0.01px 0.01px 0.01px #ffffff; - line-height: 1.2em; -} - -#launcher-log::selection { - background: rgba(160, 45, 42, .9); - color: #ffffff; -} - -#launcher-log::-webkit-scrollbar { - background-color: #a02d2a; -} - -#launcher-log::-webkit-scrollbar-thumb:window-inactive, -#launcher-log::-webkit-scrollbar-thumb { - background: black -} - -.log_debug { - color: blue; -} - -/******************************************************************************* - * * - * Login View * - * * - ******************************************************************************/ - -#login_view { - background: rgba(0, 0, 0, 0.76); - height: calc(100% - 90px); - display: flex; - justify-content: center; - align-items: center; -} - -#login_content { - width: 50%; - height: 75%; - display: flex; - justify-content: center; -} - -#login_view #content_main { - display: flex; -} - -#login_view #login_content_image { - height: 125px; - width: auto; -} - -#login_view #content_main #right { - margin-left: 10px; -} - -.login_input { - background-color: #a02d2a; -} - -.login_input::-webkit-input-placeholder { - color: white; -} - diff --git a/app/assets/images/.BrownWithWignette.jpg.icloud b/app/assets/images/.BrownWithWignette.jpg.icloud deleted file mode 100644 index 6669ec3..0000000 Binary files a/app/assets/images/.BrownWithWignette.jpg.icloud and /dev/null differ diff --git a/app/assets/images/facebook.png b/app/assets/images/facebook.png deleted file mode 100644 index 7615371..0000000 Binary files a/app/assets/images/facebook.png and /dev/null differ diff --git a/app/assets/images/reddit.png b/app/assets/images/reddit.png deleted file mode 100644 index bd4ca02..0000000 Binary files a/app/assets/images/reddit.png and /dev/null differ diff --git a/app/assets/images/twitter.png b/app/assets/images/twitter.png deleted file mode 100644 index 337e0b5..0000000 Binary files a/app/assets/images/twitter.png and /dev/null differ diff --git a/app/assets/js/assetdownload.js b/app/assets/js/assetdownload.js deleted file mode 100644 index 7a17fe7..0000000 --- a/app/assets/js/assetdownload.js +++ /dev/null @@ -1,239 +0,0 @@ -const fs = require('fs') -const request = require('request') -const path = require('path') -const mkpath = require('mkdirp'); -const async = require('async') -const crypto = require('crypto') -const Library = require('./library.js') -const {BrowserWindow} = require('electron') - -/** - * PHASING THIS OUT, WILL BE REMOVED WHEN ASSET GUARD MODULE IS COMPLETE! - */ - -function Asset(from, to, size, hash){ - this.from = from - this.to = to - this.size = size - this.hash = hash -} - -function AssetIndex(id, sha1, size, url, totalSize){ - this.id = id - this.sha1 = sha1 - this.size = size - this.url = url - this.totalSize = totalSize -} - -/** - * This function will download the version index data and read it into a Javascript - * Object. This object will then be returned. - */ -parseVersionData = function(version, basePath){ - const name = version + '.json' - const baseURL = 'https://s3.amazonaws.com/Minecraft.Download/versions/' + version + '/' + name - const versionPath = path.join(basePath, 'versions', version) - - return new Promise(function(fulfill, reject){ - request.head(baseURL, function(err, res, body){ - console.log('Preparing download of ' + version + ' assets.') - mkpath.sync(versionPath) - const stream = request(baseURL).pipe(fs.createWriteStream(path.join(versionPath, name))) - stream.on('finish', function(){ - fulfill(JSON.parse(fs.readFileSync(path.join(versionPath, name)))) - }) - }) - }) -} - -/** - * Download the client for version. This file is 'client.jar' although - * it must be renamed to '{version}'.jar. - */ -downloadClient = function(versionData, basePath){ - const dls = versionData['downloads'] - const clientData = dls['client'] - const url = clientData['url'] - const size = clientData['size'] - const version = versionData['id'] - const sha1 = clientData['sha1'] - const targetPath = path.join(basePath, 'versions', version) - const targetFile = version + '.jar' - - if(!validateLocalIntegrity(path.join(targetPath, targetFile), 'sha1', sha1)){ - request.head(url, function(err, res, body){ - console.log('Downloading ' + version + ' client..') - mkpath.sync(targetPath) - const stream = request(url).pipe(fs.createWriteStream(path.join(targetPath, targetFile))) - stream.on('finish', function(){ - console.log('Finished downloading ' + version + ' client.') - }) - }) - } -} - -downloadLogConfig = function(versionData, basePath){ - const logging = versionData['logging'] - const client = logging['client'] - const file = client['file'] - const version = versionData['id'] - const sha1 = file['sha1'] - const targetPath = path.join(basePath, 'assets', 'log_configs') - const name = file['id'] - const url = file['url'] - - if(!validateLocalIntegrity(path.join(targetPath, name), 'sha1', sha1)){ - request.head(url, function(err, res, body){ - console.log('Downloading ' + version + ' log config..') - mkpath.sync(targetPath) - const stream = request(url).pipe(fs.createWriteStream(path.join(targetPath, name))) - stream.on('finish', function(){ - console.log('Finished downloading ' + version + ' log config..') - }) - }) - } -} - -downloadLibraries = function(versionData, basePath){ - const libArr = versionData['libraries'] - const libPath = path.join(basePath, 'libraries') - - let win = BrowserWindow.getFocusedWindow() - const libDlQueue = [] - let dlSize = 0 - - //Check validity of each library. If the hashs don't match, download the library. - libArr.forEach(function(lib, index){ - if(Library.validateRules(lib.rules)){ - let artifact = null - if(lib.natives == null){ - artifact = lib.downloads.artifact - } else { - artifact = lib.downloads.classifiers[lib.natives[Library.mojangFriendlyOS()]] - } - const libItm = new Library(lib.name, artifact.sha1, artifact.size, artifact.url, path.join(libPath, artifact.path)) - if(!validateLocalIntegrity(libItm.to, 'sha1', libItm.sha1)){ - dlSize += libItm.size - libDlQueue.push(libItm) - } - } - }) - - let acc = 0; - - //Download all libraries that failed validation. - async.eachLimit(libDlQueue, 1, function(lib, cb){ - mkpath.sync(path.join(lib.to, '..')) - let req = request(lib.from) - let writeStream = fs.createWriteStream(lib.to) - req.pipe(writeStream) - - req.on('data', function(chunk){ - acc += chunk.length - //console.log('Progress', acc/dlSize) - win.setProgressBar(acc/dlSize) - }) - writeStream.on('close', cb) - }, function(err){ - if(err){ - console.log('A library failed to process'); - } else { - console.log('All libraries have been processed successfully'); - } - win.setProgressBar(-1) - }) -} - -/** - * Given an index url, this function will asynchonously download the - * assets associated with that version. - */ -downloadAssets = function(versionData, basePath){ - //Asset index constants. - const assetIndex = versionData.assetIndex - const indexURL = assetIndex.url - const gameVersion = versionData.id - const assetVersion = assetIndex.id - const name = assetVersion + '.json' - - //Asset constants - const resourceURL = 'http://resources.download.minecraft.net/' - const localPath = path.join(basePath, 'assets') - const indexPath = path.join(localPath, 'indexes') - const objectPath = path.join(localPath, 'objects') - - let win = BrowserWindow.getFocusedWindow() - - const assetIndexLoc = path.join(indexPath, name) - /*if(!fs.existsSync(assetIndexLoc)){ - - }*/ - console.log('Downloading ' + gameVersion + ' asset index.') - mkpath.sync(indexPath) - const stream = request(indexURL).pipe(fs.createWriteStream(assetIndexLoc)) - stream.on('finish', function() { - const data = JSON.parse(fs.readFileSync(assetIndexLoc, 'utf-8')) - const assetDlQueue = [] - let dlSize = 0; - Object.keys(data.objects).forEach(function(key, index){ - const ob = data.objects[key] - const hash = ob.hash - const assetName = path.join(hash.substring(0, 2), hash) - const urlName = hash.substring(0, 2) + "/" + hash - const ast = new Asset(resourceURL + urlName, path.join(objectPath, assetName), ob.size, String(ob.hash)) - if(!validateLocalIntegrity(ast.to, 'sha1', ast.hash)){ - dlSize += ast.size - assetDlQueue.push(ast) - } - }) - - let acc = 0; - async.eachLimit(assetDlQueue, 5, function(asset, cb){ - mkpath.sync(path.join(asset.to, "..")) - let req = request(asset.from) - let writeStream = fs.createWriteStream(asset.to) - req.pipe(writeStream) - req.on('data', function(chunk){ - acc += chunk.length - console.log('Progress', acc/dlSize) - win.setProgressBar(acc/dlSize) - }) - writeStream.on('close', cb) - }, function(err){ - if(err){ - console.log('An asset failed to process'); - } else { - console.log('All assets have been processed successfully'); - } - win.setProgressBar(-1) - }) - }) -} - -validateLocalIntegrity = function(filePath, algo, hash){ - if(fs.existsSync(filePath)){ - let fileName = path.basename(filePath) - console.log('Validating integrity of local file', fileName) - let shasum = crypto.createHash(algo) - let content = fs.readFileSync(filePath) - shasum.update(content) - let localhash = shasum.digest('hex') - if(localhash === hash){ - console.log('Hash value of ' + fileName + ' matches the index hash, woo!') - return true - } else { - console.log('Hash value of ' + fileName + ' (' + localhash + ')' + ' does not match the index hash. Redownloading..') - return false - } - } - return false; -} - -module.exports = { - parseVersionData, - downloadClient, - downloadLogConfig, - downloadLibraries, - downloadAssets -} \ No newline at end of file diff --git a/app/assets/js/assetguard.js b/app/assets/js/assetguard.js index 490aa52..d003924 100644 --- a/app/assets/js/assetguard.js +++ b/app/assets/js/assetguard.js @@ -307,7 +307,9 @@ function _validateForgeChecksum(filePath, checksums){ * @returns {Boolean} - true if all hashes declared in the checksums.sha1 file match the actual hashes. */ function _validateForgeJar(buf, checksums){ - + // Double pass method was the quickest I found. I tried a version where we store data + // to only require a single pass, plus some quick cleanup but that seemed to take slightly more time. + const hashes = {} let expected = {} @@ -361,6 +363,16 @@ function _extractPackXZ(filePaths){ }) } +/** + * Function which finalizes the forge installation process. This creates a 'version' + * instance for forge and saves its version.json file into that instance. If that + * instance already exists, the contents of the version.json file are read and returned + * in a promise. + * + * @param {Asset} asset - The Asset object representing Forge. + * @param {String} basePath + * @returns {Promise.} - A promise which resolves to the contents of forge's version.json. + */ function _finalizeForgeAsset(asset, basePath){ return new Promise(function(fulfill, reject){ fs.readFile(asset.to, (err, data) => { @@ -377,11 +389,14 @@ function _finalizeForgeAsset(asset, basePath){ fs.writeFileSync(path.join(versionPath, forgeVersion.id + '.json'), zipEntries[i].getData()) fulfill(forgeVersion) } else { + //Read the saved file to allow for user modifications. fulfill(JSON.parse(fs.readFileSync(versionFile, 'utf-8'))) } return } } + //We didn't find forge's version.json. + reject('Unable to finalize Forge processing, version.json not found! Has forge changed their format?') }) }) } @@ -402,7 +417,7 @@ function startAsyncProcess(identifier, limit = 5){ if(concurrentDlQueue.length === 0){ return false } else { - console.log(instance.progress) + console.log(concurrentDlQueue) async.eachLimit(concurrentDlQueue, limit, function(asset, cb){ let count = 0; mkpath.sync(path.join(asset.to, "..")) @@ -745,32 +760,29 @@ function _parseDistroModules(modules, basePath, version){ switch(obType){ case 'forge-hosted': case 'forge': - obPath = path.join(basePath, 'libraries', obPath) - break case 'library': obPath = path.join(basePath, 'libraries', obPath) break case 'forgemod': - obPath = path.join(basePath, 'mods', obPath) + //obPath = path.join(basePath, 'mods', obPath) + obPath = path.join(basePath, 'modstore', obPath) break case 'litemod': - obPath = path.join(basePath, 'mods', version, obPath) + //obPath = path.join(basePath, 'mods', version, obPath) + obPath = path.join(basePath, 'modstore', obPath) break case 'file': default: obPath = path.join(basePath, obPath) } let artifact = new DistroModule(ob.id, obArtifact.MD5, obArtifact.size, obArtifact.url, obPath, obType) - if(obPath.toLowerCase().endsWith('.pack.xz')){ - if(!_validateLocal(obPath.substring(0, obPath.toLowerCase().lastIndexOf('.pack.xz')), 'MD5', artifact.hash)){ - asize += artifact.size*1 - alist.push(artifact) - decompressqueue.push(obPath) - } - } else if(!_validateLocal(obPath, 'MD5', artifact.hash)){ + const validationPath = obPath.toLowerCase().endsWith('.pack.xz') ? obPath.substring(0, obPath.toLowerCase().lastIndexOf('.pack.xz')) : obPath + if(!_validateLocal(validationPath, 'MD5', artifact.hash)){ asize += artifact.size*1 alist.push(artifact) + if(validationPath !== obPath) decompressqueue.push(obPath) } + //Recursively process the submodules then combine the results. if(ob.sub_modules != null){ let dltrack = _parseDistroModules(ob.sub_modules, basePath, version) asize += dltrack.dlsize*1 @@ -778,9 +790,18 @@ function _parseDistroModules(modules, basePath, version){ decompressqueue = decompressqueue.concat(dltrack.callback) } } + + //Since we have no callback at this point, we use this value to store the decompressqueue. return new DLTracker(alist, asize, decompressqueue) } +/** + * 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} basePath + * @returns {Promise.} - A promise which resolves to Forge's version.json data. + */ function loadForgeData(serverpack, basePath){ return new Promise(async function(fulfill, reject){ let distro = await _chainValidateDistributionIndex(basePath) @@ -811,7 +832,11 @@ function loadForgeData(serverpack, basePath){ } function _parseForgeLibraries(){ - + /* TODO + * Forge asset validations are already implemented. When there's nothing much + * to work on, implement forge downloads using forge's version.json. This is to + * have the code on standby if we ever need it (since it's half implemented already). + */ } /** diff --git a/app/assets/js/launchprocess.js b/app/assets/js/launchprocess.js index 9d8a5cb..6b60f1a 100644 --- a/app/assets/js/launchprocess.js +++ b/app/assets/js/launchprocess.js @@ -8,12 +8,16 @@ const fs = require('fs') const mkpath = require('mkdirp'); function launchMinecraft(versionData, forgeData, basePath){ - const authPromise = mojang.auth('EMAIL', 'PASS', uuidV4(), { + const authPromise = mojang.auth('nytrocraft@live.com', 'applesrsogood123', uuidV4(), { name: 'Minecraft', version: 1 }) authPromise.then(function(data){ + console.log(data) const args = finalizeArgumentsForge(versionData, forgeData, data, basePath) + //BRUTEFORCE for testing + //args.push('-mods modstore\\chatbubbles\\chatbubbles\\1.0.1_for_1.11.2\\mod_chatBubbles-1.0.1_for_1.11.2.litemod,modstore\\com\\westeroscraft\\westerosblocks\\3.0.0-beta-71\\westerosblocks-3.0.0-beta-71.jar,modstore\\mezz\\jei\\1.11.2-4.3.5.277\\jei-1.11.2-4.3.5.277.jar,modstore\\net\\optifine\\optifine\\1.11.2_HD_U_B9\\optifine-1.11.2_HD_U_B9.jar') + //args.push('--modListFile absolute:C:\\Users\\Asus\\Desktop\\LauncherElectron\\app\\assets\\WesterosCraft-1.11.2.json') //TODO make this dynamic const child = child_process.spawn('C:\\Program Files\\Java\\jre1.8.0_131\\bin\\javaw.exe', args) child.stdout.on('data', (data) => { @@ -51,7 +55,8 @@ function finalizeArgumentsForge(versionData, forgeData, authData, basePath){ newVal = gameProfile['name'] break case 'version_name': - newVal = versionData['id'] + //newVal = versionData['id'] + newVal = 'WesterosCraft-1.11.2' break case 'game_directory': newVal = basePath @@ -200,6 +205,10 @@ function classpathArg(versionData, basePath){ } }) + //BRUTEFORCE LIB INJECTION + //FOR TESTING ONLY + cpArgs.push(path.join(libPath, 'com', 'mumfrey', 'liteloader', '1.11.2-SNAPSHOT', 'liteloader-1.11.2-SNAPSHOT.jar')) + return cpArgs } diff --git a/app/assets/js/modlist.js b/app/assets/js/modlist.js index 24b1576..64a6b0e 100644 --- a/app/assets/js/modlist.js +++ b/app/assets/js/modlist.js @@ -45,7 +45,7 @@ export class ModList { * @param {Object} distro - the distribution index. */ static generateModList(distro){ - + } } \ No newline at end of file diff --git a/app/assets/js/script.js b/app/assets/js/script.js index e542189..db405db 100644 --- a/app/assets/js/script.js +++ b/app/assets/js/script.js @@ -26,7 +26,7 @@ $(document).on('ready', function(){ $(this).parent().toggleClass("success") } }) - console.log = function(){ + /*console.log = function(){ $('#launcher-log').append(timestamp() + ' [Log] - ' + Array.prototype.slice.call(arguments).join(' ') + os.EOL) } console.error = function(){ @@ -36,7 +36,7 @@ $(document).on('ready', function(){ $('#launcher-log').append('' + timestamp() + ' [Error] - ' + Array.prototype.slice.call(arguments).join(' ') + "" + os.EOL) } console.log('test') - console.debug('test') + console.debug('test')*/ }) /* Open web links in the user's default browser. */ diff --git a/app/assets/westeroscraft.json b/app/assets/westeroscraft.json index ccd931d..5a78c97 100644 --- a/app/assets/westeroscraft.json +++ b/app/assets/westeroscraft.json @@ -229,18 +229,20 @@ "artifact": { "size": 2056699, "MD5": "38b4c51b9c6ebc09e7a9784accea974e", - "path": "OptiFine-1.11.2_HD_U_B9.jar", + "----path": "OptiFine-1.11.2_HD_U_B9.jar", + "extension": ".jar", "url": "http://mc.westeroscraft.com/WesterosCraftLauncher/test-1.11.2/mods/OptiFine.jar" } }, { - "id": "jei", + "id": "mezz:jei:1.11.2-4.3.5.277", "name": "JustEnoughItems (1.11.2-4.3.5.277)", "type": "forgemod", "artifact": { "size": 509450, "MD5": "ea56276646ce405bb4beeaf9064de611", - "path": "jei.jar", + "----path": "jei.jar", + "extension": ".jar", "url": "http://mc.westeroscraft.com/WesterosCraftLauncher/test-1.11.2/mods/jei.jar" } }, @@ -249,9 +251,10 @@ "name": "WesterosBlocks (3.0.0-beta-71)", "type": "forgemod", "artifact": { - "size": 16230253, - "MD5": "2e3ea10730720b8abbf408262d922249", - "path": "WesterosBlocks.jar", + "size": 16252437, + "MD5": "d868f0c0b0cabf3cee2b585503873380", + "----path": "WesterosBlocks.jar", + "extension": ".jar", "url": "http://mc.westeroscraft.com/WesterosCraftLauncher/test-1.11.2/mods/WesterosBlocks.jar" } }, @@ -260,8 +263,8 @@ "name": "WesterosCraft Resource Pack (2017-05-20)", "type": "file", "artifact": { - "size": 44704858, - "MD5": "a2e552df2d5f7f6d6d34f3afe5674670", + "size": 44573660, + "MD5": "b982a65e3fc6971b809f8c60ad4507af", "path": "resourcepacks/WesterosCraft.zip", "url": "http://mc.westeroscraft.com/WesterosCraftLauncher/test-1.11.2/resourcepacks/WesterosCraft.zip" } @@ -288,7 +291,7 @@ } }, { - "id": "chatbubbles", + "id": "chatbubbles:chatbubbles:1.0.1_for_1.11.2", "name": "Chat Bubbles 1.11.2", "type": "litemod", "required": { @@ -296,8 +299,9 @@ }, "artifact": { "size": 37838, - "MD5": "0497a93e5429b43082282e9d9119fcba", - "path": "mod_chatBubbles-1.0.1_for_1.11.2.litemod", + "MD5": "0497a93e5429b43082282e9d9119fcba", + "---path": "mod_chatBubbles-1.0.1_for_1.11.2.litemod", + "extension": ".litemod", "url": "http://mc.westeroscraft.com/WesterosCraftLauncher/files/1.11.2/mod_chatBubbles-1.0.1_for_1.11.2.litemod" }, "sub_modules": [ diff --git a/app/index.html b/app/index.html deleted file mode 100644 index 25ebcd6..0000000 --- a/app/index.html +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - Westeroscraft Launcher - - - - -
-
- -
-
- -
- -
- -
-
-
-
- -
- -
-
-
- - - - \ No newline at end of file diff --git a/app/loginConcept.html b/app/loginConcept.html deleted file mode 100644 index bb05ef2..0000000 --- a/app/loginConcept.html +++ /dev/null @@ -1,150 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file