# 将排行榜分到排行榜组中

> 让智能体把游戏的排行榜放进 Game Center 排行榜组（例如每个世界或每个赛季一组），用每种语言为每个组命名，并把这些组送交 App 审核。

Source: https://air.build/cn/docs/app-store/group-leaderboards-into-sets/

排行榜组把游戏的多个排行榜放在一个名称下。Apple 的帮助说明，排行榜组把多个排行榜组织成一个单元，例如一个组包含游戏各关卡的排行榜。一个排行榜可以属于多个组，并在每个组中使用不同的名称。参见 Apple 的 [Manage leaderboard sets](https://developer.apple.com/help/app-store-connect/configure-game-center/manage-leaderboard-sets)。

> [!NOTE]
> AirBuild 没有 Game Center 界面。请在项目的聊天中询问智能体，它会使用 `asc game-center leaderboard-sets`（列在 [asc：App 与 App Store 页面](https://air.build/cn/docs/cli/asc-apps/#game-center) 的 `game-center` 下）。要查看结果，可以询问智能体，或者在 App Store Connect 中打开你的 App。

## 请求之前

- 游戏需要先有 Game Center 和它的排行榜。参见[添加 Game Center 排行榜和成就](https://air.build/cn/docs/app-store/add-game-center-leaderboards/)。
- 排行榜组会改变游戏排行榜的管理方式。Apple 的帮助说明，你创建第一个组时，App Store Connect 会确保每个现有排行榜至少属于一个组，并且从那以后，该 App 的每个新排行榜都必须放进某个组。创建第一个组之前，请阅读 Apple 的 [Manage leaderboard sets](https://developer.apple.com/help/app-store-connect/configure-game-center/manage-leaderboard-sets)。

## 请求排行榜组

在项目的聊天中说明哪些排行榜放在一起，以及每个组叫什么，例如：

```text
Put the leaderboards for levels 1 to 3 in a set called "World 1" and the rest in "World 2". Name the sets in English and German, and make a picture for each.
```

1. 智能体用 `asc game-center leaderboard-sets create` 创建每个组：一个参考名称、一个组 ID，以及放进去的排行榜。
2. 它用 `asc game-center leaderboard-sets localizations create` 逐种语言添加每个组的名称。
3. 它用 `asc game-center leaderboard-sets images upload` 为某种语言上传一张 PNG 图片。
4. 如果某个排行榜在组中应该使用别的名称，它会用 `asc game-center leaderboard-sets member-localizations create` 添加该名称。
5. 它会在聊天中告诉你创建了什么。要随时查看，可以询问“游戏有哪些排行榜组，每个组里有什么？”。智能体会用 `asc game-center leaderboard-sets list` 和 `asc game-center leaderboard-sets members list` 读取它们。

图片可以由智能体制作（参见[让智能体为你的 App 制作图片](https://air.build/cn/docs/build/make-pictures-for-your-app/)），也可以在聊天中发送你自己的图片（参见[向智能体发送照片、文件和草图](https://air.build/cn/docs/projects/send-photos-and-files/)）。

## 添加或移动排行榜

要把新排行榜直接加进某个组，请在请求该排行榜时说明是哪个组。智能体会用 `asc game-center leaderboards create --set-ids` 创建它。

要更改某个组包含哪些排行榜，请说出该组应包含的完整列表：

```text
"World 2" should hold the leaderboards for levels 4, 5 and 6 only.
```

智能体会使用 `asc game-center leaderboard-sets members set`。它的帮助说明，它会用给出的排行榜替换组中的全部排行榜，所以你没有列出的排行榜都会离开该组。因此它需要 `--confirm`，智能体会先问你。

## 送交 App 审核

让智能体把新的组放进你下一次 App 审核提交中，例如：

```text
Add the World 1 and World 2 leaderboard sets to the App Review submission for version 1.3.
```

智能体会用 `asc review items add` 添加它们，该命令的帮助把排行榜组列为提交可以包含的项目之一（参见 [asc：审核与发布](https://air.build/cn/docs/cli/asc-release/#review) 中的 `review`）。然后像往常一样提交版本。**App 审核** 标签页上的 **提交审核** 会发送正在组建的提交，所以这些组会随版本一起提交。参见[提交 App 审核并发布](https://air.build/cn/docs/app-store/submit-for-review/#submit-a-version)。

关于排行榜组何时需要随版本提交、何时可以单独送审，参见 Apple 的 [Submit Game Center components](https://developer.apple.com/help/app-store-connect/manage-submissions-to-app-review/submit-game-center-components)。

## 重命名或删除组

- 要更改玩家看到的组名称，请说出新名称和语言。智能体会使用 `asc game-center leaderboard-sets localizations update`。供你自己使用的参考名称用 `asc game-center leaderboard-sets update` 更改。
- 要删除组，请询问智能体。`asc game-center leaderboard-sets delete` 需要 `--confirm`，所以它会先问你。`asc` 没有恢复已删除组的命令。Apple 的帮助说明了删除组之前组中的排行榜需要怎样处理：参见 [Manage leaderboard sets](https://developer.apple.com/help/app-store-connect/configure-game-center/manage-leaderboard-sets)。

## 常见问题

**一个排行榜可以属于两个组吗？**

可以。Apple 的帮助说明，一个排行榜可以属于多个组，并在每个组中使用不同的名称。请告诉智能体它在每个组中应该使用的名称。

**可以恢复到没有组的状态吗？**

`asc` 没有这样的命令。Apple 的 [Manage leaderboard sets](https://developer.apple.com/help/app-store-connect/configure-game-center/manage-leaderboard-sets) 说明了如何在 App Store Connect 网页版中移除所有组。

**智能体说该 App 不存在 Game Center 详细信息。**

当 App 在 App Store Connect 中还没有设置 Game Center 时，`asc` 会显示“Warning: no Game Center detail exists for this app.”，例如在智能体查找它的排行榜时。请先让智能体设置 Game Center：参见[添加 Game Center 排行榜和成就](https://air.build/cn/docs/app-store/add-game-center-leaderboards/)。

**我的多个游戏共享 Game Center。这个群组可以有排行榜组吗？**

可以，排行榜组可以属于 Game Center 群组。参见[在你的多个游戏之间共享排行榜和成就](https://air.build/cn/docs/app-store/share-game-center-between-your-games/)。
