> ## 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.

# 張貼伺服器最近玩家群組

> 張貼伺服器最近玩家群組

# 張貼伺服器最近玩家群組

附加至或更新群組內所有使用者的最近玩家 (雙向)。

此 API 可讓遊戲伺服器附加至一組使用者的最近玩家清單，並更新現有的最近玩家項目。群組內的所有使用者都會新增至彼此的最近玩家清單 (雙向)。

最近玩家群組範例：\[ \[A,B,C], \[A,D], \[E,F] ]。

A 遇到了 B、C 和 D。B 遇到了 A 和 C。D 只遇到了 A，依此類推。

```http theme={null}
POST /titles/{titleId}/recentplayergroups/server
```

<a id="uri-parameters" />

## URI 參數

| 參數 | 位置 | 必要 | 類型 | 描述 |
| - | - | - | - | - |
| titleId | path | TRUE | integer | 傳送要求的目標遊戲 titleId。 |

<a id="request-header" />

## 要求標頭

| 名稱 | 必要 | 類型 | 描述 |
| - | - | - | - |
| Authorization | TRUE | integer | 呼叫者必須以 XBL 3.0 授權格式提供 XToken。例如，Authorization: XBL3.0 x=2553948354698;>encrypted token\<) |
| Content-Type | TRUE | string | ContentType 必須設定為 application/json |

<a id="request-body" />

## 要求本文

| 名稱 | 必要 | 類型 | 描述 |
| - | - | - | - |
| recentPlayerGroups | TRUE | [RecentPlayerGroup](#recentplayergroup)\[] | 雙向最近玩家群組的陣列。應至少有 1 個群組，最多 20 個群組。每個群組內應至少有 2 位玩家，最多 100 位。 |

<a id="responses" />

## 回應

| 名稱 | 類型 | 描述 |
| - | - | - |
| 204 No Content | | 已成功傳送最近玩家要求。 |
| 400 Bad Request | [ErrorResponse](#errorresponse) | 處理要求時發生錯誤。可能的錯誤碼："RequestValidationError: The request validation has failed.", " AuthorizationError: The caller is not allowed to access the resource." |
| 其他狀態碼 | [ThrottledEntity](#throttledentity) | 要求過多。標頭 Retry-After: integer |

<a id="definitions" />

## 定義

* [BidirectionalRecentPlayer](#bidirectionalrecentplayer)
* [EncounterType](#encountertype)
* [ErrorResponse](#errorresponse)
* [Network](#network)
* [RecentPlayerGroup](#recentplayergroup)
* [ServerRecentPlayerGroupsRequest](#serverrecentplayergroupsrequest)
* [ThrottledEntity](#throttledentity)

<a id="bidirectionalrecentplayer" />

### BidirectionalRecentPlayer

| 名稱 | 類型 | 描述 |
| - | - | - |
| id | string | 另一位使用者的識別碼 (十進位整數 XUID)。 |
| network | [Network](#network) | 遇到另一位使用者的網路。 |

<a id="encountertype" />

### EncounterType

最近玩家相遇的類型。此欄位為選擇性，預設為 Default。Default 沒有規定的意義，由呼叫者自行適當解讀此值。

| 名稱 | 類型 | 描述 |
| - | - | - |
| Default | string | |
| Opponent | string | |
| Teammate | string | |

<a id="errorresponse" />

### ErrorResponse

| 名稱 | 類型 | 描述 |
| - | - | - |
| debugMessage | string | 可用於偵錯的人類可讀錯誤訊息版本。 |
| errorCode | string | 錯誤碼列舉。 |

<a id="network" />

### Network

| 名稱 | 類型 | 描述 |
| - | - | - |
| XboxLive | string | |

<a id="recentplayergroup" />

### RecentPlayerGroup

群組內的所有使用者都在指定的時間彼此相遇。每個群組必須包含至少 2 位、最多 100 位使用者。

| 名稱 | 類型 | 描述 |
| - | - | - |
| encounterType | [EncounterType](#encountertype) | 最近玩家相遇的類型。此欄位為選擇性，預設為 Default。Default 沒有規定的意義，由呼叫者自行適當解讀此值。 |
| recentPlayers | [BidirectionalRecentPlayer](#bidirectionalrecentplayer)\[] | |
| timestamp | string | |

<a id="serverrecentplayergroupsrequest" />

### ServerRecentPlayerGroupsRequest

群組內的所有使用者都在指定的時間彼此相遇。每個群組必須包含至少 2 位、最多 100 位使用者。

| 名稱 | 類型 | 描述 |
| - | - | - |
| recentPlayerGroups | [RecentPlayerGroup](#recentplayergroup) | 雙向最近玩家群組的陣列。應至少有 1 個群組，最多 20 個群組。每個群組內應至少有 2 位玩家，最多 100 位。 |

<a id="throttledentity" />

### ThrottledEntity

| 名稱 | 類型 | 描述 |
| - | - | - |
| currentRequests | string | 目前的要求數 - 並行或速率。 |
| debugMessage | string | 可用於偵錯的人類可讀節流訊息版本。 |
| limitType | string | 限制類型，即並行或速率。 |
| maxRequests | string | 允許的最大要求數 - 並行或速率。 |
| periodInSeconds | string | 超過速率或並行限制時套用的期間 (以秒為單位)。 |
| version | string | 目前的節流合約版本。 |


## Related topics

- [使用伺服器回填票證 - REST API](/zh-TW/services/playfab/multiplayer/matchmaking/backfill-tickets.md)
- [最近的玩家](/zh-TW/services/xbox-services/multiplayer/mpa/concepts/live-mpa-recent-players.md)
- [最近玩家](/zh-CN/services/xbox-services/multiplayer/mpa/concepts/live-mpa-recent-players.md)
- [使用實體物件儲存玩家資料](/zh-TW/services/playfab/live-service-management/game-configuration/entities/entity-objects.md)
- [實體檔案](/zh-TW/services/playfab/live-service-management/game-configuration/entities/entity-files.md)
