Files
kickkingsapi/types.ts
T
2026-04-04 18:43:36 +00:00

54 lines
1.7 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
export interface Settings {
port: number;
password: string;
minimum_players: number;
maximum_players: number;
waiting_time: number;
port_range_min: number;
port_range_max: number;
games: {
name: string;
exe: string;
}[];
log_level: number;
/** Supabase project URL (Settings → API) */
supabase_url?: string;
/** Service role key — server only; never ship to Unity or clients */
supabase_service_role_key?: string;
/** Secret used to sign session tokens returned to Unity */
auth_jwt_secret?: string;
/**
* When true, POST /auth/purchase-rc adds RC from a named pack without validating a store receipt.
* Set false when real in-app purchase verification is wired up.
*/
iap_dummy_mode?: boolean;
/** Secret for dedicated game server only: PATCH /internal/match/:matchId and .../winner */
dedicated_server_secret?: string;
}
export interface Player {
Name: string;
LastSeen: number;
/** Authenticated user id (matches public.users.id); first in room = red, second = blue */
UserId: number;
/** From latest 10 `matches` rows where user is red or blue; win if winner_id === UserId */
l10_wins: number;
l10_losses: number;
}
export interface Room {
Players: Player[];
GameName: string;
Port: number;
InitTime: number;
/** Row id in public.matches; game server uses this with X-Dedicated-Server-Secret */
match_id?: number;
/** Only on GET / responses: authenticated users team (Players[0]=red, Players[1]=blue) */
your_team?: 'red' | 'blue' | null;
}
export interface QueueEntry {
Name: string;
LastSeen: number;
UserId: number;
}