Skip to content

Add atomic quick-join for public lobbies - #407

Merged
erikdubbelboer merged 3 commits into
mainfrom
quickJoin
Oct 29, 2026
Merged

erikdubbelboer merged 3 commits into
mainfrom
quickJoin

Conversation

@erikdubbelboer

Copy link
Copy Markdown
Member

Add network.quickJoin() to join the oldest available public lobby or create one. Serialize this per game so simultaneous requests don't create separate lobbies.

Reuse lobby creation settings, excluding visibility and passwords. Apply these settings only when creating a lobby.

Comment thread docs/api-reference.md Outdated
Comment thread internal/signaling/stores/postgres.go Outdated
Comment thread internal/signaling/stores/postgres.go Outdated
Comment thread internal/util/identifiers.go
Comment thread internal/signaling/stores/postgres.go Outdated
Comment thread internal/signaling/stores/shared.go Outdated
type Store interface {
CreateLobby(ctx context.Context, Game, LobbyCode, PeerID string, options LobbyOptions) error
JoinLobby(ctx context.Context, game, lobby, id, password string) ([]string, error)
JoinOrCreateLobby(ctx context.Context, game, peerID, country, region, lobbyFilter string, generateCode func(attempt int) string, options LobbyOptions) (string, []string, bool, error)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fun arg is not super nice. Don't know a better alternative rn.

Add `network.quickJoin()` to join the oldest available public lobby or create
one. Serialize this per game so simultaneous requests don't create separate
lobbies.

Reuse lobby creation settings, excluding visibility and passwords. Apply
these settings only when creating a lobby.
@erikdubbelboer
erikdubbelboer merged commit 59dffbd into main Oct 29, 2026
8 checks passed
@erikdubbelboer
erikdubbelboer deleted the quickJoin branch October 29, 2026 00:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants