Class AllocationUtils
Utility methods for relay allocations
Inherited Members
Namespace: Unity.Services.Relay.Models
Assembly: Unity.Services.Multiplayer.dll
Syntax
public static class AllocationUtils
Methods
ToRelayServerData(Allocation, string)
Convert an allocation to Transport's Unity.Networking.Transport.Relay.RelayServerData model.
Declaration
public static RelayServerData ToRelayServerData(this Allocation allocation, string connectionType)
Parameters
Type | Name | Description |
---|---|---|
Allocation | allocation | Allocation from which to create the server data. |
string | connectionType | Type of connection to use ( |
Returns
Type | Description |
---|---|
RelayServerData | Relay server data model for Transport. |
Exceptions
Type | Condition |
---|---|
ArgumentException | Thrown if allocation is |
ToRelayServerData(Allocation, RelayProtocol)
Convert an allocation to Transport's Unity.Networking.Transport.Relay.RelayServerData model.
Declaration
public static RelayServerData ToRelayServerData(this Allocation allocation, RelayProtocol connectionType)
Parameters
Type | Name | Description |
---|---|---|
Allocation | allocation | Allocation from which to create the server data. |
RelayProtocol | connectionType |
Returns
Type | Description |
---|---|
RelayServerData | Relay server data model for Transport. |
Exceptions
Type | Condition |
---|---|
ArgumentException | Thrown if allocation is |
ToRelayServerData(JoinAllocation, string)
Convert an allocation to Transport's Unity.Networking.Transport.Relay.RelayServerData model.
Declaration
public static RelayServerData ToRelayServerData(this JoinAllocation allocation, string connectionType)
Parameters
Type | Name | Description |
---|---|---|
JoinAllocation | allocation | Allocation from which to create the server data. |
string | connectionType | Type of connection to use
( |
Returns
Type | Description |
---|---|
RelayServerData | Relay server data model for Transport. |
Exceptions
Type | Condition |
---|---|
ArgumentException | Thrown if allocation is |
ToRelayServerData(JoinAllocation, RelayProtocol)
Convert an allocation to Transport's Unity.Networking.Transport.Relay.RelayServerData model.
Declaration
public static RelayServerData ToRelayServerData(this JoinAllocation allocation, RelayProtocol connectionType)
Parameters
Type | Name | Description |
---|---|---|
JoinAllocation | allocation | Allocation from which to create the server data. |
RelayProtocol | connectionType |
Returns
Type | Description |
---|---|
RelayServerData | Relay server data model for Transport. |
Exceptions
Type | Condition |
---|---|
ArgumentException | Thrown if allocation is |