💡 Code cleanup

This commit is contained in:
C-3PO 2018-06-22 13:43:17 +02:00
parent 1172d34a2b
commit 4aeba1709a
Signed by: c3po
GPG key ID: 62993C4BB4D86F24
2 changed files with 4 additions and 3 deletions

View file

@ -3,14 +3,16 @@ import getSolidpkg from './ssn/getSolidpkg';
import readSsnFile from './ssn/readSsnFile'; import readSsnFile from './ssn/readSsnFile';
(async () => { (async () => {
//Read patchmanifest //----- PATCHMANIFEST -----
//.patchmanifest files contain a single XML file called "manifest.xml"
const patchmanifestBuffer = await getPatchmanifest('assets_swtor_de_de'); const patchmanifestBuffer = await getPatchmanifest('assets_swtor_de_de');
console.log(patchmanifestBuffer.length, patchmanifestBuffer); console.log(patchmanifestBuffer.length, patchmanifestBuffer);
const patchmanifestFiles = readSsnFile(patchmanifestBuffer); const patchmanifestFiles = readSsnFile(patchmanifestBuffer);
console.log(patchmanifestFiles); console.log(patchmanifestFiles);
//Read solidpkg //----- SOLIDPKG -----
//.solidpkg files contain a single Bencode file called "metafile.solid"
const solidpkgBuffer = await getSolidpkg('assets_swtor_de_de', -1, 0); const solidpkgBuffer = await getSolidpkg('assets_swtor_de_de', -1, 0);
console.log(solidpkgBuffer.length, solidpkgBuffer); console.log(solidpkgBuffer.length, solidpkgBuffer);

View file

@ -119,7 +119,6 @@ export default function readSsnFile(buffer: Buffer): ISsnFileEntry[] {
if (fieldLength > 120) { if (fieldLength > 120) {
throw new Error(`Password is too long, it should be 120 characters at most but it is ${fieldLength} characters long.`); throw new Error(`Password is too long, it should be 120 characters at most but it is ${fieldLength} characters long.`);
} }
const passwordLength = fieldLength;
encodedPassword = new Uint8Array(arrayBuffer, pos, fieldLength); encodedPassword = new Uint8Array(arrayBuffer, pos, fieldLength);
break; break;
} }