/** * Timed access to a place you pay to be inside. * * Deliberately generic rather than a Trout Fishery special case: the fishery is * the first user, but the shape here (buy blocks of minutes, a balance that * only burns down while you are actually online, and a forced exit at zero) is * meant to carry the next paid area without being rewritten. * * The balance is stored as MILLISECONDS REMAINING, not as an expiry timestamp. * That is the whole reason it can be online-only: a wall-clock deadline keeps * running while a character is logged off, so an hour bought at bedtime would * be gone by morning. Remaining time is decremented by the server tick, and the * tick only runs for connected players. */ export type TimedAreaId = 'trout-fishery'; export type TimedAreaDef = { id: TimedAreaId; label: string; /** Gold charged per block of time. */ pricePerBlock: number; /** Minutes granted per block. */ minutesPerBlock: number; /** Most blocks buyable in one purchase. */ maxBlocks: number; }; export declare const TIMED_AREAS: Record; export declare function timedAreaDef(area: TimedAreaId): TimedAreaDef; export declare function isTimedAreaId(value: unknown): value is TimedAreaId; /** One purchasable option, e.g. 45 minutes for 6000 gold. */ export type TimedAccessOption = { blocks: number; minutes: number; price: number; }; export declare function timedAccessOptions(area: TimedAreaId): TimedAccessOption[]; /** * A character's remaining time inside a paid area. * * One record per character, not one per area: you can only be inside one paid * place at a time, and keeping it single makes "what is my timer showing" * unambiguous for the HUD. */ export type TimedAccess = { area: TimedAreaId; msRemaining: number; }; /** Hard ceiling so a corrupt or hostile value cannot mint unlimited time. */ export declare function timedAccessMaxMs(area: TimedAreaId): number; export declare function normalizeTimedAccess(raw: unknown): TimedAccess | null; /** Below this the HUD counts in red and the client warns once. */ export declare const TIMED_ACCESS_WARN_MS = 60000; /** * How often the server corrects the client's clock. The HUD counts down locally * in between, so this is a correction rather than a tick - a per-second message * per player standing in the fishery would be pure waste. */ export declare const TIMED_ACCESS_PUSH_MS = 15000; /** How long the fade-to-black on expiry runs, both ends. Shared so the server * can hold the player still for exactly as long as the client is blacked out. */ export declare const TIMED_ACCESS_FADE_MS = 900; export declare function formatTimeRemaining(ms: number): string; //# sourceMappingURL=timedAccess.d.ts.map