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 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 ("udp", "dtls", "ws", or "wss"). |
Returns
Type | Description |
---|---|
RelayServerData | Relay server data model for Transport |
Exceptions
Type | Condition |
---|---|
ArgumentException | Thrown if allocation is null, if the connection type is invalid or if no endpoint match the connection type |
ToRelayServerData(JoinAllocation, string)
Convert an allocation to Transport's 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 ("udp", "dtls", "ws", or "wss"). |
Returns
Type | Description |
---|---|
RelayServerData | Relay server data model for Transport |
Exceptions
Type | Condition |
---|---|
ArgumentException | Thrown if allocation is null, if the connection type is invalid or if no endpoint match the connection type |