docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Interface ICommonMultiplayerBackendService

    Definition of the Common Multiplayer Backend service.

    Namespace: Unity.Services.CommonMultiplayerBackend
    Assembly: Unity.Services.Multiplayer.dll
    Syntax
    public interface ICommonMultiplayerBackendService

    Methods

    CreateSessionForLobbyIdAsync(string, string)

    Async Operation. Creates a session for associated to the provided lobby. The region provided will be used to allocate a relay, otherwise the default region is used.

    Declaration
    Task<Session> CreateSessionForLobbyIdAsync(string lobbyId, string region = null)
    Parameters
    Type Name Description
    string lobbyId

    Identifier of the lobby to associate with the session.

    string region

    Preferred relay region for the session (optional).

    Returns
    Type Description
    Task<Session>

    Session information.

    Exceptions
    Type Condition
    ArgumentException

    Represents an error that occur when an argument is incorrectly setup.

    CommonMultiplayerBackendServiceException

    An exception containing the HttpClientResponse with headers, response code, and string of error.

    JoinSessionForLobbyIdAsync(string, int)

    Async Operation. Obtain the Relay Join Code from the lobby associated to the session. The join code can later be used by the Relay SDK in order to join the allocation and configure the client's network transport.

    Declaration
    Task<string> JoinSessionForLobbyIdAsync(string lobbyId, int timeoutSeconds = 120)
    Parameters
    Type Name Description
    string lobbyId

    Identifier of the lobby associated with the session.

    int timeoutSeconds

    Number of seconds before timing out the join process (optional).

    Returns
    Type Description
    Task<string>

    Relay Join Code needed to connect to session.

    Exceptions
    Type Condition
    ArgumentException

    Represents an error that occurs when an argument is incorrectly set up.

    CommonMultiplayerBackendServiceException

    An exception containing the HttpClientResponse with headers, response code, and string of error.

    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)