docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class Allocation

    The details of an allocation to a Relay server.

    Inheritance
    object
    Allocation
    Namespace: Unity.Services.Relay.Models
    Assembly: solution.dll
    Syntax
    public class Allocation

    Constructors

    Allocation(Guid, List<RelayServerEndpoint>, RelayServer, byte[], byte[], byte[], string)

    The details of an allocation to a Relay server.

    Declaration
    public Allocation(Guid allocationId, List<RelayServerEndpoint> serverEndpoints, RelayServer relayServer, byte[] key, byte[] connectionData, byte[] allocationIdBytes, string region)
    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 BIND message.

    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, PING, CONNECT, RELAY, and CLOSE message types.

    string region

    The allocation region.

    Properties

    AllocationId

    The unique ID of the allocation.

    Declaration
    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
    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
    public byte[] ConnectionData { get; }
    Property Value
    Type Description
    byte[]

    Key

    A base64-encoded key required for the HMAC signature of the BIND message.

    Declaration
    public byte[] Key { get; }
    Property Value
    Type Description
    byte[]

    Region

    The allocation region.

    Declaration
    public string Region { get; }
    Property Value
    Type Description
    string

    RelayServer

    Parameter relayServer of Allocation

    Declaration
    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
    public List<RelayServerEndpoint> ServerEndpoints { get; }
    Property Value
    Type Description
    List<RelayServerEndpoint>

    Extension Methods

    AllocationUtils.ToRelayServerData(Allocation, string)
    AllocationUtils.ToRelayServerData(Allocation, RelayProtocol)
    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)