Version: en

Contracts - Standard Ticket

warning

This documentation is now deprecated. If you are using Matchmaker Self Serve though UDash, please use the documentation here.

Main Contract#

{
"attributes": {...},
"properties": {
"qos": ...,
"players": ...,
"data": ...
}
}
FieldDescriptionType
attributesIndexable fields to use when querying for tickets from inside of match functions. Example attributes include map, mode, platform, players in the ticket, team skill, and games won. 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 logic. qos, players, and data should each contain a Base64-encoded string in the following format:

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

players: [{"id": "123", "data": "{}"}, {"id": "456", "data": "{}"}]

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

Properties - QoS#

note

The key must be lowercase. The value must be a Base64-encoded string.

{
"QosResults":{
"{region_id1}": {"standard_qos_result1"},
"{region_id2}": {"standard_qos_result2"}
}
}
FieldDescriptionType
QosResultsIs an object that holds a dictionary of StandardQoSResult that is indexed by the RegionId for each result.Dictionary<string,StandardQoSResult>

Properties - QoS - StandardQoSResult#

{
"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 lowercase. 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)(currently not used).object

Properties - Data#

note

The key must be lowercase. The value must be a Base64-encoded string.

note

This field is currently not used. This field is optional.

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": {
"qos": "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 timedout)
  • 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"]
}
]
}