v1.0.0
Latest
2022.3+

Interface IMultiplayerServerService

Facade for session browsing, session management and matchmaking.

Namespace: Unity.Services.Multiplayer
Syntax
public interface IMultiplayerServerService

Methods

CreateSessionAsync(SessionOptions)

Creates a server session.

Declaration
Task<IServerSession> CreateSessionAsync(SessionOptions sessionOptions)
Parameters
TypeNameDescription
SessionOptionssessionOptions

The options for the resulting session

Returns
TypeDescription
System.Threading.Tasks.Task<IServerSession>

The created server session

Exceptions
TypeCondition
SessionException

Provides a specific session error type and error message.

StartMultiplaySessionManagerAsync(MultiplaySessionManagerOptions)

Starts the Multiplay server session manager. The session manager should be started on server startup. It handles the session management within the server lifecycle.

Declaration
Task<IMultiplaySessionManager> StartMultiplaySessionManagerAsync(MultiplaySessionManagerOptions options)
Parameters
TypeNameDescription
MultiplaySessionManagerOptionsoptions

The options to start the session manager.

Returns
TypeDescription
System.Threading.Tasks.Task<IMultiplaySessionManager>

The session manager.

Exceptions
TypeCondition
SessionException

Thrown when called from a non Multiplay Game Server Hosting server. The Error property will be set to InvalidPlatformOperation.