Removing old and deprecated assets in preparation for the new design.

react
Daniel Scalzi 2017-08-26 14:43:24 -04:00
parent 4a8bffe8f6
commit 6a44694a32
18 changed files with 85 additions and 1155 deletions

View File

@ -1,180 +0,0 @@
<<<<<<< HEAD
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="assets/css/global.css">
<link rel="stylesheet" type="text/css" href="assets/css/header.css">
<link rel="stylesheet" type="text/css" href="assets/css/nav.css">
</head>
<style>
.inner_div{
width:100%;
background-color: black;
border: 5px solid #a02d2a;
}
</style>
<body>
<div id="header_container">
<div id="header_seal_container">
<img id="header_seal" src="./assets/images/WesterosSealSquare.png"/>
</div>
<div id="header_img_container">
<img id="header_img" src="./assets/images/WCTextCrop.png" />
</div>
<div id="header_social_container">
<a href="http://facebook.com/westeroscraft" class="header_social_link">
<img src="./assets/images/facebook.png" class="header_social_img" />
</a>
<a href="http://reddit.com/r/westeroscraft" class="header_social_link">
<img src="./assets/images/reddit.png" class="header_social_img" />
</a>
<a href="http://twitter.com/westeroscraft" class="header_social_link">
<img src="./assets/images/twitter.png" class="header_social_img" />
</a>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-md-2 col-sm-2">
<div class="row">
<div class="col-md-3 col-sm-3">
<img class="player_icon" src="https://minotar.net/helm/pufferboss.png">
</div>
<div class="col-md-9 col-sm-9">
<p class="input_text">Email</p>
<input class="input" id="EMAIL">
<p class="input_text">Password</p>
<input type="password" id="PASSWORD" class="input" />
</div>
</div>
</div>
<div class="col-md-10 col-sm-10">
<ul>
<li><a href="">NEWS</a></li>
<li><a href="">MAP</a></li>
<li><a href="">MODS</a></li>
<li><a href="">FAQ</a></li>
<li><a href="">LOG</a></li>
<li><a href="">SETTINGS</a></li>
</ul>
<br>
<br>
<div class="inner_div">
<p class="title"> Post title </p>
<p class="subtite">Posted by: PERSON 23.4.17</p>
<pre style="text-align: left; word-break: break-all; overflow-wrap: break-word;"> 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...
</pre>
</div>
</div>
</div>
</div>
</body>
</html>
=======
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title>Westeroscraft Launcher</title>
<script src="./assets/js/script.js"></script>
<link type="text/css" rel="stylesheet" href="./assets/css/styles.css">
</head>
<body>
<div id="header_container">
<div id="header_seal_container">
<img id="header_seal" src="./assets/images/WesterosSealSquare.png"/>
</div>
<div id="header_img_container">
<img id="header_img" src="./assets/images/WCTextCrop.png" />
</div>
<div id="header_social_container">
<a href="http://facebook.com/westeroscraft" class="header_social_link">
<img src="./assets/images/facebook.png" class="header_social_img" />
</a>
<a href="http://reddit.com/r/westeroscraft" class="header_social_link">
<img src="./assets/images/reddit.png" class="header_social_img" />
</a>
<a href="http://twitter.com/westeroscraft" class="header_social_link">
<img src="./assets/images/twitter.png" class="header_social_img" />
</a>
</div>
</div>
<div id="body_left_container">
</div>
<div id="body_right_container">
<div id="main_toggle_group">
<div><label><input type="radio" name="main_group" class="mtoggle_button"/>News</label></div>
<div><label><input type="radio" name="main_group" class="mtoggle_button"/>Map</label></div>
<div><label><input type="radio" name="main_group" class="mtoggle_button"/>Mods</label></div>
<div><label><input type="radio" name="main_group" class="mtoggle_button"/>FAQ</label></div>
<div><label><input type="radio" name="main_group" class="mtoggle_button"/>Log</label></div>
<div><label><input type="radio" name="main_group" class="mtoggle_button"/>Settings</label></div>
</div>
</div>
</body>
</html>
>>>>>>> refs/remotes/origin/master

View File

@ -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"
}

View File

@ -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"
]
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

View File

@ -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
}

View File

@ -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.<Object>} - 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.<Object>} - 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).
*/
}
/**

View File

@ -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
}

View File

@ -45,7 +45,7 @@ export class ModList {
* @param {Object} distro - the distribution index.
*/
static generateModList(distro){
}
}

View File

@ -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('<span class="log_debug">' + timestamp() + ' [Error] - ' + Array.prototype.slice.call(arguments).join(' ') + "</span>" + os.EOL)
}
console.log('test')
console.debug('test')
console.debug('test')*/
})
/* Open web links in the user's default browser. */

View File

@ -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": [

View File

@ -1,104 +0,0 @@
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title>Westeroscraft Launcher</title>
<script src="./assets/js/script.js"></script>
<link type="text/css" rel="stylesheet" href="./assets/css/styles.css">
</head>
<body>
<div id="header_container">
<div id="header_seal_container">
<img id="header_seal" src="./assets/images/WesterosSealSquare.png"/>
</div>
<div id="header_img_container">
<img id="header_img" src="./assets/images/WCTextCrop.png" />
</div>
<div id="header_social_container">
<a href="http://facebook.com/westeroscraft" class="header_social_link">
<img src="./assets/images/facebook.png" class="header_social_img" />
</a>
<a href="http://reddit.com/r/westeroscraft" class="header_social_link">
<img src="./assets/images/reddit.png" class="header_social_img" />
</a>
<a href="http://twitter.com/westeroscraft" class="header_social_link">
<img src="./assets/images/twitter.png" class="header_social_img" />
</a>
</div>
</div>
<div id="login_view">
<div id="login_content">
<div id="content_main">
<div id="left">
<img id="login_content_image" src="./assets/images/WesterosSealSquare.png" />
</div>
<div id="right">
<label class="login_field">Username</label>
<input type="text" name="username" placeholder="Username" class="login_input"></input>
<label class="login_field">Password</label>
<input type="password" name="password" placeholder="Password" class="login_input"></input>
<div id="login_button_dock">
<button id="button_login">Login</button>
</div>
</div>
</div>
</div>
</div>
<div id="main_content" style="display: none;">
<div id="left_pane">
<div id="welcome_text_container">
<span id="welcome_text">Welcome to WesterosCraft!</span>
</div>
<div id="login_pane">
<div id="login_pane_header_container">
<label class="login_pane_header">Login to New Account</label>
</div>
<div id="login_container">
<div id="login_container_left">
<img src="https://minotar.net/avatar/TheAventine.png" id="login_image" />
</div>
<div id="login_container_right">
<label class="login_field">Username</label>
<input type="text" name="username"></input>
<label class="login_field">Password</label>
<input type="password" name="password"></input>
<div id="login_button_dock">
<button id="button_login">Login</button>
</div>
</div>
</div>
</div>
<!-- Experimental
<br>
<div id="login_pane">
<div id="login_pane_header_container">
<label class="login_pane_header">Logged in as TheKraken7</label>
</div>
<div id="login_container">
<div id="login_container_left">
<img src="https://minotar.net/avatar/TheKraken7.png" id="login_image" />
</div>
<div id="login_container_right">
<label class="login_field">Switch Account</label>
<select>
<option value="iPepsiHD">iPepsiHD</option>
<option value="$addNew">Add New..</option>
</select>
</div>
</div>
</div>-->
</div>
<div id="right_pane">
<div class="toggle-btn-grp">
<label onclick="" class="toggle-btn success"><input type="radio" name="main_group"/>news</label><label onclick="" class="toggle-btn"><input type="radio" name="main_group"/>map</label><label onclick="" class="toggle-btn"><input type="radio" name="main_group"/>mods</label><label onclick="" class="toggle-btn"><input type="radio" name="main_group"/>faq</label><label onclick="" class="toggle-btn"><input type="radio" name="main_group"/>log</label><label onclick="" class="toggle-btn"><input type="radio" name="main_group"/>settings</label>
</div>
<div id="content_container">
<textarea id="launcher-log"></textarea>
</div>
</div>
</div>
</body>
</html>

View File

@ -1,150 +0,0 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="assets/css/global.css">
<link rel="stylesheet" type="text/css" href="assets/css/header.css">
<link rel="stylesheet" type="text/css" href="assets/css/nav.css">
</head>
<style>
@font-face {
font-family: inconsolata;
src: url('assets/fonts/Inconsolata-Bold.ttf');
}
.login-window {
margin-left: 40%;
width: 20%;
height: 100%;
opacity: 0.7;
background-color: black;
text-align: center;
}
.logo {
margin-top: 40px;
margin-bottom: 40px;
width: 150px;
align: center;
}
.title {
font-family: inconsolata;
font-size: 20px;
color: white;
}
.sub-title {
font-family: inconsolata;
font-size: 15px;
color: #bdc3c7;
font-weight: bold;
}
input {
width: 80%;
border: none;
border-bottom: 2px solid white;
font-size: 20px;
outline: none;
color: #95a5a6;
background: none;
margin-bottom: 5px;
margin-top: 7px;
}
html,
body {
background: url('assets/images/loginBackground.jpg') no-repeat center center fixed;
background-size: cover;
overflow-x: hidden;
overflow-y: auto;
}
.addon {
position: relative;
}
.addon .glyphicon {
position: absolute;
padding-top: 4.9%;
color: white;
pointer-events: none;
font-size: 20px;
text-align: center;
left: 47%;
}
.inline-title-div {
width: 80%;
text-align: center;
margin: 0 auto;
}
.title-inline {
position: relative;
z-index: 1;
overflow: hidden;
}
.title-inline:before,
.title-inline:after {
position: absolute;
top: 51%;
overflow: hidden;
width: 50%;
height: 2px;
content: '\a0';
background-color: white;
}
.title-inline:before {
margin-left: -50%;
text-align: right;
}
</style>
<body>
<div class="login-window" style="text-align: center;">
<img class="logo" src="assets/images/WesterosSealCircle.png">
<p class="title"> MEMBER LOGIN </p>
<div class="addon">
<i class="glyphicon glyphicon-user"></i>
<input>
</div>
<p class="sub-title"> USERNAME </p>
<div class="addon">
<i class="glyphicon glyphicon-lock"></i>
<input>
</div>
<p class="sub-title"> PASSWORD </p>
<div class="inline-title-div">
<pre class="title title-inline"> REGISTER </pre>
</div>
</div>
</body>
</html>