fix(cosmetics): deliver decal indexes in the local character pack

The client never downloads downloadable_decals.<hash>.blk: webdlcontent only looks
for it in its web cache folder (aces.exe 2.61.0.37 0xd3e710 -> 0xd3f610) and deletes
a file whose signature check fails (0xd383e0), so the index the local service served
never reached it and every decal was dropped for lack of a texture.

The build now stores dldata/downloadable_skins.blk and dldata/downloadable_decals.blk
in char.vromfs.bin. The client's vromfs index path (0xd3bc40 -> 0xd3cc60) loads both
without hash or signature checks and skips the download path. Each decal points at
a built-in decals.dxp.bin texture (star, or panther for wide decals) as placeholder;
the texture manager strips the "?options" suffix before the lookup (DagorEngine
TextureMetaData::decode), so the existing textures are used.

--decal-cache <folder> copies the cache/content folder of the player's online
installation into the game copy instead; the client then uses that signed index and
its cached textures, and falls back to the cached dldata_s.info because the local
service now answers the dldata hosts with 404. The service's index generation, the
content hash helper and the decal texture dataset are removed.

Checked: typecheck; client startup log shows 1598 decals registered from the vromfs index
with no missing textures.
This commit is contained in:
N0VAN0M4LY committed 2026-11-28 12:44:45 +08:00
1 parent 8e4d4b6ea3
commit 9ed92c33d4
10 files changed
+242 -407

No files matched your search

+19 -3
View File
@@ -4,11 +4,14 @@
*
* node packages/build/src/cli.ts --game <stock game folder> --out <game copy folder> --port <n>
* [--patches exe-patches] [--gui-patches gui-patches]
* [--native build/native] [--verbose]
* [--native build/native] [--decal-cache <folder>] [--verbose]
*
* Writes <out>/char.vromfs.bin, <out>/aces.vromfs.bin, <out>/gui.vromfs.bin, <out>/win64/aces.exe
* and the network hook library the patched executable loads (<out>/win64/wto_ws.dll from --native,
* built by native/wto-net/build.ps1, and its settings wto_ws.cfg). The stock folder is only read.
* --decal-cache names the cache/content folder of the player's online installation; it is copied
* to <out>/cache/content (decals/player-decal-cache.ts), otherwise char.vromfs.bin gets the
* placeholder decal index (decals/offline-decal-index.ts).
* The launcher will run the same steps at every launch, with the port the player chose.
*/
import { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
@@ -16,6 +19,7 @@ import { dirname, join } from 'node:path';
import { parseArgs } from 'node:util';
import { fileURLToPath } from 'node:url';
import { rebuildCharPack } from './char-pack.ts';
import { copyPlayerDecalCache, playerDecalCacheProblem } from './decals/player-decal-cache.ts';
import { patchExecutable } from './executable.ts';
import { assertWritableCopy, GAME_FILES } from './game-copy.ts';
import { rebuildGuiPack } from './gui-pack.ts';
@@ -36,15 +40,22 @@ function main(): number {
patches: { type: 'string', default: 'exe-patches' },
'gui-patches': { type: 'string' },
native: { type: 'string', default: join('build', 'native') },
'decal-cache': { type: 'string' },
verbose: { type: 'boolean', default: false },
},
});
if (!values.game || !values.out || !values.port) {
console.error('usage: cli.ts --game <stock game folder> --out <game copy folder> --port <n> [--patches exe-patches] [--gui-patches gui-patches] [--native build/native] [--verbose]');
console.error('usage: cli.ts --game <stock game folder> --out <game copy folder> --port <n> [--patches exe-patches] [--gui-patches gui-patches] [--native build/native] [--decal-cache <folder>] [--verbose]');
return 2;
}
assertWritableCopy(values.game, values.out);
const endpoint = localEndpoint(Number(values.port));
const decalCache = values['decal-cache'];
const decalCacheProblem = decalCache === undefined ? undefined : playerDecalCacheProblem(decalCache);
if (decalCacheProblem) {
console.error(`--decal-cache: ${decalCacheProblem}; nothing was written`);
return 1;
}
const hookLibraryPath = join(values.native, NETWORK_HOOK_LIBRARY);
if (!existsSync(hookLibraryPath)) {
console.error(`${hookLibraryPath} not found (build it with native/wto-net/build.ps1); nothing was written`);
@@ -59,7 +70,7 @@ function main(): number {
}
const stockCharPack = readFileSync(join(values.game, GAME_FILES.charPack));
const charPack = rebuildCharPack(stockCharPack, endpoint);
const charPack = rebuildCharPack(stockCharPack, endpoint, { placeholderDecals: decalCache === undefined });
console.log(`network.blk: ${charPack.network.addresses.length} address(es) now point to ${endpoint.host}:${endpoint.port}; ` +
`environments configured: ${charPack.network.environments.join(', ')}`);
if (values.verbose) {
@@ -67,6 +78,7 @@ function main(): number {
}
console.log(`game_settings.blk: features on for every player: ${charPack.features.join(', ') || '(already on)'}`);
console.log(`shop.blk: ${charPack.revealedVehicles} hidden vehicles shown in the tech tree`);
if (charPack.placeholderDecals !== undefined) console.log(`dldata: placeholder textures for ${charPack.placeholderDecals} decals`);
const packBundles = offlinePackBundleGuids(stockCharPack, STORE_TUNING_PATH);
const mainPack = rebuildMainPack(readFileSync(join(values.game, GAME_FILES.mainPack)), endpoint, packBundles);
@@ -85,6 +97,10 @@ function main(): number {
writeOutput(values.out, join(executableFolder, NETWORK_HOOK_LIBRARY), readFileSync(hookLibraryPath));
const settings = networkHookSettings(endpoint);
writeOutput(values.out, join(executableFolder, settings.name), settings.content);
if (decalCache !== undefined) {
const copied = copyPlayerDecalCache(decalCache, values.out);
console.log(`copied the player's web cache to ${copied.copiedTo} (decal indexes: ${copied.decalIndexes.join(', ')})`);
}
return 0;
}