Version: en

Contracts - Rule Based Ticket

warning

This documentatin is now deprecated. If you are using Matchmaker Self Serve though UDash contact us directly to get access to the new documentation

Main Contract#

{
"Attributes": {...},
"Properties": {
"QosResults": ...,
"Players": ...,
"Data": ...
}
}
FieldDescriptionType
AttributesIndexable fields to use for pool segmentation. Example Attributes include map, mode, platform. Note that attributes are currently limited to double values. (Optional)Dictionary<string, double>
PropertiesThis field is a map of Base64-encoded strings with the format <string, byte[]>. The byte[] must be a Base64-encoded string. These fields are deserialized and used by the matchmaking rules logic. QosResults, Players, and Data should each contain a Base64-encoded string in the following format:

QosResults: [{"RegionId": "Region1", "PacketLoss": 0.1, "Latency": 23}, {"RegionId": "Region2", "PacketLoss": 0.3, "Latency": 115} } ]

Players: [{"id": "123", "Data": "{}"}, {"id": "456", "Data": "{}"}]

Data: {}
Dictionary<string, byte[]>

Properties - QosResults#

note

The key must be title case. The value must be a Base64-encoded string.

[
{
"RegionId": "{region_id}",
"PacketLoss": ...,
"Latency": ...
},
{
"RegionId": "{region_id}",
"PacketLoss": ...,
"Latency": ...
}
]
FieldDescriptionType
RegionIdContains the id of the QoS region the results belong to.string
PacketLossThe Packet Loss ratio to this QoS region.double
LatencyThe Latency to this QoS region.double

Properties - Players#

note

The key must be title case. The value must be a Base64-encoded string.

[
{
"Id":...,
"Data": {...}
},{
"Id":...,
"Data": {...}
}
]
FieldDescriptionType
IdThe unique ID of the player.string
DataA custom data object (Optional).object

Properties - Data#

note

The key must be title case. The value must be a Base64-encoded string.

{
"{KEY}": VALUE
}
FieldDescriptionType
{KEY}The data name. Will be available at Source="Ticket.Data.{KEY}. See Data Sources for more information on source syntax.string
ValueThe value. See Rules for more information on rules and supported types for each one of them.*

Create Ticket Response#

{
"id": "c0n9vt7k5db25b00sb30"
}
FieldDescriptionType
idThe identifier of the new ticket. Note: This identifier is not guaranteed to be a GUID.string

Get Ticket Response (Polling)#

{
"id": "c083oj7vm1611uflvtsg",
"attributes": {
"created": 1611676748155.0,
"platform": 0.0,
"build": 0.0,
...
},
"properties": {
"QosResults": "eyAiUW9zUmVzdWx0cyI6IHsgIlJlZ2lvbjEiOiB7IlJlZ2lvbklkIjogIlJlZ2lvbjEiLCAiUGFja2V0TG9zcyI6IDAuMSwgIkxhdGVuY3kiOiAyM30sICJSZWdpb24yIjogeyJSZWdpb25JZCI6ICJSZWdpb24yIiwgIlBhY2tldExvc3MiOiAwLjMsICJMYXRlbmN5IjogMTE1fSB9IH0=",
"Players": "W3siaWQiOiAiMTIzIiwgImRhdGEiOiAie30ifSwgeyJpZCI6ICI0NTYiLCAiZGF0YSI6ICJ7fSJ9XQ==",
"Data": "e30=",
"author": "..."
},
"assignment":{
"connection": "127.0.0.1:5000",
"error": "An example of an error",
"properties": "",
"matchproperties": "{\"Teams\":[{\"TeamName\":\"hunters0\",\"TeamDefinitionName\":\"hunters\",\"PlayerIds\":[\"player 1\"]},{\"TeamName\":\"monsters0\",\"TeamDefinitionName\":\"monsters\",\"PlayerIds\":[\"player 2\"]}]}"
}
}
FieldDescriptionType
attributesSubmitted attributes.See Main Contract.
propertiesSubmitted properties.See Main Contract.
createdUnix UTC milliseconds for when the ticket was created. This field is automatically indexed and made available for a query as the attribute "created".long
assignmentAn object containing the outcome of the matchmaking request.object
assignment.connectionConnection information for connecting to the dedicated game server or session.string
assignment.errorA customizable or well-known value for handling matchmaking failures. Several known errors:
  • PoolTimeout (Ticket timed out)
  • AllocationError (Multiplay allocation failed for the match)
  • StandardTicketError (There was an error parsing the ticket. Error details in the matchProperties)
string
assignment.propertiesCurrently not used.object
assignment.matchpropertiesThis data is provided to all players on a ticket and the game server.

In the preceding example, the match properties tell the game client which players are on which team. If assignment.error is non null and has a value of StandardTicketError, this field will include error details.
object

MatchProperties Contract#

The match properties list all teams and their players.

{
"Teams": [{
"TeamName": "hunters0",
"TeamDefinitionName": "hunters",
"PlayerIds": ["player 1"]
}, {
"TeamName": "monsters0",
"TeamDefinitionName": "monsters",
"PlayerIds": ["player 2"]
}
]
}