> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# MatchTicket (JSON)

> MatchTicket (JSON)

# MatchTicket (JSON)

表示匹配票证的 JSON 对象,由玩家用来通过多人会话目录 (MPSD) 定位其他玩家。

MatchTicket JSON 对象具有以下规范。

| 成员 | 类型 | 说明 |
| - | - | - |
| serviceConfig | GUID | 会话的服务配置标识符 (SCID)。 |
| hopperName | string | 应放置此票据的 hopper 的名称。 |
| giveUpDuration | 32 位有符号整数 | 最大等待时间(整数秒)。 |
| preserveSession | 枚举 | 指示是否必须将会话重用为要匹配到的会话的值。可能的值为 “always” 或 “never”。 |
| ticketSessionRef | MultiplayerSessionReference | 玩家或团队当前所在游戏会话的 **MultiplayerSessionReference** 对象。此成员始终为必需。 |
| ticketAttributes | 对象数组 | 玩家票据的用户提供属性和值集合。 |
| players | 对象数组 | player 对象的集合,每个对象都包含一个用户提供属性的属性包。 |

## JSON 语法示例

```json theme={null}
{
        "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"
          }
        }
      ]
    }
  
    
```

## 另请参阅

##### 父主题

[JavaScript 对象表示法 (JSON) 对象参考](https://devdocs.xbox.com/zh-CN/reference/live/rest/json/atoc-xboxlivews-reference-json)


## Related topics

- [Using SmartMatch matchmaking](https://devdocs.xbox.com/services/xbox-services/multiplayer/matchmaking/concepts/live-matchmaking-how-tos.md)
- [Matchmaking overview](https://devdocs.xbox.com/services/xbox-services/multiplayer/matchmaking/live-matchmaking-overview.md)
- [Multiplayer tasks](https://devdocs.xbox.com/services/xbox-services/multiplayer/mpsd/how-to/live-mpsd-how-tos.md)
- [Multiplayer concepts overview](https://devdocs.xbox.com/services/xbox-services/multiplayer/concepts/live-multiplayer-concepts.md)
- [Matchmaking quickstart](https://devdocs.xbox.com/services/playfab/multiplayer/matchmaking/quickstart.md)
