Interface IMultiplayerServerService
Facade for session browsing, session management and matchmaking.
Namespace: Unity.Services.Multiplayer
Assembly: Unity.Services.Multiplayer.Server.dll
Syntax
public interface IMultiplayerServerService
Methods
CreateSessionAsync(SessionOptions)
Creates a server session.
Declaration
Task<IServerSession> CreateSessionAsync(SessionOptions sessionOptions)
Parameters
| Type | Name | Description |
|---|---|---|
| SessionOptions | sessionOptions | The options for the resulting session |
Returns
| Type | Description |
|---|---|
| Task<IServerSession> | The created server session |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | If a parameter is null. |
| SessionException | Provides a specific session error type and error message. |
StartMultiplaySessionManagerAsync(MultiplaySessionManagerOptions)
Starts the Multiplay server session manager and completes session initialization. The session manager should be started on server startup. The allocation event (Allocated) is only triggered after this operation completes.
The initialization does the following operations:
- Register to multiplay events
- Start the server query handler using the server options
- Wait for the allocation event
- Create the session with the provided session options
- Set players readiness (optional based on server options)
Declaration
[Obsolete("The Multiplay service will cease to operate on March 31st 2026 - For alternative hosting providers, please update to com.unity.services.multiplayer 2.1")]
Task<IMultiplaySessionManager> StartMultiplaySessionManagerAsync(MultiplaySessionManagerOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| MultiplaySessionManagerOptions | options | The options to start the session manager. This is mandatory. The underlying session and server options must be provided. |
Returns
| Type | Description |
|---|---|
| Task<IMultiplaySessionManager> | The session manager. |
Remarks
The Multiplay service will cease to operate on March 31st 2026 - For alternative hosting providers, please update to com.unity.services.multiplayer 2.1
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | If a mandatory parameter is null. |
| SessionException | Thrown when called from a non Multiplay Game Server Hosting server. The Error property will be set to InvalidPlatformOperation. |