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
Type | Description |
---|---|
ServerAllocation |
ConnectionPort
The connection port for the session. Null when the server is not allocated.
Declaration
ushort? ConnectionPort { get; }
Property Value
Type | Description |
---|---|
System.Nullable<System.UInt16> |
IpAddress
The connection IP for the session. Null when the server is not allocated.
Declaration
string IpAddress { get; }
Property Value
Type | Description |
---|---|
System.String |
IsReadyForPlayers
Whether the server is ready to accept players.
Declaration
bool IsReadyForPlayers { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
See Also
QueryPort
The Server Query Protocol Port. Null when the server is not allocated.
Declaration
ushort? QueryPort { get; }
Property Value
Type | Description |
---|---|
System.Nullable<System.UInt16> |
ServerId
The server ID. Null when the server is not allocated.
Declaration
long? ServerId { get; }
Property Value
Type | Description |
---|---|
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
Type | Description |
---|---|
System.String |
Session
The Session being hosted by this server.
Declaration
IServerSession Session { get; }
Property Value
Type | Description |
---|---|
IServerSession |
State
Current state of the Multiplay session handler.
Declaration
MultiplaySessionManagerState State { get; }
Property Value
Type | Description |
---|---|
MultiplaySessionManagerState |
Methods
GetAllocationPayloadFromJsonAsAsync<TPayload>()
Gets the payload allocation, in JSON, and deserializes it as the given object.
Declaration
Task<TPayload> GetAllocationPayloadFromJsonAsAsync<TPayload>()
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. |
GetAllocationPayloadFromPlainTextAsync()
Gets the payload allocation as plain text.
Declaration
Task<string> GetAllocationPayloadFromPlainTextAsync()
Returns
Type | Description |
---|---|
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
Type | Name | Description |
---|---|---|
System.Boolean | isReady | True if the server is ready to receive players, false otherwise. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A System.Threading.Tasks.Task representing the asynchronous operation. |