Skip to content

Lobbies · Overview

14 modules · 73 exports · 2 repositories · 67 e2e tests · 3 routes

Lobbies are for playing 8s: a host makes a lobby for now or later, others sign up and check in, and the room plays best-of sets 4v4 with the teams reshuffled after every set. Unlike SendouQ nothing is matched across lobbies, everyone plays with the people of their lobby, and the lobby keeps its own ratings and rankings.

A lobby (Lobby) has a host and participants (LobbyParticipant) who are signed up, waitlisted, checked in or in the room: the players playing or spectating, up to the room size. Each set (LobbySet) is played by eight of the room split into ALPHA and BRAVO (LobbySetParticipant, whoever sits it out has no side), its maps being games (LobbyGame). When the room is short a ready check (LobbyReadyCheck) asks the waitlist who is ready to take the open spots. A lobby can require applying (isApplicationRequired): signing up then makes an application (LobbyApplication) instead, its applicant no participant until the host accepts it and signed up then as if they had signed up themselves. A declined application stays, keeping its applicant from applying again. Turning the option off accepts every pending application, in the order they came in. The rules are listed under Behaviour below, each with the tests that establish it.

stateDiagram-v2
[*] --> Upcoming: made on /lobbies/new
Upcoming --> CheckIn: 8 signed up, at most 10 minutes to the start
Upcoming --> Pending: start time, fewer than 8 signed up
CheckIn --> Pending: start time
Pending --> Active: 8 in the room, a set starts
Active --> Pending: set confirmed or forfeited, room short
Active --> Active: set confirmed, teams reshuffled
Pending --> Ended: idle for too long, or everyone left
Active --> Ended: idle for too long
Upcoming --> Ended: ended by the host
CheckIn --> Ended: ended by the host
Pending --> Ended: ended by the host
Active --> Ended: ended by the host
Ended --> [*]

The statuses are LobbyState.status. Nothing is stored about which one a lobby is in, it is derived from its start time, whether check-in is open, its latest set and whether it has ended. Check-in opens once 8 have signed up and the start is at most 10 minutes away (LobbyState.isCheckInOpen), so for a lobby past its start time it opens as the 8th signs up, who is checked in right away. Opening it stamps checkInOpenedAt and notifies the signed up, after which it stays open even if people leave. The room forms once 8 have checked in after the start time.

stateDiagram-v2
[*] --> Reporting: teams shuffled, maps generated
Reporting --> Reporting: a map reported or undone
Reporting --> AwaitingConfirmation: the deciding map reported
AwaitingConfirmation --> Disputed: the other side says it's wrong
AwaitingConfirmation --> Reporting: the reporting side undoes
Disputed --> Reporting: the reporting side undoes
AwaitingConfirmation --> Confirmed: the other side confirms, or a player leaves
Disputed --> Confirmed: the other side or the host confirms, or a player leaves
Reporting --> Forfeited: a player leaves, their side forfeits
Reporting --> [*]: a player leaves before any map is reported, the set is called off
Confirmed --> [*]
Forfeited --> [*]

A set’s maps (LobbyMapList.generate) are picked like SendouQ’s from the players’ match profile map preferences among the modes the host picked (ranked modes, Splat Zones only or every mode), each map remembering which side(s) voted for it. Or the host picks a map pool, a copy of a tournament’s or a custom one, whose maps are then played in plain rotation. Either way they continue from the maps already played in the lobby.

Only confirmed and forfeited sets count towards the lobby’s ratings (LobbyRating) and rankings (Leaderboard). The ratings are lobby-local, recomputed from the sets every time, and never touch the SendouQ ones.

Everything a lobby does on its own is decided in one place: LobbyTransition.next looks at the lobby’s state and returns the next change due (starting, filling the room, opening a ready check, starting a set, passing on the host, ending), and LobbyProgression.advance applies it and asks again until nothing is due. It runs after every action of the lobby page and from the Lobbies routine, so a lobby moves along even when nobody acts. Before a set starts TeamShuffle splits the room into teams, its top comment explains how. With a weapon randomizer on, WeaponRoll then rolls every player a weapon for the set, its top comment explains the balanced one, tuned on the dev-only /lobbies/weapon-roll-test page. The rankings’ weapons come from weapons reported by hand and from scanned scoreboards, whose rows only name in-game names: ScoreboardAttribution works out which player each row is over the lobby’s reshuffled sets, its top comment explains how.

Behaviour

The rules the e2e tests establish, from the JSDoc of their describes.

Signing up

Only a supporter can make a lobby, others sign up for it. Signing up reserves a spot, check-in opening once 8 have signed up and the start is at most 10 minutes away, with a notification to the signed up and the check-in button appearing on an open page as it does. A lobby made to start now opens check-in as the 8th signs up, who is checked in right away like everyone signing up after them. Checking in shows the room's pool and pass. Past the room size sign-ups go to the waitlist, the first on it taking a spot someone frees and being notified of it. When the lobby starts the waitlisted stay on the waitlist, unless someone with a spot didn't check in: then a waitlisted player checking in plays in their place.

Who can join

Signing up and making a lobby take a friend code, making one is for now only for an admin, and a user in SendouQ or present in another lobby can't check in to a lobby until they leave it.

Visibility

A lobby limited to an association is listed only to its members, its card marked as such, and its page is not found for others. Its host can still invite anyone with the lobby's invite link, which only they get, and change who sees it later on. A link-only lobby is listed to no one but its participants: others find it only through the link its host shares, and once signed up they find it without the link too. Everyone who can open it gets the link to share, and their address bar always shows it. Without the link others are told the lobby is invite only.

Lobby list

The lobby list splits lobbies into running and upcoming ones, opening on the tab of a lobby the viewer is in. A lobby can be joined and, before the viewer is in its room, left from its card.

Playing sets

The lobby starts once 8 have checked in after its start time, splitting the room into two teams for a set and notifying its players. The banner shows who voted for the map being played with their match profile map pool. One side reports the maps, can undo a report while the set is being played, and the other confirms the result, after which the set shows on the Result tab and counts on the Rankings tab together with the weapons reported, the Rankings then also offering a head-to-head view of the players who have played. The confirming side can instead dispute the result, the reporting side then undoing their report or the host settling it by confirming the result or undoing the report, whichever side they're on.

Between sets

After a confirmed set the next one starts right away with the teams reshuffled, nobody keeping all of their teammates. In a room bigger than 8 the extra players sit a set out, rotating in for the next one. When the room is short of 8 the waitlist is asked, with a notification, who is ready to take the open spot, and confirming fills it. The first on the waitlist has priority on the spot for 3 minutes, others confirming before them waiting, without the room's pool and pass. Once the priority runs out the spot goes to whoever confirms first. Signing up while a spot is open counts as confirming.

Leaving

Leaving mid-set forfeits it for the leaver's team once a map has been reported, whatever the score: the set shows as won by forfeit and counts as a set win and loss on the Rankings, the room left short of players. Leaving before any map is reported calls the set off, nobody losing it. A player can instead ask to leave once the set is confirmed, leaving the lobby then. Asking to is told in the lobby's chat and marked on the Rosters tab, the mark explaining itself when clicked. Changing their mind is told in the chat too, after which they can't ask to leave again for a while.

Hosting

The host kicks participants, who are told so and can't sign up for the lobby again, a player kicked mid-set forfeiting it for their team. The host also sits players of the room out of the sets until resumed, changes the best of from the next set on and ends the lobby. The host can hand hosting over to another participant, which the lobby's chat tells everyone. When the host leaves, the participant who signed up the earliest becomes the host and is notified of it.

Applying

A host can make a lobby require applying to join it, when making it or later. Signing up then sends the host an application instead, the applicant taking no spot until the host accepts it, which signs them up like signing up would and notifies them. An applicant can withdraw their application, one the host declines can't apply again. Turning the option off accepts everyone still waiting.

Weapon randomizer

The host picks a weapon randomizer when making the lobby or between sets. When a set starts it rolls 4 weapons for each team, its players deciding who plays which: chaotic any weapons, balanced ones that even out the teams.

Map pool

The sets' maps are picked from the players' preferences in the modes the host picks, unless the host picks a map pool instead, when making the lobby or between sets: a tournament's or a custom one. Its sets are then played on its maps in plain rotation, so nobody is shown as having voted for them.

Chat

The lobby's chat is shared by everyone in it and stays with players who leave after playing a set, only a kick takes it away. While a set is played its two teams also get a chat of their own, fresh for every set.

Voice

A player of a set has the lobby's chat and their team's, each with a voice call. When a set starts a call in the team's chat follows the player to their team of the new set, one in the lobby's chat stays put, and a player sitting the set out is dropped from their team's call. Leaving the lobby ends the player's call.

Closing

A started lobby closes on its own after 2 hours waiting for players or 2 hours without a map reported, moving to the Ended tab of its players' lobby list. It also ends when everyone has left after the start.

Routes

0 of 3 pages rendered by an e2e test in the last pnpm run docs:capture.

PathKindDataE2E tests
/lobbiespage, loader
12 tables
none
/lobbies/newpage, loader, action
50 tables · 17 written
Action
none
/lobbies/:idpage, loader, action
70 tables · 22 written
Loader
Action
none