Class JoinAllocation
An allocation created via a join code.
Inherited Members
Namespace: Unity.Services.Apis.Relay
Assembly: Unity.Services.Apis.dll
Syntax
[DataContract(Name = "JoinAllocation")]
[Preserve]
public class JoinAllocation
Constructors
JoinAllocation(string, List<RelayServerEndpoint>, RelayServer, byte[], byte[], byte[], string, byte[])
Initializes a new instance of the Join
Declaration
[Preserve]
public JoinAllocation(string allocationId = null, List<RelayServerEndpoint> serverEndpoints = null, RelayServer relayServer = null, byte[] key = null, byte[] connectionData = null, byte[] allocationIdBytes = null, string region = null, byte[] hostConnectionData = 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). |
byte[] | hostConnectionData | A base64-encoded representation of an encrypted connection data blob describing the allocation and Relay server of the player who created the join code. Connecting players can use this data to establish communication with the host player. (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. |
HostConnectionData
A base64-encoded representation of an encrypted connection data blob describing the allocation and Relay server of the player who created the join code. Connecting players can use this data to establish communication with the host player.
Declaration
[DataMember(Name = "hostConnectionData", IsRequired = true, EmitDefaultValue = true)]
[Preserve]
public byte[] HostConnectionData { get; set; }
Property Value
Type | Description |
---|---|
byte[] | A base64-encoded representation of an encrypted connection data blob describing the allocation and Relay server of the player who created the join code. Connecting players can use this data to establish communication with the host player. |
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. |