Recompute unlocked ranks, prerequisites, and unit states before serving profiles. Add research target selection, research conversion, vehicle and slot purchases, and the price table. Support editing convertible RP and restrict hidden vehicle visibility to eligible entries. The client still displays zero purchase prices pending price table integration.
13 lines
555 B
TypeScript
13 lines
555 B
TypeScript
/** Typed reads of a char request's BLK parameters; a missing or differently typed parameter reads as undefined. */
|
|
import { findParam, type BlkBlock } from '@wto/blk';
|
|
|
|
export function stringParam(payload: BlkBlock, name: string): string | undefined {
|
|
const value = findParam(payload, name)?.value;
|
|
return value?.type === 'string' ? value.value : undefined;
|
|
}
|
|
|
|
export function intParam(payload: BlkBlock, name: string): number | undefined {
|
|
const value = findParam(payload, name)?.value;
|
|
return value?.type === 'int' ? value.value : undefined;
|
|
}
|