feat(profile): support first-run selection and tutorial skipping

Save the selected country, starting crew, and unlocks when the client
submits its first-run selection. Use the stock unlock and crew formats.
Enable the existing option to skip the basic tutorial.

The client reached the hangar. Tutorial verification is pending.
This commit is contained in:
N0VAN0M4LY committed 2026-11-24 10:01:47 +08:00
1 parent ac2c185d4c
commit d88aa3ff4f
8 files changed
+227 -10

No files matched your search

+15 -4
View File
@@ -1,16 +1,27 @@
/** Rebuild char.vromfs.bin with config/network.blk pointed at the local service. */
/**
* Rebuild char.vromfs.bin: config/network.blk pointed at the local service, and the offline
* version's features turned on in config/game_settings.blk.
*/
import { enableFeaturesForEveryone, GAME_SETTINGS_PATH, OFFLINE_FEATURES } from './features/offline-features.ts';
import type { LocalEndpoint } from './network/local-endpoint.ts';
import { redirectNetworkConfig, type NetworkRedirectReport } from './network/redirect-network-config.ts';
import { editPackBlk } from './pack-edit.ts';
import { editPackBlks } from './pack-edit.ts';
export const NETWORK_CONFIG_PATH = 'config/network.blk';
export interface CharPackResult {
readonly pack: Uint8Array;
readonly network: NetworkRedirectReport;
/** Features that are now on for every player. */
readonly features: readonly string[];
}
export function rebuildCharPack(stockPack: Uint8Array, endpoint: LocalEndpoint): CharPackResult {
const { pack, report } = editPackBlk(stockPack, NETWORK_CONFIG_PATH, (root) => redirectNetworkConfig(root, endpoint));
return { pack, network: report };
let network: NetworkRedirectReport | undefined;
let features: string[] = [];
const pack = editPackBlks(stockPack, [
{ path: NETWORK_CONFIG_PATH, edit: (root) => { network = redirectNetworkConfig(root, endpoint); } },
{ path: GAME_SETTINGS_PATH, edit: (root) => { features = enableFeaturesForEveryone(root, OFFLINE_FEATURES); } },
]);
return { pack, network: network!, features };
}