Interface IMultiplayService
Interface of the Multiplay SDK for using the Multiplay Service.
Namespace: Unity.Services.Multiplay
Syntax
public interface IMultiplayServiceProperties
ServerConfig
Gets the server config for the current session.
Declaration
ServerConfig ServerConfig { get; }Property Value
| Type | Description |
|---|---|
| ServerConfig |
Methods
GetPayloadAllocationAsPlainText()
Gets the payload allocation as plain text.
Declaration
Task<string> GetPayloadAllocationAsPlainText()Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<System.String> | The payload allocation as plain text. |
GetPayloadAllocationFromJsonAs<TPayload>(Boolean)
Gets the payload allocation, in JSON, and deserializes it as the given object.
Declaration
Task<TPayload> GetPayloadAllocationFromJsonAs<TPayload>(bool throwOnMissingMembers = false)Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | throwOnMissingMembers | Throws an exception if the given class is missing a member. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<TPayload> | An object representing the payload allocation. |
Type Parameters
| Name | Description |
|---|---|
| TPayload | The object to be deserialized as. |
ReadyServerForPlayersAsync()
Readies this server. To be called after the server has been Allocated to notify that the server is ready to accept players.
Declaration
Task ReadyServerForPlayersAsync()Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task | A task that should be awaited. |
StartServerQueryHandlerAsync(UInt16, String, String, String, String)
Starts the server query handler. The handler provides the Multiplay Service with information about this server.
Declaration
Task<IServerQueryHandler> StartServerQueryHandlerAsync(ushort maxPlayers, string serverName, string gameType, string buildId, string map)Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt16 | maxPlayers | The max players for this server. |
| System.String | serverName | The name of this server. |
| System.String | gameType | The game type of this server. |
| System.String | buildId | The build ID of this server. |
| System.String | map | The map of this server. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<IServerQueryHandler> | A task returning a manager for changing the current response. |
SubscribeToServerEventsAsync(MultiplayEventCallbacks)
Subscribes to the SDK Daemon and provides updates via callbacks.
Declaration
Task<IServerEvents> SubscribeToServerEventsAsync(MultiplayEventCallbacks callbacks)Parameters
| Type | Name | Description |
|---|---|---|
| MultiplayEventCallbacks | callbacks | The callbacks that will be executed to respond to the server events. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<IServerEvents> | A task returning a handle for server event management. |
UnreadyServerAsync()
Unreadies this server. To be called to prevent the server being given new players.
Declaration
Task UnreadyServerAsync()Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task | A task that should be awaited. |