Last Updated: 8/31/2021, 8:19:51 AM

# Lobby

# Overview

AccelByte lobby services provide continuous connection between the players and the game by using WebSocket. WebSocket ensures reliable, real-time data transfer by allowing two-way communication between the server and clients. Our lobby includes the following services:

  1. Presence enables players to see what other players are doing in real-time. This feature is critical in online multiplayer games, because player interactions rely on knowing which players are available.
  2. Party is used as the basis for multiplayer matchmaking. The party can be integrated with other lobby services such as presence, friends, and chat, to enrich the multiplayer experience.
  3. Friends lets players connect and interact with each other. AccelByte supports both in-game friends and platform or launcher level friends. In-game friends can chat and play together within a game title, whereas platform level friends allows players of different games to interact with each other.
  4. Chat enables real-time text based communication in-game. We support global, party, and individual chat.
  5. Matchmaking Daemon is responsible for matching multiple players based on the selected matchmaking channel configurations.

# How It Works

# Respect Player Blocks

The AccelByte Matchmaking service respects player blocks, so players won’t be matched with any players they have blocked or that have blocked them. The sequence diagram below shows what happens when a player tries to invite a player they’ve blocked to a match.

matchmaking

  1. Player A sends a block player B request to the Lobby.
  2. Lobby responds to player A’s request by sending the:
    • Block player result to player A.
    • BlockPlayerNotif to player A.
    • BlockPlayerNotif to player B.
  3. Player A tries to invite player B to a match through the Lobby.
  4. Lobby returns error code 11817 (PlayerBlocked) to player A.
  5. Player B tries to invite player A to a match through the Lobby.
  6. Lobby returns error code 11817 (PlayerBlocked) to player B.

# Managing Lobby in the Admin Portal

# Retrieve Lobby Configuration

  1. In the Admin Portal, go to the Game Management section and open the Lobby Configuration menu.

    matchmaking

  2. Here you can see the list of the lobby configuration in the Configuration List. To see the detailed configuration, click View.

    matchmaking

  3. Here you can see the Configuration Details of the lobby.

    matchmaking

# Update Lobby Configuration

  1. In the Admin Portal, go to the Game Management section and open the Lobby Configuration menu.

    matchmaking

  2. Here you can see the list of the lobby configuration in the Configuration List. To see the detailed configuration, click View.

    matchmaking

  3. Here you can see the Configuration details of the lobby.

    matchmaking

    • Toggle the Auto Kick On Disconnect. You can set it to true to enable auto-kick when players disconnect from the server.
    • Input the Max. Party Member to limit players in a party.

# Managing Lobby using SDK

# Connect to Lobby

Before you can use social services, you must set up a lobby connection by using the command below.

Once you have set up a lobby connection, you will be able to use other Social features such as user presence

# Handle the Connect / Disconnect Event

This feature notifies the game of any changes to the connection to the Lobby server. The SDK already provides an auto-reconnect mechanism, but when the auto-reconnect times out you must reconnect manually.

# Block a Player

Blocking allows players to restrict other players from interacting with them. When one player blocks another, both players are prevented from interacting with each other in the following ways:

  • Adding the other as a friend. If the players are already friends, they will be unfriended.
  • Sending or receiving messages to or from each other.
  • Seeing each other’s messages in global chat rooms.
  • Inviting each other to parties.
  • Meeting each other in matches.
  • Being in the same party, unless they were both invited by a 3rd player. Please note that should this occur, the blocking and blocked players will be able to interact with each other in the Party chat.
  • Inviting each other to join groups.
  • Seeing each other’s player profile in group member lists.

Blocked players cannot see the profile of the blocking player, and blocked players receive no notification regarding the block. See the tutorials below to implement player blocking using the SDK.

Blocking a player can be done by calling BlockPlayer(userId, callback). The callback from this method will return the blocked player’s user ID.

# Listen to Player Blocking Events

Sometimes the game needs to know if a player is being blocked by another player. Blocking events can be tracked by subscribing to the PlayerBlockedNotif event. The event will be raised on the blocked player side and will pass data that contains the blocking player’s user ID and the blocked player’s user ID.

# Unblocking a Player

Unblocking a player can be done by calling the method UnblockPlayer(userId, callback). The callback from this method will return the unblocked player’s user ID in the Value field.

# Listen to Player Unblocked Events

Just like the Player Blocked Event, the PlayerUnblockedNotif event will be raised on the unblocked player’s side, and will pass data that contains the unblocking player’s User ID and the unblocked player’s User ID.

# Get List of Blocked Players

To retrieve the list of currently blocked players, call the GetListOfBlockedUser method. This method has a callback that returns an array of BlockedData that contains the blocked players’ User IDs and the timestamp for each block. Timestamp only available on Unity.

# Get List of Blocked Players by ID

To retrieve the list of currently blocked players by specific player ID, call the GetListOfBlockedUser method.

# Get List of Blocking Players

To retrieve a list of players that have blocked the current player, call the GetListOfBlocker method. This method has a callback that returns an array of BlockerData that contains the blocking players’ User IDs and a timestamp for each block. Timestamp only available on Unity.

# Get List of Blocking Players by ID

To retrieve a list of players that have blocked the specific player ID, call the GetListOfBlocker method.

# Respect Player Blocks

The AccelByte Matchmaking service respects player blocks, so players won’t be matched with any players they have blocked or that have blocked them.

# Managing Lobby using API

# Retrieve Lobby Configuration

  1. Use the Admin Get Namespace Config: GET - /lobby/v1/admin/config/namespaces/{namespace} endpoint.
  2. Input the Game Namespace where the configuration belongs.

On a successful request, the lobby configuration will be retrieved.

# Update Lobby Configuration

  1. Use the Admin Get Namespace Config: GET - /lobby/v1/admin/config/namespaces/{namespace} endpoint.
  2. Input the Game Namespace where the configuration belongs.
  3. Fill out the Request Body:
    • Set the Auto Kick On Disconnect. You can set it to true to enable auto-kick when players disconnect from the server.
    • Input the Max. Party Member to limit players in a party.

On a successful request, the lobby configuration will be updated.