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
Exceptions
- ArgumentException
matchIdis empty.- ArgumentOutOfRangeException
maxPlayersis 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
MaxPlayers
How many players the server must have room for.
public int MaxPlayers { get; }
Property Value
Metadata
Extra provider-specific hints (an adapter documents the keys it reads); never null.
public IReadOnlyDictionary<string, string> Metadata { get; }
Property Value
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
Methods
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.