2018-06-22 15:56:51 +02:00
|
|
|
import { TextDecoder } from 'util';
|
|
|
|
import extractFile from './ssn/extractFile';
|
2018-06-22 13:35:25 +02:00
|
|
|
import getPatchmanifest from './ssn/getPatchmanifest';
|
2018-06-21 23:06:34 +02:00
|
|
|
import getSolidpkg from './ssn/getSolidpkg';
|
2018-06-22 13:13:09 +02:00
|
|
|
import readSsnFile from './ssn/readSsnFile';
|
2018-06-21 21:26:29 +02:00
|
|
|
|
2018-06-22 15:56:51 +02:00
|
|
|
const Decoder = new TextDecoder('utf-8');
|
|
|
|
|
2018-06-21 21:26:29 +02:00
|
|
|
(async () => {
|
2018-06-22 13:43:17 +02:00
|
|
|
//----- PATCHMANIFEST -----
|
|
|
|
//.patchmanifest files contain a single XML file called "manifest.xml"
|
2018-06-22 13:34:36 +02:00
|
|
|
const patchmanifestBuffer = await getPatchmanifest('assets_swtor_de_de');
|
|
|
|
console.log(patchmanifestBuffer.length, patchmanifestBuffer);
|
2018-06-21 22:39:15 +02:00
|
|
|
|
2018-06-22 13:34:36 +02:00
|
|
|
const patchmanifestFiles = readSsnFile(patchmanifestBuffer);
|
|
|
|
console.log(patchmanifestFiles);
|
|
|
|
|
2018-06-22 15:56:51 +02:00
|
|
|
const patchmanifestFile = extractFile(patchmanifestFiles[0], [new DataView(patchmanifestBuffer.buffer)]);
|
|
|
|
const patchmanifestXml = Decoder.decode(patchmanifestFile);
|
|
|
|
console.log(patchmanifestXml);
|
|
|
|
|
2018-06-22 13:43:17 +02:00
|
|
|
//----- SOLIDPKG -----
|
|
|
|
//.solidpkg files contain a single Bencode file called "metafile.solid"
|
2018-06-22 13:34:36 +02:00
|
|
|
const solidpkgBuffer = await getSolidpkg('assets_swtor_de_de', -1, 0);
|
|
|
|
console.log(solidpkgBuffer.length, solidpkgBuffer);
|
|
|
|
|
|
|
|
const solidPkgFiles = readSsnFile(solidpkgBuffer);
|
|
|
|
console.log(solidPkgFiles);
|
2018-06-21 21:26:29 +02:00
|
|
|
})();
|