Class Allocation
The details of an allocation to a Relay server.
Inherited Members
Namespace: Unity.Services.Apis.Relay
Assembly: Unity.Services.Apis.dll
Syntax
[DataContract(Name = "Allocation")]
[Preserve]
public class Allocation
Constructors
Allocation(string, List<RelayServerEndpoint>, RelayServer, byte[], byte[], byte[], string)
Initializes a new instance of the Allocation class.
Declaration
[Preserve]
public Allocation(string allocationId = null, List<RelayServerEndpoint> serverEndpoints = null, RelayServer relayServer = null, byte[] key = null, byte[] connectionData = null, byte[] allocationIdBytes = null, string region = null)
Parameters
Type | Name | Description |
---|---|---|
string | allocationId | The unique ID of the allocation. (required). |
List<Relay |
serverEndpoints | Connection endpoints for the assigned Relay server. > Note: The order of server endpoints is not guaranteed and users should iterate over the items and look for the desired values. (required). |
Relay |
relayServer | relayServer (required). |
byte[] | key | A base64-encoded key required for the HMAC signature of the |
byte[] | connectionData | A base64-encoded representation of an encrypted connection data blob describing this allocation. This data is required for establishing communication with other players. (required). |
byte[] | allocationIdBytes | A base64-encoded form of the allocation ID. When decoded, this is the exact expected byte alignment to use when crafting Relay protocol messages that require the allocation ID. For example, |
string | region | The allocation region. (required). |
Properties
AllocationId
The unique ID of the allocation.
Declaration
[DataMember(Name = "allocationId", IsRequired = true, EmitDefaultValue = true)]
[Preserve]
public string AllocationId { get; set; }
Property Value
Type | Description |
---|---|
string | The unique ID of the allocation. |
AllocationIdBytes
A base64-encoded form of the allocation ID. When decoded, this is the exact expected byte alignment to use when crafting Relay protocol messages that require the allocation ID. For example, PING
, CONNECT
, RELAY
, and CLOSE
message types.
Declaration
[DataMember(Name = "allocationIdBytes", IsRequired = true, EmitDefaultValue = true)]
[Preserve]
public byte[] AllocationIdBytes { get; set; }
Property Value
Type | Description |
---|---|
byte[] | A base64-encoded form of the allocation ID. When decoded, this is the exact expected byte alignment to use when crafting Relay protocol messages that require the allocation ID. For example, |
ConnectionData
A base64-encoded representation of an encrypted connection data blob describing this allocation. This data is required for establishing communication with other players.
Declaration
[DataMember(Name = "connectionData", IsRequired = true, EmitDefaultValue = true)]
[Preserve]
public byte[] ConnectionData { get; set; }
Property Value
Type | Description |
---|---|
byte[] | A base64-encoded representation of an encrypted connection data blob describing this allocation. This data is required for establishing communication with other players. |
Key
A base64-encoded key required for the HMAC signature of the BIND
message.
Declaration
[DataMember(Name = "key", IsRequired = true, EmitDefaultValue = true)]
[Preserve]
public byte[] Key { get; set; }
Property Value
Type | Description |
---|---|
byte[] | A base64-encoded key required for the HMAC signature of the |
Region
The allocation region.
Declaration
[DataMember(Name = "region", IsRequired = true, EmitDefaultValue = true)]
[Preserve]
public string Region { get; set; }
Property Value
Type | Description |
---|---|
string | The allocation region. |
RelayServer
Gets or Sets RelayServer
Declaration
[DataMember(Name = "relayServer", IsRequired = true, EmitDefaultValue = true)]
[Obsolete]
[Preserve]
public RelayServer RelayServer { get; set; }
Property Value
Type | Description |
---|---|
Relay |
ServerEndpoints
Connection endpoints for the assigned Relay server. > Note: The order of server endpoints is not guaranteed and users should iterate over the items and look for the desired values.
Declaration
[DataMember(Name = "serverEndpoints", IsRequired = true, EmitDefaultValue = true)]
[Preserve]
public List<RelayServerEndpoint> ServerEndpoints { get; set; }
Property Value
Type | Description |
---|---|
List<Relay |
Connection endpoints for the assigned Relay server. > Note: The order of server endpoints is not guaranteed and users should iterate over the items and look for the desired values. |