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

# 使用旧版本 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 支持

* 将下面的更改应用到 Game(而非 Engine)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 函数,或将 nullptr 作为 NetID 传递给基本函数,以跳过检查。
  * 你可能已经重写了此类
  * 编辑基本函数 AGameMode::PreLogin 以移除 OSS 类型检查 (**bUniqueIdCheckOk**)


## Related topics

- [PlayFab Online Subsystem (OSS)](/zh-CN/services/playfab/multiplayer/networking/party-unreal-engine-oss-overview.md)
- [在 Unreal Engine 中使用 GDK](/zh-CN/build/gdk-and-engines/unreal/unreal.md)
- [将 GDK 集成到 4.26 之前的 Unreal Engine 项目](/zh-CN/build/gdk-and-engines/unreal/unreal-legacy.md)
- [chat_manager::set_legacy_era_uwp_compat_mode_enabled](/zh-CN/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_set_legacy_era_uwp_compat_mode_enabled.md)
- [使用 GDK 项目模板启动新的 PC 作品](/zh-CN/build/gdk-and-engines/guides/gdk-project-templates.md)
