Support currency and entitlement purchases, including packs, from the local store and the in-game payment flow. Expose the supported redemption codes.
28 lines
976 B
TypeScript
28 lines
976 B
TypeScript
/**
|
|
* Dataset: entitlement-to-GUID mappings from aces.vromfs.bin config/gui.blk bundles/guid
|
|
* (gui.vromfs.bin scripts/onlineShop/onlineBundles.nut, implementation notes).
|
|
*/
|
|
import { findBlock } from '@wto/blk';
|
|
import type { Dataset } from './dataset.ts';
|
|
|
|
const GUI_CONFIG = 'config/gui.blk';
|
|
|
|
/** Entitlement name -> store item GUID (upper-case UUID string). */
|
|
export type StoreBundleGuids = Readonly<Record<string, string>>;
|
|
|
|
export const storeBundles: Dataset<StoreBundleGuids> = {
|
|
id: 'store-bundles',
|
|
version: 1,
|
|
extract: (source) => {
|
|
const gui = source.readBlk('aces.vromfs.bin', GUI_CONFIG);
|
|
const guidBlock = findBlock(findBlock(gui, 'bundles') ?? { name: '', params: [], blocks: [] }, 'guid');
|
|
const result: Record<string, string> = {};
|
|
for (const param of guidBlock?.params ?? []) {
|
|
if (param.value.type === 'string' && param.value.value) {
|
|
result[param.name] = param.value.value;
|
|
}
|
|
}
|
|
return result;
|
|
},
|
|
};
|