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
Exceptions
Type | Condition |
---|---|
Argument |
Represents an error that occur when an argument is incorrectly setup. |
Common |
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
Exceptions
Type | Condition |
---|---|
Argument |
Represents an error that occurs when an argument is incorrectly set up. |
Common |
An exception containing the HttpClientResponse with headers, response code, and string of error. |