Your Matchmaker Cloud Code allocator gets runtime values from the IExecutionContext context parameter, and match values from request.MatchmakingResults. Player list, region and other match-shape data are in MatchmakingResults.MatchProperties.
This applies to allocator modules built on Com.Unity.Services.CloudCode.Apis, for Matchmaker pools set to Hosting via Cloud Code.
What runtime values are available from IExecutionContext?
IExecutionContext context is passed to both Allocate and Poll. It gives you:
context.ProjectId: your Unity project ID. Needed when you build URLs for Unity REST APIs that include the project ID in their path.context.EnvironmentIdandcontext.EnvironmentName: the ID and name (for exampleproduction) of the active environment. Use them to route to different provider fleets or queues without hardcoding per-environment config.context.ServiceToken: a short-lived token for calling Unity's REST APIs. Send it asAuthorization: Bearer {token}.
What match values are available on MatchmakingResults?
These are top-level properties on MatchmakingResults, not entries inside MatchProperties:
MatchId: the unique ID for this match. Use it as the session or placement ID with your provider for idempotency.PoolId/PoolName: the pool that triggered this allocation. Useful for routing to different fleets per pool.QueueName: the queue the ticket was submitted to.BackfillTicketId: set on backfill allocations, null otherwise.
var env = context.EnvironmentName;
var regionValue = request.MatchmakingResults.MatchProperties.GetValueOrDefault("Region")?.ToString();
var region = string.IsNullOrEmpty(regionValue) ? DefaultRegion : regionValue;
// MatchId doubles as a stable placement ID, useful for idempotent provider calls
var placementId = request.MatchmakingResults.MatchId;
logger.LogInformation("env={Env} pool={Pool} region={Region} match={MatchId}",
env, request.MatchmakingResults.PoolName, region, placementId);