v1.0.0
Latest
2022.3+

Interface IMultiplaySessionManager

Provides methods to manage a Game Server Hosting server.

Namespace: Unity.Services.Multiplayer
Syntax
public interface IMultiplaySessionManager

Properties

Allocation

The server allocation information.

Declaration
ServerAllocation Allocation { get; }
Property Value
TypeDescription
ServerAllocation

ConnectionPort

The connection port for the session. Null when the server is not allocated.

Declaration
ushort? ConnectionPort { get; }
Property Value
TypeDescription
System.Nullable<System.UInt16>

IpAddress

The connection IP for the session. Null when the server is not allocated.

Declaration
string IpAddress { get; }
Property Value
TypeDescription
System.String

IsReadyForPlayers

Whether the server is ready to accept players.

Declaration
bool IsReadyForPlayers { get; }
Property Value
TypeDescription
System.Boolean
See Also

QueryPort

The Server Query Protocol Port. Null when the server is not allocated.

Declaration
ushort? QueryPort { get; }
Property Value
TypeDescription
System.Nullable<System.UInt16>

ServerId

The server ID. Null when the server is not allocated.

Declaration
long? ServerId { get; }
Property Value
TypeDescription
System.Nullable<System.Int64>

ServerLogDirectory

The directory on the server Multiplay will write logs to. Null when the server is not allocated.

Declaration
string ServerLogDirectory { get; }
Property Value
TypeDescription
System.String

Session

The Session being hosted by this server.

Declaration
IServerSession Session { get; }
Property Value
TypeDescription
IServerSession

State

Current state of the Multiplay session handler.

Declaration
MultiplaySessionManagerState State { get; }
Property Value
TypeDescription
MultiplaySessionManagerState

Methods

GetAllocationPayloadFromJsonAsAsync<TPayload>()

Gets the payload allocation, in JSON, and deserializes it as the given object.

Declaration
Task<TPayload> GetAllocationPayloadFromJsonAsAsync<TPayload>()
Returns
TypeDescription
System.Threading.Tasks.Task<TPayload>

An object representing the payload allocation.

Type Parameters
NameDescription
TPayload

The object to be deserialized as.

GetAllocationPayloadFromPlainTextAsync()

Gets the payload allocation as plain text.

Declaration
Task<string> GetAllocationPayloadFromPlainTextAsync()
Returns
TypeDescription
System.Threading.Tasks.Task<System.String>

The payload allocation as plain text.

SetPlayerReadinessAsync(Boolean)

Set the server as ready to receive players.

Declaration
Task SetPlayerReadinessAsync(bool isReady)
Parameters
TypeNameDescription
System.BooleanisReady

True if the server is ready to receive players, false otherwise.

Returns
TypeDescription
System.Threading.Tasks.Task

A System.Threading.Tasks.Task representing the asynchronous operation.