v1.0.4 - Logic cleanup, minor bug fixes.

Removed the old workaround logic for queueing archives for extraction.
Removed the old forge callback (this was replaced a while ago).
Fixed a typo in _parseDistroModules (getType).
Use discordrpc straight from the repository. The author has refused to push the bugfix for nearly a month.
Fix timestamp issue on discord rich presence.
Dependency upgrades.
This commit is contained in:
Daniel Scalzi 2018-10-31 01:25:38 -04:00
parent 96d08955a4
commit ce86840a87
No known key found for this signature in database
GPG Key ID: 5CA2F145B63535F9
4 changed files with 46 additions and 97 deletions

View File

@ -1282,14 +1282,6 @@ class AssetGuard extends EventEmitter {
const self = this
return new Promise((resolve, reject) => {
self.forge = self._parseDistroModules(server.getModules(), server.getMinecraftVersion(), server.getID())
// Correct our workaround here.
let decompressqueue = self.forge.callback
self.extractQueue = decompressqueue
self.forge.callback = (asset, self) => {
if(asset.type === DistroManager.Types.ForgeHosted || asset.type === DistroManager.Types.Forge){
AssetGuard._finalizeForgeAsset(asset, self.commonPath).catch(err => console.log(err))
}
}
resolve(server)
})
}
@ -1297,29 +1289,25 @@ class AssetGuard extends EventEmitter {
_parseDistroModules(modules, version, servid){
let alist = []
let asize = 0
let decompressqueue = []
for(let ob of modules){
let obType = ob.getType
let obArtifact = ob.getArtifact()
let obPath = obArtifact.getPath()
let artifact = new DistroModule(ob.getIdentifier(), obArtifact.getHash(), obArtifact.getSize(), obArtifact.getURL(), obPath, obType)
let artifact = new DistroModule(ob.getIdentifier(), obArtifact.getHash(), obArtifact.getSize(), obArtifact.getURL(), obPath, ob.getType())
const validationPath = obPath.toLowerCase().endsWith('.pack.xz') ? obPath.substring(0, obPath.toLowerCase().lastIndexOf('.pack.xz')) : obPath
if(!AssetGuard._validateLocal(validationPath, 'MD5', artifact.hash)){
asize += artifact.size*1
alist.push(artifact)
if(validationPath !== obPath) decompressqueue.push(obPath)
if(validationPath !== obPath) this.extractQueue.push(obPath)
}
//Recursively process the submodules then combine the results.
if(ob.getSubModules() != null){
let dltrack = this._parseDistroModules(ob.getSubModules(), version, servid)
asize += dltrack.dlsize*1
alist = alist.concat(dltrack.dlqueue)
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)
return new DLTracker(alist, asize)
}
/**

View File

@ -16,7 +16,7 @@ exports.initRPC = function(genSettings, servSettings, initialDetails = 'Waiting
largeImageText: servSettings.largeImageText,
smallImageKey: genSettings.smallImageKey,
smallImageText: genSettings.smallImageText,
startTimestamp: new Date().getTime() / 1000,
startTimestamp: new Date().getTime(),
instance: false
}

115
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "westeroscraftlauncher",
"version": "1.0.3",
"version": "1.0.4",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@ -134,28 +134,28 @@
}
},
"app-builder-bin": {
"version": "2.1.4",
"resolved": "https://registry.npmjs.org/app-builder-bin/-/app-builder-bin-2.1.4.tgz",
"integrity": "sha512-i5ZfZtnAQqVZXpFYpvkQK/V0p9RwJjCW7X3CRcyDrnR3p1mQRoRTMSfPrtGTo1ens7kTfzk2S2i0QXq+gEplLg==",
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/app-builder-bin/-/app-builder-bin-2.2.0.tgz",
"integrity": "sha512-ckiG/zWjmCN6dtzOtx4g0Bno9qFlQFViwGoWKNNLUMRM33Fsq2fsSOMbK2JpqPJfAcPJOXPzoB2kcuUuIbIwwA==",
"dev": true
},
"app-builder-lib": {
"version": "20.29.1",
"resolved": "https://registry.npmjs.org/app-builder-lib/-/app-builder-lib-20.29.1.tgz",
"integrity": "sha512-kezGeVlOrw9d/0N1522TTEDLGxn566bDxufQI9vmBOXLWKQilXxLNQkxpktWk8HifsYr0o62Ou2sS+uMCIsErg==",
"version": "20.30.0",
"resolved": "https://registry.npmjs.org/app-builder-lib/-/app-builder-lib-20.30.0.tgz",
"integrity": "sha512-bN6rrjZiXOlr6H/4NEv81Nm3K/e5xAewQgSB48pVfCN2nyppY+gV+tc6X82HFN9FVwPwFgcuRKDKP1wfOVjqkA==",
"dev": true,
"requires": {
"7zip-bin": "~4.0.2",
"app-builder-bin": "2.1.4",
"app-builder-bin": "2.2.0",
"async-exit-hook": "^2.0.1",
"bluebird-lst": "^1.0.5",
"builder-util": "7.0.0",
"builder-util": "7.1.0",
"builder-util-runtime": "5.0.0",
"chromium-pickle-js": "^0.2.0",
"debug": "^4.1.0",
"ejs": "^2.6.1",
"electron-osx-sign": "0.4.11",
"electron-publish": "20.29.0",
"electron-publish": "20.30.0",
"fs-extra-p": "^4.6.1",
"hosted-git-info": "^2.7.1",
"is-ci": "^1.2.1",
@ -329,9 +329,9 @@
}
},
"bluebird": {
"version": "3.5.1",
"resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.1.tgz",
"integrity": "sha512-MKiLiV+I1AA596t9w1sQJ8jkiSr5+ZKi0WKrYGUn6d1Fx+Ij4tIj+m2WMQSGczs5jZVxV339chE8iwk6F64wjA=="
"version": "3.5.2",
"resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.2.tgz",
"integrity": "sha512-dhHTWMI7kMx5whMQntl7Vr9C6BvV10lFXDAasnqnrMYhXVCzzk6IO9Fo2L75jXHT07WrOngL1WDXOp+yYS91Yg=="
},
"bluebird-lst": {
"version": "1.0.5",
@ -429,13 +429,13 @@
"integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A=="
},
"builder-util": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/builder-util/-/builder-util-7.0.0.tgz",
"integrity": "sha512-GnszunK4uX1F8XP4U01m47VME0UQo97wM1i8h77j6+7V0xMz8faL9BHdv2O8/iOZ8HjfKSRJ+1v7RHohF6H0lA==",
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/builder-util/-/builder-util-7.1.0.tgz",
"integrity": "sha512-PinqkXepVFsJ8S07o1ECiY40L/chcnSvp+C9eCnYi25BfqgNYdL5LApRtM7DgTtSw+CjXClCof+SwJuHuSbhxw==",
"dev": true,
"requires": {
"7zip-bin": "~4.0.2",
"app-builder-bin": "2.1.4",
"app-builder-bin": "2.2.0",
"bluebird-lst": "^1.0.5",
"builder-util-runtime": "^5.0.0",
"chalk": "^2.4.1",
@ -471,7 +471,6 @@
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/builder-util-runtime/-/builder-util-runtime-5.0.0.tgz",
"integrity": "sha512-mTyLqmzdPzavKQNAfxcGu6kqaDiPCtFKJG+nNO9SYfL6lY7VgTUW+45iXhowc5ElmPj0eSTDaIGlScxVMwFUEA==",
"dev": true,
"requires": {
"bluebird-lst": "^1.0.5",
"debug": "^4.1.0",
@ -483,7 +482,6 @@
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.1.0.tgz",
"integrity": "sha512-heNPJUJIqC+xB6ayLAMHaIrmN9HKa7aQO8MGqKpvCA+uJYVcvR6l5kgdrhRuwPFHU7P5/A1w0BjByPHwpfTDKg==",
"dev": true,
"requires": {
"ms": "^2.1.1"
}
@ -491,8 +489,7 @@
"ms": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz",
"integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==",
"dev": true
"integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg=="
}
}
},
@ -848,23 +845,22 @@
"integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk="
},
"discord-rpc": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/discord-rpc/-/discord-rpc-3.0.1.tgz",
"integrity": "sha512-PvkVpIlbFowih2mPIOAwUlX+w+9AGtpVUpQrGP6Mu7TPHDjfclsYoRuquIYiSHsS/n5EfhFgMZfsSTRPkvj22w==",
"version": "github:discordjs/RPC#a80e457d3aa9969a6134693ca2102ffc731ebc04",
"from": "github:discordjs/RPC",
"requires": {
"node-fetch": "^2.1.2",
"ws": "^5.2.1"
}
},
"dmg-builder": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/dmg-builder/-/dmg-builder-6.0.0.tgz",
"integrity": "sha512-nGeCoIctKP48QhohyQ6Uxx754XKyfVa5nx8YK6STIxTXoGTDWR/dwy8m4iCkM77//sd2wMdP9KYsUDuPxtbpLA==",
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/dmg-builder/-/dmg-builder-6.0.1.tgz",
"integrity": "sha512-eSQprMrMl/zTAVvVdlRSQnAL/g2PdNV8CPj8/Ymc6OGDYH2RbTIz5gvW0llTblPO6D3blniOkHdbabqpF7X+2g==",
"dev": true,
"requires": {
"app-builder-lib": "~20.29.0",
"app-builder-lib": "~20.30.0",
"bluebird-lst": "^1.0.5",
"builder-util": "~7.0.0",
"builder-util": "~7.1.0",
"fs-extra-p": "^4.6.1",
"iconv-lite": "^0.4.24",
"js-yaml": "^3.12.0",
@ -944,17 +940,17 @@
}
},
"electron-builder": {
"version": "20.29.1",
"resolved": "https://registry.npmjs.org/electron-builder/-/electron-builder-20.29.1.tgz",
"integrity": "sha512-1zTxA2v++G96mj02yUXA4XST/1320CcDD3bOnF/kTXJ44ai4IJ+UqWxI8dETO3e0xbZXYBz/9D+JqPBQWGKVvA==",
"version": "20.30.0",
"resolved": "https://registry.npmjs.org/electron-builder/-/electron-builder-20.30.0.tgz",
"integrity": "sha512-ujdQN0AMAAVRw3+DUY2vIvHn9NDw6ZQN+tXOw60a1KqKk7d6FNNdoQW4hF5OnT9njauPRVxnrL98djkriNa5aA==",
"dev": true,
"requires": {
"app-builder-lib": "20.29.1",
"app-builder-lib": "20.30.0",
"bluebird-lst": "^1.0.5",
"builder-util": "7.0.0",
"builder-util": "7.1.0",
"builder-util-runtime": "5.0.0",
"chalk": "^2.4.1",
"dmg-builder": "6.0.0",
"dmg-builder": "6.0.1",
"fs-extra-p": "^4.6.1",
"is-ci": "^1.2.1",
"lazy-val": "^1.0.3",
@ -1018,13 +1014,13 @@
}
},
"electron-publish": {
"version": "20.29.0",
"resolved": "https://registry.npmjs.org/electron-publish/-/electron-publish-20.29.0.tgz",
"integrity": "sha512-Kc5u5YaJLcGWPrp3bFk8NdrYk5gNVG4lZqbAIZnYNPuOLMCNgUk4UqrONO6iuAE6x/vWOoovszf1gGIT7G01UA==",
"version": "20.30.0",
"resolved": "https://registry.npmjs.org/electron-publish/-/electron-publish-20.30.0.tgz",
"integrity": "sha512-qGLpRnKF/6pMm135FH3aI+DSuqEozXg4xI1ZmlLWHuAEV4+L5xn10hMuXDwRdG/DYj+iGzLM2gg0lQ9AHYWCbQ==",
"dev": true,
"requires": {
"bluebird-lst": "^1.0.5",
"builder-util": "~7.0.0",
"builder-util": "~7.1.0",
"builder-util-runtime": "^5.0.0",
"chalk": "^2.4.1",
"fs-extra-p": "^4.6.1",
@ -1033,9 +1029,9 @@
}
},
"electron-updater": {
"version": "3.1.5",
"resolved": "https://registry.npmjs.org/electron-updater/-/electron-updater-3.1.5.tgz",
"integrity": "sha512-xZPTExO2q8FjgetiBcmRDY3KgYbo+B2vAsblElR7ygdwdXmY5RtEymNdCmZr0/HSRnd3v2POCx77CASnSZxBWA==",
"version": "3.1.6",
"resolved": "https://registry.npmjs.org/electron-updater/-/electron-updater-3.1.6.tgz",
"integrity": "sha512-ZzNrFqvJJmG2O0qEVhAhI25WqJx6Nq3lNlXvBvX3i0zqWtAuSmcAdCbq4VyDymun/glsZ4bD3ZzATcIk3sYygg==",
"requires": {
"bluebird-lst": "^1.0.5",
"builder-util-runtime": "~5.0.0",
@ -1046,32 +1042,6 @@
"lodash.isequal": "^4.5.0",
"semver": "^5.6.0",
"source-map-support": "^0.5.9"
},
"dependencies": {
"builder-util-runtime": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/builder-util-runtime/-/builder-util-runtime-5.0.0.tgz",
"integrity": "sha512-mTyLqmzdPzavKQNAfxcGu6kqaDiPCtFKJG+nNO9SYfL6lY7VgTUW+45iXhowc5ElmPj0eSTDaIGlScxVMwFUEA==",
"requires": {
"bluebird-lst": "^1.0.5",
"debug": "^4.1.0",
"fs-extra-p": "^4.6.1",
"sax": "^1.2.4"
}
},
"debug": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.1.0.tgz",
"integrity": "sha512-heNPJUJIqC+xB6ayLAMHaIrmN9HKa7aQO8MGqKpvCA+uJYVcvR6l5kgdrhRuwPFHU7P5/A1w0BjByPHwpfTDKg==",
"requires": {
"ms": "^2.1.1"
}
},
"ms": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz",
"integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg=="
}
}
},
"end-of-stream": {
@ -1460,14 +1430,6 @@
"jsonfile": "^4.0.0",
"universalify": "^0.1.0"
}
},
"jsonfile": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz",
"integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=",
"requires": {
"graceful-fs": "^4.1.6"
}
}
}
},
@ -1946,7 +1908,6 @@
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz",
"integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=",
"dev": true,
"requires": {
"graceful-fs": "^4.1.6"
}

View File

@ -1,6 +1,6 @@
{
"name": "westeroscraftlauncher",
"version": "1.0.3",
"version": "1.0.4",
"description": "Custom modded launcher for Westeroscraft",
"productName": "WesterosCraft Launcher",
"main": "index.js",
@ -33,10 +33,10 @@
"dependencies": {
"adm-zip": "^0.4.11",
"async": "^2.6.1",
"discord-rpc": "^3.0.1",
"discord-rpc": "discordjs/RPC",
"ejs": "^2.6.1",
"ejs-electron": "^2.0.3",
"electron-updater": "^3.1.5",
"electron-updater": "^3.1.6",
"github-syntax-dark": "^0.5.0",
"jquery": "^3.3.1",
"mkdirp": "^0.5.1",
@ -49,7 +49,7 @@
},
"devDependencies": {
"electron": "^3.0.6",
"electron-builder": "^20.29.1",
"electron-builder": "^20.30.0",
"eslint": "^5.8.0"
},
"build": {