Class MatchRequest

Namespace
Unity.Multiplayer.Core

What a matchmaker asks an IMatchAllocator for: a fresh server for one match, started on demand and torn down with ReleaseAsync(MatchAllocation, CancellationToken) once the match ends. Unlike IHostingProfile's provision-once-and-keep-running servers, a new MatchRequest is made for every match.

public sealed class MatchRequest
Inheritance
MatchRequest
Inherited Members

Constructors

MatchRequest(string, int, string, IReadOnlyDictionary<string, string>)

Creates a request for one match.

public MatchRequest(string matchId, int maxPlayers, string region = null, IReadOnlyDictionary<string, string> metadata = null)

Parameters

matchId string
maxPlayers int
region string
metadata IReadOnlyDictionary<string, string>

Exceptions

ArgumentException

matchId is empty.

ArgumentOutOfRangeException

maxPlayers is less than 1.

Properties

MatchId

A caller-chosen id for this match; providers that support it tag the deployment/session with it for their own logs.

public string MatchId { get; }

Property Value

string

MaxPlayers

How many players the server must have room for.

public int MaxPlayers { get; }

Property Value

int

Metadata

Extra provider-specific hints (an adapter documents the keys it reads); never null.

public IReadOnlyDictionary<string, string> Metadata { get; }

Property Value

IReadOnlyDictionary<string, string>

Region

A preferred region/location code, or null to let the provider pick (usually the one closest to its routing data).

public string Region { get; }

Property Value

string

Methods

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.