Skip to content

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).

  • 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 from ABCDEFGHJKLMNPQRSTUVWXYZ23456789, 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 Online or InMatch, and friends are told when it changes.
  • Live state is in memory (LobbyState, one lock; messages are sent after releasing it).
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:

  • target and name;
  • inviteCode, ownerId and hasPassword (for rooms);
  • members, each a MemberDto: account, game, status;
  • recentChat.

Refusals are HubExceptions whose message is meant for the player.

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
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.

  • 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.