Lobby hub (SignalR)
The real-time lobby is a SignalR hub at /hubs/lobby. Connect with an access token: the
access_token query parameter, or the client library’s AccessTokenProvider. Method names are
constants in AcidBoy.Online.Contracts (LobbyServer, LobbyClient).
Concepts
Section titled “Concepts”- Lobbies are either public channels (
channel:<id>, stored in the database, managed by admins) or private rooms (room:<CODE>, created by players, 6-character invite code fromABCDEFGHJKLMNPQRSTUVWXYZ23456789, optional password, at most 8 players, gone when empty). - One lobby at a time: a player is in at most one lobby. Joining another leaves the current one.
- Presence is
OnlineorInMatch, and friends are told when it changes. - Live state is in memory (
LobbyState, one lock; messages are sent after releasing it).
Client → server
Section titled “Client → server”| Method | Arguments → result | Notes |
|---|---|---|
SetGame |
GameInfo? (title, sha1) |
The loaded game, shown to others |
ListChannels |
→ [ChannelDto] |
With member counts |
JoinChannel |
channelId → LobbyDto |
|
CreateRoom |
password? → LobbyDto |
You become the owner |
JoinRoom |
inviteCode, password? → LobbyDto |
Fails: no such code, room full, wrong password |
LeaveLobby |
||
SendChat |
text |
Up to 200 characters, control characters removed, 5 messages per 5 s; refused while muted |
Challenge |
accountId → challengeId |
The target must be in your lobby or be a friend; neither of you may be linked; one open challenge per pair |
RespondToChallenge |
challengeId, accept |
Only the challenged player |
CancelChallenge |
challengeId |
Only the challenger |
InviteToRoom |
friendId |
You must be in a room; the friend must be online |
LobbyDto is the lobby you joined:
targetandname;inviteCode,ownerIdandhasPassword(for rooms);members, each aMemberDto: account, game, status;recentChat.
Refusals are HubExceptions whose message is meant for the player.
Server → client
Section titled “Server → client”| Method | Arguments | When |
|---|---|---|
MemberJoined / MemberLeft / MemberUpdated |
MemberDto / accountId / MemberDto |
Changes in your lobby (game loaded, linked) |
Chat |
ChatMessageDto |
A message in your lobby |
ChallengeReceived |
ChallengeDto |
Someone challenged you |
ChallengeClosed |
challengeId, reason |
Declined, canceled, expired (30 s) or a player went offline |
MatchReady |
MatchReadyDto (matchId, relayTicket, isHost, opponent) |
A challenge was accepted: connect to the relay now |
PresenceChanged |
PresenceDto |
A friend came online, went offline, or started or finished a link |
FriendUpdated |
FriendDto |
A friend request arrived or a friendship changed |
RoomInvite |
RoomInviteDto |
A friend invited you to their room |
Notice |
string |
A server or moderator message: kicked, muted, banned, channel closed |
A challenge, end to end
Section titled “A challenge, end to end”sequenceDiagram
participant A as Player A
participant H as Lobby hub
participant B as Player B
participant R as Relay
A->>H: Challenge(B)
H->>B: ChallengeReceived
B->>H: RespondToChallenge(id, true)
H->>H: create Match (A host, B guest), two relay tickets
H->>A: MatchReady(ticket A, isHost)
H->>B: MatchReady(ticket B)
A->>R: /relay/{match}?ticket=A
B->>R: /relay/{match}?ticket=B
R-->>A: link cable bytes
R-->>B: link cable bytes
Both players are marked InMatch until the relay session ends. If neither reaches the relay, the
match ends as NeverConnected after twice the relay’s wait time.
Connection lifecycle
Section titled “Connection lifecycle”- A player is online while they have at least one hub connection.
- When the last one closes, the player leaves their lobby, their open challenges close, and friends see them go offline.
- The emulator reconnects automatically and rejoins its channel or room.
