我正在尝试通过以下方式在我的 Unreal Engine 4 项目中获取 Steam 应用程序 ID 和 Steam 用户 ID:
if (SteamAPI_Init())
{
IOnlineSubsystem* ossBase = IOnlineSubsystem::Get();
FOnlineSubsystemSteam* oss = Cast<FOnlineSubsystemSteam*>(ossBase);
if (!oss) {
printText(TEXT("Steam Subsystem is down!"), FColor::Red.WithAlpha(255));
return;
}
auto SteamID = FString(std::to_string(SteamUser()->GetSteamID().ConvertToUint64()).c_str());
auto AppID = FString(std::to_string(oss->GetSteamAppId()).c_str());
但不可能将 IOnlineSubsystem 转换为 FOnlineSubsystemSteam。那么获取 FOnlineSubsystemSteam 实例的正确方法是什么?