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
Type | Name | Description |
---|---|---|
SessionOptions | sessionOptions | The options for the resulting session |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<IServerSession> | The created server session |
Exceptions
Type | Condition |
---|---|
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
Type | Name | Description |
---|---|---|
MultiplaySessionManagerOptions | options | The options to start the session manager. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<IMultiplaySessionManager> | The session manager. |
Exceptions
Type | Condition |
---|---|
SessionException | Thrown when called from a non Multiplay Game Server Hosting server. The Error property will be set to InvalidPlatformOperation. |