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

# 使用舊版 Unreal Engine 4

> 將 PlayFab Party Online Subsystem 與舊版 Unreal Engine 4 整合，包括舊版 UE4 專案的原始碼修補和相容性注意事項。

雖然 PlayFab Online Subsystem (OSS) 並未正式支援，但完全可以在舊版 Unreal Engine 4 上使用它。只需稍微調整介面函式名稱和簽章，核心網路功能就能移轉回較早版本的 Unreal Engine 4，其中某些執行個體會重新命名或移除，以符合舊版 Unreal Engine 4 OSS 介面。

## 1.07 版及更早版本的 XDK 支援

* 對遊戲 (而非引擎) 的 INI 檔案 'XboxOneEngine.ini' 套用下列變更
* 如果 INI 區段已存在 (例如 Engine.GameEngine)，請加以取代
* 請確定已將所有 *\<REPLACE ME>* 欄位取代為您的資料。

```
[OnlineSubsystem]
DefaultPlatformService=PlayFab
NativePlatformService=Live

[OnlineSubsystemPlayFab]
bEnabled=true
PlayFabTitleID=<REPLACE ME with your PlayFab title ID>
MaxDeviceCount=<REPLACE ME with your max player count (note: split screen is still 1 device). In the example of an 8 player game, this would be 8.>
MaxDevicesPerUserCount=<REPLACE ME with your max player count per box (note: split screen is still 1 device) In the example of an 8 player game, this would be 1.>	
MaxEndpointsPerDeviceCount=<REPLACE ME with your max player count per box (note: split screen is still 1 device)  In the example of an 8 player game, this would be 1.>
MaxUserCount=<REPLACE ME with your max player count (note: split screen is still 1 device)  In the example of an 8 player game, this would be 8.>		
MaxUsersPerDeviceCount=<REPLACE ME with your max player count per box (note: split screen is still 1 device)  In the example of an 8 player game, this would be 1.>

[/Script/OnlineSubsystemPlayFab.PlayFabNetDriver]
NetConnectionClassName="OnlineSubsystemPlayFab.PlayFabNetConnection"
ReplicationDriverClassName="<REPLACE ME with your existing replication driver class name>"
ConnectionTimeout=15.0
InitialConnectTimeout=30.0

[/Script/Engine.GameEngine]
!NetDriverDefinitions=ClearArray
+NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="OnlineSubsystemPlayFab.PlayFabNetDriver",DriverClassNameFallback="OnlineSubsystemUtils.IpNetDriver")
```

## 啟用 XDK 與 GDK 之間的跨世代遊玩

Unreal Engine 4 中的預設遊戲實作會驗證傳入的遠端 Net ID 與本機執行個體屬於相同的子系統類型，因此 XDK 與 GDK 之間的跨平台遊玩會有不同的類型，需要您進行下列其中一項變更：

* 在 GameMode 中覆寫此函式，並實作不需要此檢查的 PreLogin 函式，或為 NetID 傳遞 nullptr 給基底函式以略過檢查。
  * 您可能已經覆寫了此類別
  * 編輯基底函式 AGameMode::PreLogin 以移除 OSS 類型檢查 (**bUniqueIdCheckOk**)


## Related topics

- [開始使用 Unreal Engine 進行 PC 開發](https://docs.xbox.com/zh-TW/build/gdk-and-engines/unreal/unreal.md)
- [PC 的 Unreal 開發：開始使用 (舊版)](https://docs.xbox.com/zh-TW/build/gdk-and-engines/unreal/unreal-legacy.md)
- [適用於 Unreal 的 PlayFab Party Online Subsystem](https://docs.xbox.com/zh-TW/build/console-features/networking/game-mesh/party-unreal-online-subsystem.md)
- [PlayFab Online Subsystem (OSS)](https://docs.xbox.com/zh-TW/services/playfab/multiplayer/networking/party-unreal-engine-oss-overview.md)
- [開始使用 Unity 進行 PC 開發 (內容)](https://docs.xbox.com/zh-TW/build/gdk-and-engines/unity/unity.md)
