useMatchLobbyStore is a Pinia store that manages match lobbies, tournaments, and real-time participant tracking for the 5Stack platform.
Overview
This store handles:- User’s active and scheduled matches
- Match and tournament counts for organizers
- Live match and tournament tracking
- Lobby chat participant management
- Real-time subscriptions for various match states
Import
Usage
State
Match Management
All matches the user is involved in (as player or organizer) that are active or scheduled.
Map of match IDs to participant data for lobby chat, tracking who’s in each lobby.
Counts
Number of active matches the user is organizing (for match organizers and above).
Number of active tournaments the user is organizing (for tournament organizers and above).
Total number of live matches across the platform.
Total number of live tournaments across the platform.
Number of tournaments currently open for registration.
Number of matches in player selection that are open to join.
Tournaments
Live tournaments where the user is either a participant or organizer (for chat access).
Methods
Subscription Methods
subscribeToMyMatches()
Subscribes to matches the user is involved in as a player or organizer.subscribeToLiveMatches()
Subscribes to the count of all live matches on the platform.subscribeToLiveTournaments()
Subscribes to the count of all live tournaments on the platform.subscribeToOpenRegistrationTournaments()
Subscribes to the count of tournaments open for registration.subscribeToOpenMatches()
Subscribes to the count of matches open for players to join.subscribeToChatTournaments()
Subscribes to tournaments where the user has chat access (as participant or organizer).subscribeToManagingMatches()
Subscribes to active matches the user is organizing. Only available for match organizers and above.subscribeToManagingTournaments()
Subscribes to active tournaments the user is organizing. Only available for tournament organizers and above.Lobby Chat Management
add()
Adds a user to a match lobby’s participant list.The ID of the match lobby
User object containing:
steam_id: User’s Steam IDname: Display nameavatar_url: Profile picture URLinGame: Whether user is currently in-game
set()
Sets multiple users as participants in a match lobby.The ID of the match lobby
Array of user objects
remove()
Removes a user from a match lobby’s participant list.The ID of the match lobby
Object containing the user’s
steam_idComputed Properties
The first match in
myMatches array (most recent/active match).Match Status Types
The store tracks matches with the following statuses:Live- Match is currently being playedVeto- Map veto phase in progressWaitingForCheckIn- Waiting for players to check inWaitingForServer- Server is being provisionedScheduled- Match is scheduled for futurePickingPlayers- Players are being selected for the match
Tournament Status Types
The store tracks tournaments with the following statuses:Live- Tournament is in progressRegistrationOpen- Registration is openRegistrationClosed- Registration closed, waiting to startSetup- Tournament is being configured