Class RelayNetworkOptions
Represents Relay options.
Inherited Members
Namespace: Unity.Services.Multiplayer
Assembly: Unity.Services.Multiplayer.dll
Syntax
public class RelayNetworkOptions
Constructors
RelayNetworkOptions(RelayProtocol)
Initializes a new instance of the RelayNetworkOptions struct from the specified parameters.
Declaration
public RelayNetworkOptions(RelayProtocol protocol)
Parameters
Type | Name | Description |
---|---|---|
RelayProtocol | protocol | The selected RelayProtocol to be used for relay communication. |
Remarks
To obtain the list of available region, use the Relay Allocations
Service via ListRegionsAsync().
To determine the lowest latency region, use GetSortedRelayQosResultsAsync(IList<string>).
RelayNetworkOptions(RelayProtocol, string)
Initializes a new instance of the RelayNetworkOptions struct from the specified parameters.
Declaration
public RelayNetworkOptions(RelayProtocol protocol, string region)
Parameters
Type | Name | Description |
---|---|---|
RelayProtocol | protocol | The selected RelayProtocol to be used for relay communication. |
string | region | Force a specific Relay region to be used and skip auto-selection from QoS. |
Remarks
To obtain the list of available region, use the Relay Allocations
Service via ListRegionsAsync().
To determine the lowest latency region, use GetSortedRelayQosResultsAsync(IList<string>).
RelayNetworkOptions(RelayProtocol, string, bool)
Initializes a new instance of the RelayNetworkOptions struct from the specified parameters.
Declaration
public RelayNetworkOptions(RelayProtocol protocol, string region, bool preserveRegion)
Parameters
Type | Name | Description |
---|---|---|
RelayProtocol | protocol | The selected RelayProtocol to be used for relay communication. |
string | region | Force a specific Relay region to be used and skip auto-selection from QoS. |
bool | preserveRegion | Save the relay region to session properties and reuse it in case of host migration. |
Remarks
To obtain the list of available region, use the Relay Allocations
Service via ListRegionsAsync().
To determine the lowest latency region, use GetSortedRelayQosResultsAsync(IList<string>).
Properties
Default
Gets the default RelayNetworkOptions instance with Default.
Declaration
public static RelayNetworkOptions Default { get; }
Property Value
Type | Description |
---|---|
RelayNetworkOptions |
PreserveRegion
Save the relay region to session properties and reuse it in case of host migration.
Declaration
public bool PreserveRegion { get; }
Property Value
Type | Description |
---|---|
bool |
Protocol
The selected RelayProtocol to be used for relay communication.
Declaration
public RelayProtocol Protocol { get; }
Property Value
Type | Description |
---|---|
RelayProtocol |
Region
Declaration
public string Region { get; }
Property Value
Type | Description |
---|---|
string |