Skip to content

five-on-it / apps/api/src/matchmaking / Matchmaker

Class: Matchmaker ​

Defined in: apps/api/src/matchmaking.ts:59

Quick play: the playlists, and placing a player by one.

Constructors ​

Constructor ​

new Matchmaker(deps): Matchmaker

Defined in: apps/api/src/matchmaking.ts:65

Parameters ​

deps ​

MatchmakerDeps

Returns ​

Matchmaker

Methods ​

place() ​

place(account, playlist): Promise<{ canStart: boolean; countdown: { seconds: number; waiting: boolean; } | null; game: { by: string; curated: boolean; id: string; level: string; rating: { average: number; count: number; }; title: string; }; host: string | null; id: string; join?: { joinUrl: string; room: string; run: string; }; max: number; mission: { blurb: string | null; id: string; rules: { each: boolean; friendlyFire: boolean; joinInProgress: "never" | "untilCheckpoint" | "always"; lives: { count: number; per: "player" | "team"; } | null; mode: "solo" | "coop" | "versus"; onDeath: "checkpoint" | "spectate" | "teamSpawn"; players: { max: number; min: number; }; respect: number | null; retries: number; teams: object[]; timeLimit: number | null; }; title: string; }; notice: { code: "busy" | "gaveUp" | "refused" | "inRun"; text: string; } | null; players: number; playlist?: "any" | "coop" | "versus" | "races" | null; results: { forfeit: boolean; mission: string; outcome: "complete" | "failed" | "abandoned" | "won" | "draw" | "lost"; run: string | null; seats: object[]; seconds: number | null; title: string; winner: string | null; winnerName: string | null; } | null; run: string | null; state: "gathering" | "countdown" | "running" | "ready" | "results"; teams: object[]; visibility: "private" | "public"; vote: { endsIn: number; mine: "level" | "game" | "same" | "replay" | null; offers: object[]; } | null; you: string | null; }>

Defined in: apps/api/src/matchmaking.ts:85

Places an account (its party with it, when it leads one, but those held in a run or in another lobby counting down or voting, who are invited instead) by a playlist: in the fullest public lobby of the playlist's missions that takes the group (none of it kicked, every one admitted, room on one team), trying the next when one refuses; else in a seat of a lobby's run under way of the playlist (its answer's join the way there); else in a new public lobby on the playlist's next mission taking them, which remembers the playlist. Refused to a party's member who does not lead it, and when no mission of the playlist takes them.

Parameters ​

account ​

Account

playlist ​

"any" | "coop" | "versus" | "races"

Returns ​

Promise<{ canStart: boolean; countdown: { seconds: number; waiting: boolean; } | null; game: { by: string; curated: boolean; id: string; level: string; rating: { average: number; count: number; }; title: string; }; host: string | null; id: string; join?: { joinUrl: string; room: string; run: string; }; max: number; mission: { blurb: string | null; id: string; rules: { each: boolean; friendlyFire: boolean; joinInProgress: "never" | "untilCheckpoint" | "always"; lives: { count: number; per: "player" | "team"; } | null; mode: "solo" | "coop" | "versus"; onDeath: "checkpoint" | "spectate" | "teamSpawn"; players: { max: number; min: number; }; respect: number | null; retries: number; teams: object[]; timeLimit: number | null; }; title: string; }; notice: { code: "busy" | "gaveUp" | "refused" | "inRun"; text: string; } | null; players: number; playlist?: "any" | "coop" | "versus" | "races" | null; results: { forfeit: boolean; mission: string; outcome: "complete" | "failed" | "abandoned" | "won" | "draw" | "lost"; run: string | null; seats: object[]; seconds: number | null; title: string; winner: string | null; winnerName: string | null; } | null; run: string | null; state: "gathering" | "countdown" | "running" | "ready" | "results"; teams: object[]; visibility: "private" | "public"; vote: { endsIn: number; mine: "level" | "game" | "same" | "replay" | null; offers: object[]; } | null; you: string | null; }>


playlist() ​

playlist(playlist?): Promise<CatalogMission[]>

Defined in: apps/api/src/matchmaking.ts:71

A playlist's missions (Any by default), in its rotation across levels.

Parameters ​

playlist? ​

"any" | "coop" | "versus" | "races"

Returns ​

Promise<CatalogMission[]>