使用较旧版本的 Unreal Engine 4

虽然 PlayFab Online 子系统 (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 中的默认游戏实现验证传入的远程网络 ID 是否与本地实例具有相同的子系统类型,因此 XDK 和 GDK 之间的交叉玩法将具有不同的类型,并要求您进行以下更改之一:

  • 重写 GameMode 中的函数并实现不需要此检查的 PreLogin 函数,或将 nullptr 传递给 NetID 的基函数,从而跳过检查。
    • 你可能已重写此类
    • 编辑基本函数 AGameMode::P reLogin 以删除 OSS 类型检查(bUniqueIdCheckOk