Add persistent AFK reserves and recovery (Refs #151)
CI / checks (push) Successful in 7m7s

This commit is contained in:
2026-10-17 16:57:26 -04:00
parent 7f2205e9c4
commit d723f23d67
22 changed files with 2646 additions and 16 deletions
+22
View File
@@ -4,6 +4,25 @@ import { writable } from 'svelte/store';
import PlayerProfilePage from '../../src/routes/leaderboard/players/[guid]/+page.svelte';
import PlayerMapCards from '../../src/lib/ui/components/PlayerMapCards.svelte';
import type { PlayerMapRecord, PlayerProfile, RecordEvidence } from '../../src/lib/leaderboard.js';
import type { afkProfile } from '../../src/lib/server/fleet/afk.js';
const afk: ReturnType<typeof afkProfile> = {
freeSeconds: 0,
savedSeconds: 0,
availableSeconds: 0,
reservedSeconds: 0,
capacitySeconds: 21600,
freeRenewsAt: null,
activeSeconds: 0,
confirmedAfkSeconds: 0,
unresolvedSessions: 0,
expiredSessions: 0,
purchaseCount: 0,
purchasedSeconds: 0,
manualReturns: 0,
entries: [],
sessions: []
};
vi.mock('$app/stores', () => ({
page: writable({
@@ -91,6 +110,7 @@ it('shows the same ranks in the desktop profile with lifetime map scope explaine
props: {
data: {
profile,
afk,
bank: { balance: 0, available: 0, pending: false, entries: [] },
returnTo: '/leaderboard',
scope: { game: '', map: '', players: '2', metric: 'kills', entry: null }
@@ -136,6 +156,7 @@ it('renders a known player without qualifying history with identity and unavaila
props: {
data: {
profile,
afk,
bank: { balance: 0, available: 0, pending: false, entries: [] },
returnTo: '/leaderboard',
scope: { game: '', map: '', players: '', metric: 'highestRound', entry: null }
@@ -189,6 +210,7 @@ it('shows the shared balance and ledger with retained and expired match referenc
props: {
data: {
profile,
afk,
bank: {
balance: 1500,
available: 1000,