Class JoinAllocation
An allocation created via a join code.
Inherited Members
Namespace: Unity.Services.Relay.Models
Assembly: Unity.Services.Multiplayer.dll
Syntax
[Preserve]
[DataContract(Name = "JoinAllocation")]
public class JoinAllocation
Constructors
JoinAllocation(Guid, List<RelayServerEndpoint>, RelayServer, byte[], byte[], byte[], string, byte[])
An allocation created via a join code.
Declaration
[Preserve]
public JoinAllocation(Guid allocationId, List<RelayServerEndpoint> serverEndpoints, RelayServer relayServer, byte[] key, byte[] connectionData, byte[] allocationIdBytes, string region, byte[] hostConnectionData)
Parameters
Type | Name | Description |
---|---|---|
Guid | allocationId | The unique ID of the allocation. |
List<RelayServerEndpoint> | 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. |
RelayServer | relayServer | relayServer param |
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 equired for establishing communication with other players. |
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. |
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. |
Properties
AllocationId
The unique ID of the allocation.
Declaration
[Preserve]
[DataMember(Name = "allocationId", IsRequired = true, EmitDefaultValue = true)]
public Guid AllocationId { get; }
Property Value
Type | Description |
---|---|
Guid |
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
[Preserve]
[DataMember(Name = "allocationIdBytes", IsRequired = true, EmitDefaultValue = true)]
public byte[] AllocationIdBytes { get; }
Property Value
Type | Description |
---|---|
byte[] |
ConnectionData
A base64-encoded representation of an encrypted connection data blob describing this allocation. This data is equired for establishing communication with other players.
Declaration
[Preserve]
[DataMember(Name = "connectionData", IsRequired = true, EmitDefaultValue = true)]
public byte[] ConnectionData { get; }
Property Value
Type | Description |
---|---|
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.
Declaration
[Preserve]
[DataMember(Name = "hostConnectionData", IsRequired = true, EmitDefaultValue = true)]
public byte[] HostConnectionData { get; }
Property Value
Type | Description |
---|---|
byte[] |
Key
A base64-encoded key required for the HMAC signature of the BIND
message.
Declaration
[Preserve]
[DataMember(Name = "key", IsRequired = true, EmitDefaultValue = true)]
public byte[] Key { get; }
Property Value
Type | Description |
---|---|
byte[] |
Region
The allocation region.
Declaration
[Preserve]
[DataMember(Name = "region", IsRequired = true, EmitDefaultValue = true)]
public string Region { get; }
Property Value
Type | Description |
---|---|
string |
RelayServer
Parameter relayServer of JoinAllocation
Declaration
[Preserve]
[DataMember(Name = "relayServer", IsRequired = true, EmitDefaultValue = true)]
public RelayServer RelayServer { get; }
Property Value
Type | Description |
---|---|
RelayServer |
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
[Preserve]
[DataMember(Name = "serverEndpoints", IsRequired = true, EmitDefaultValue = true)]
public List<RelayServerEndpoint> ServerEndpoints { get; }
Property Value
Type | Description |
---|---|
List<RelayServerEndpoint> |