Comparing version 2.5.0 to 2.6.0
@@ -19,3 +19,3 @@ #!/usr/bin/env node | ||
const { loadBytecodeModule, loadCSharpModule, loadJSV2Module, loadVoiceServer } = loadRuntimeConfig(); | ||
const { loadJSModule, loadBytecodeModule, loadCSharpModule, loadJSV2Module, loadVoiceServer } = loadRuntimeConfig(); | ||
@@ -132,4 +132,2 @@ function authorizeDiscord() { | ||
...sharedFiles, | ||
'modules/libjs-module.so': `https://${CDN_ADDRESS}/js-module/${branch}/${platform}/modules/js-module/libjs-module.so`, | ||
'libnode.so.108': `https://${CDN_ADDRESS}/js-module/${branch}/${platform}/modules/js-module/libnode.so.108`, | ||
'start.sh': `https://${CDN_ADDRESS}/others/start.sh`, | ||
@@ -143,7 +141,3 @@ }; | ||
const windowsFiles = { | ||
...sharedFiles, | ||
'modules/js-module.dll': `https://${CDN_ADDRESS}/js-module/${branch}/${platform}/modules/js-module/js-module.dll`, | ||
'libnode.dll': `https://${CDN_ADDRESS}/js-module/${branch}/${platform}/modules/js-module/libnode.dll`, | ||
}; | ||
const windowsFiles = { ...sharedFiles }; | ||
@@ -161,4 +155,3 @@ res = await axios.get(`https://${SERVER_CDN_ADDRESS}/server/${serverBranch}/x64_win32/update.json`, { responseType: 'json', headers }); | ||
...sharedUpdates, | ||
`https://${SERVER_CDN_ADDRESS}/server/${serverBranch}/x64_linux/update.json`, | ||
`https://${CDN_ADDRESS}/js-module/${branch}/x64_linux/update.json`, | ||
`https://${SERVER_CDN_ADDRESS}/server/${serverBranch}/x64_linux/update.json` | ||
]; | ||
@@ -168,6 +161,20 @@ | ||
...sharedUpdates, | ||
`https://${SERVER_CDN_ADDRESS}/server/${serverBranch}/x64_win32/update.json`, | ||
`https://${CDN_ADDRESS}/js-module/${branch}/x64_win32/update.json`, | ||
`https://${SERVER_CDN_ADDRESS}/server/${serverBranch}/x64_win32/update.json` | ||
]; | ||
if (loadJSModule) { | ||
res = await axios.get(`https://${CDN_ADDRESS}/js-module/${branch}/x64_linux/update.json`, { responseType: 'json', headers }); | ||
for ([file, hash] of Object.entries(res.data.hashList)) { | ||
linuxFiles[file] = `https://${CDN_ADDRESS}/js-module/${branch}/x64_linux/${file}`; | ||
} | ||
res = await axios.get(`https://${CDN_ADDRESS}/js-module/${branch}/x64_win32/update.json`, { responseType: 'json', headers }); | ||
for ([file, hash] of Object.entries(res.data.hashList)) { | ||
windowsFiles[file] = `https://${CDN_ADDRESS}/js-module/${branch}/x64_win32/${file}`; | ||
} | ||
linuxUpdates.push(`https://${CDN_ADDRESS}/js-module/${branch}/x64_linux/update.json`) | ||
windowsUpdates.push(`https://${CDN_ADDRESS}/js-module/${branch}/x64_win32/update.json`); | ||
} | ||
if (loadBytecodeModule) { | ||
@@ -255,2 +262,4 @@ res = await axios.get(`https://${CDN_ADDRESS}/js-bytecode-module/${branch}/x64_linux/update.json`, { responseType: 'json', headers }); | ||
let anyHashRejected = false; | ||
console.log(filesToUse[file]) | ||
for (const url of filesUpdate) { | ||
@@ -262,13 +271,13 @@ const promise = new Promise((resolve, reject) => { | ||
for (let [file, hash] of Object.entries(hashList)) { | ||
file = correctPathIfNecessary(file); | ||
const correctedFileName = correctPathIfNecessary(file); | ||
if (getLocalFileHash(file) === hash) { | ||
console.log(chalk.cyanBright('✓'), chalk.whiteBright(file)); | ||
if (getLocalFileHash(correctedFileName) === hash) { | ||
console.log(chalk.cyanBright('✓'), chalk.whiteBright(correctedFileName)); | ||
continue; | ||
} | ||
console.log(chalk.redBright('x'), chalk.whiteBright(file)); | ||
console.log(chalk.redBright('x'), chalk.whiteBright(correctedFileName)); | ||
if (anyHashRejected) return; | ||
filesToDownload[file] = filesToUse[file]; | ||
filesToDownload[correctedFileName] = filesToUse[file]; | ||
} | ||
@@ -354,2 +363,4 @@ | ||
function loadRuntimeConfig() { | ||
let loadJSModule = true; | ||
let loadBytecodeModule = false; | ||
@@ -364,2 +375,5 @@ let loadCSharpModule = false; | ||
if (typeof parsedData.loadJSModule !== 'undefined') | ||
loadJSModule = !!parsedData.loadJSModule; | ||
loadBytecodeModule = !!parsedData.loadBytecodeModule; | ||
@@ -373,5 +387,5 @@ loadCSharpModule = !!parsedData.loadCSharpModule; | ||
return { loadBytecodeModule, loadCSharpModule, loadJSV2Module, loadVoiceServer }; | ||
return { loadJSModule, loadBytecodeModule, loadCSharpModule, loadJSV2Module, loadVoiceServer }; | ||
} | ||
start(); |
{ | ||
"name": "altv-pkg", | ||
"version": "2.5.0", | ||
"version": "2.6.0", | ||
"description": "Install alt:V Binaries Quickly", | ||
@@ -5,0 +5,0 @@ "main": "bin/index.js", |
@@ -31,11 +31,14 @@ # altv-pkg | ||
**Note** The `loadVoiceServer` configuration allows you to include [external voice server](https://docs.altv.mp/articles/external_voice_server.html) when downloading binaries. | ||
**Note:** The `loadVoiceServer` configuration allows you to include [external voice server](https://docs.altv.mp/articles/external_voice_server.html) when downloading binaries. | ||
Below you'll find all available options for the `.altvpkgrc.json` file with their default values: | ||
``` | ||
{ | ||
"loadBytecodeModule": true, | ||
"loadCSharpModule": true, | ||
"loadJSV2Module": true, | ||
"loadVoiceServer": true | ||
"loadJSModule": true, | ||
"loadBytecodeModule": false, | ||
"loadCSharpModule": false, | ||
"loadJSV2Module": false, | ||
"loadVoiceServer": false | ||
} | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
52158
309
44