> ## 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 和 DynamicStandby BuildRegionParams 物件，以程式設計方式調整 PlayFab 多人遊戲伺服器的規模，實現依需求的待命。

## 動態待命物件

動態待命功能在多人遊戲程式設計介面中引進了一個名為 `DynamicStandby` 的新物件。動態待命物件是 [BuildRegionParams](https://learn.microsoft.com/en-us/rest/api/playfab/multiplayer/multiplayerserver/updatebuildregions#buildregionparams) 物件的選擇性屬性。

設定動態待命需要編輯動態待命物件的設定屬性。修改屬性的預設值是進階的遊戲伺服器功能，必須謹慎進行。

## 排程待命物件

排程待命功能在多人遊戲程式設計介面中引進了一個名為 `ScheduledStandby` 的新物件。排程待命物件是 [BuildRegionParams](https://learn.microsoft.com/en-us/rest/api/playfab/multiplayer/multiplayer-server/update-build-regions#buildregionparams) 物件的選擇性屬性。

設定排程待命需要編輯排程待命物件的設定屬性。修改屬性的預設值是進階的遊戲伺服器功能，必須謹慎進行。

## 以程式設計方式啟用待命調整規模

您可以呼叫下列任一多人遊戲伺服器 API，以程式設計方式啟用動態或排程待命：

1. 覆寫 [Update Build Regions](https://learn.microsoft.com/en-us/rest/api/playfab/multiplayer/multiplayer-server/update-build-regions)\
   *UPSERT：將資料列插入資料庫資料表 (如果尚不存在) 或更新資料列 (如果已存在) 的作業。*
2. [Create Build with Custom Container](https://learn.microsoft.com/en-us/rest/api/playfab/multiplayer/multiplayerserver/createbuildwithcustomcontainer)
3. [Create Build with Managed Container](https://learn.microsoft.com/en-us/rest/api/playfab/multiplayer/multiplayer-server/create-build-with-managed-container)

若要以程式設計方式啟用動態或排程待命，請將 `Mode` 屬性切換為 ON。`Mode` 是動態待命或排程待命設定物件唯一必要的屬性。其預設值為 **OFF**。


## Related topics

- [使用 PlayFab 多人遊戲伺服器裝載多人遊戲](/zh-TW/services/playfab/multiplayer/servers/using-playfab-servers-to-host-games.md)
- [伺服器](/zh-TW/services/playfab/multiplayer/servers/index.md)
- [PIXBeginCapture](/zh-TW/reference/tools/pix3/functions/pixbegincapture.md)
- [PIXEndCapture](/zh-TW/reference/tools/pix3/functions/pixendcapture.md)
- [玩家禁止系統](/zh-TW/services/playfab/player-progression/player-data/player-bans.md)
