MatchTicket (JSON)
表示匹配票证的 JSON 对象,玩家用于通过多人游戏会话目录 (MPSD) 定位其他玩家。
MatchTicket JSON 对象具有以下规范。
成员 | 类型 | 说明 |
---|---|---|
serviceConfig | GUID | 会话的服务配置标识符 (SCID)。 |
hopperName | 字符串 | 票证应在其中放置的漏斗的名称。 |
giveUpDuration | 32 位有符号整数 | 最大等待时间(秒数整数)。 |
preserveSession | 枚举 | 指示会话是否必须要重复用作匹配到其中的会话的值。 可能的值为“始终”或“从不”。 |
ticketSessionRef | MultiplayerSessionReference | 玩家或组当前正在其中玩游戏的会话的 MultiplayerSessionReference 对象。 此成员始终是必需的。 |
ticketAttributes | 对象数组 | 用户提供的有关玩家票证的属性和值的集合。 |
玩家 | 对象数组 | 玩家对象的集合,每个集合都有一个用户提供属性的属性包。 |
示例 JSON 语法
{
"serviceConfig": "07617C5B-3423-4505-B6C6-10A16E1E5DDB",
"hopperName": "TestHopper",
"giveUpDuration": 10,
"preserveSession": "never",
"ticketSessionRef": {
"scid": "AFFEABDF-0000-0000-0000-000000000001",
"templateName": "TestTemplate",
"sessionName": "5E551041-0000-0000-0000-000000000001"
},
"ticketAttributes": {
"desiredMap": "Test Map",
"desiredGameType": "Test GameType"
},
"players": [
{
"xuid": 123412345123,
"playerAttributes": {
"skill": 5,
"ageRange": "teenager"
}
},
{
"xuid": 123412345124,
"playerAttributes": {
"skill": 15,
"ageRange": "twenty-something"
}
}
]
}