✨ Add support for patchmanifest files
This commit is contained in:
parent
f80e34826c
commit
c83c3045bc
2 changed files with 24 additions and 4 deletions
|
@ -2,9 +2,17 @@ import getSolidpkg from './ssn/getSolidpkg';
|
||||||
import readSsnFile from './ssn/readSsnFile';
|
import readSsnFile from './ssn/readSsnFile';
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
const buffer = await getSolidpkg('assets_swtor_de_de', -1, 0);
|
//Read patchmanifest
|
||||||
console.log(buffer.length, buffer);
|
const patchmanifestBuffer = await getPatchmanifest('assets_swtor_de_de');
|
||||||
|
console.log(patchmanifestBuffer.length, patchmanifestBuffer);
|
||||||
|
|
||||||
const fileEntries = readSsnFile(buffer);
|
const patchmanifestFiles = readSsnFile(patchmanifestBuffer);
|
||||||
console.log(fileEntries);
|
console.log(patchmanifestFiles);
|
||||||
|
|
||||||
|
//Read solidpkg
|
||||||
|
const solidpkgBuffer = await getSolidpkg('assets_swtor_de_de', -1, 0);
|
||||||
|
console.log(solidpkgBuffer.length, solidpkgBuffer);
|
||||||
|
|
||||||
|
const solidPkgFiles = readSsnFile(solidpkgBuffer);
|
||||||
|
console.log(solidPkgFiles);
|
||||||
})();
|
})();
|
||||||
|
|
12
src/ssn/getPatchmanifest.ts
Normal file
12
src/ssn/getPatchmanifest.ts
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
import getUrlContents from '../getUrlContents';
|
||||||
|
import { Product } from '../interfaces/ISettings';
|
||||||
|
import verifyProductName from '../verifyProductName';
|
||||||
|
|
||||||
|
export default function getPatchmanifest(product: Product): Promise<Buffer> {
|
||||||
|
//Verify function arguments
|
||||||
|
if (!verifyProductName(product)) {
|
||||||
|
throw new Error(`"${product}" is not a valid product.`);
|
||||||
|
}
|
||||||
|
|
||||||
|
return getUrlContents({ host: 'manifest.swtor.com', path: `/patch/${product}.patchmanifest` });
|
||||||
|
}
|
Loading…
Reference in a new issue