您好,
<br/>
我们希望强制玩家通过Steam拉起游戏,我们看到引擎的OSS Steam有这样一段逻辑
<br/>
/**
* Get relaunch settings from OnlineSubsystemSteam configuration
*
* @param RequireRelaunch enforce the Steam client running precondition
* @param RelaunchAppId appid to launch when the Steam client is loaded
*
* @return if this sequence completed without any serious errors
*/
bool GetRelaunchSettings(bool& RequireRelaunch, int32& RelaunchAppId)
{
#if !UE_BUILD_SHIPPING && !UE_BUILD_SHIPPING_WITH_EDITOR
// Get SteamDevAppId and set it as RelaunchAppId
if (!GConfig->GetInt(TEXT("OnlineSubsystemSteam"), TEXT("SteamDevAppId"), RelaunchAppId, GEngineIni))
{
UE_LOG_ONLINE(Warning, TEXT("Missing SteamDevAppId key in OnlineSubsystemSteam of DefaultEngine.ini"));
return false;
}
// Should the game force a relaunch in Steam if the client isn't already loaded
if (!GConfig->GetBool(TEXT("OnlineSubsystemSteam"), TEXT("bRelaunchInSteam"), RequireRelaunch, GEngineIni))
{
UE_LOG_ONLINE(Warning, TEXT("Missing bRelaunchInSteam key in OnlineSubsystemSteam of DefaultEngine.ini"));
}
#else
// Always check against the Steam client when shipping
RequireRelaunch = true;
RelaunchAppId = UE_PROJECT_STEAMSHIPPINGID;
#endif
return true;
}
<br/>
在Shipping版本下,看上去只有改变UE_PROJECT_STEAMSHIPPINGID这个宏才能指定Steam的AppId,但只有重编引擎才能修改UE_PROJECT_STEAMSHIPPINGID这个宏。在使用官方构建好的引擎版本时,有没有什么好的办法实现这个功能?
[Attachment Removed]