kest-han (Customer) asked a question.
i use ue5.3.2,update eossdk to 1.16.3, when i set the param: EOS_Platform_Options.TaskNetworkTimeoutSeconds to 90, that is invalid! please help me!
in OnlineSubsystemEOS.cpp
- bool FOnlineSubsystemEOS::PlatformCreate()
- {
- //...........Omit the above
-
-
- EOS_Platform_Options PlatformOptions = {};
- PlatformOptions.ApiVersion = EOS_PLATFORM_OPTIONS_API_LATEST;
- UE_EOS_CHECK_API_MISMATCH(EOS_PLATFORM_OPTIONS_API_LATEST, EOS_PLATFORM_OPTIONS_API_LATEST);
- PlatformOptions.ClientCredentials.ClientId = reinterpret_cast<const char*>(ArtifactSettings.ClientId.IsEmpty() ? nullptr : (const char*)ClientIdUtf8.Get());
- PlatformOptions.ClientCredentials.ClientSecret = ArtifactSettings.ClientSecret.IsEmpty() ? nullptr : (const char*)ClientSecretUtf8.Get();
- PlatformOptions.ProductId = ArtifactSettings.ProductId.IsEmpty() ? nullptr : (const char*)ProductIdUtf8.Get();
- PlatformOptions.SandboxId = ArtifactSettings.SandboxId.IsEmpty() ? nullptr : (const char*)SandboxIdUtf8.Get();
- PlatformOptions.DeploymentId = ArtifactSettings.DeploymentId.IsEmpty() ? nullptr : (const char*)DeploymentIdUtf8.Get();
- PlatformOptions.EncryptionKey = ArtifactSettings.EncryptionKey.IsEmpty() ? nullptr : (const char*)EncryptionKeyUtf8.Get();
- PlatformOptions.bIsServer = IsRunningDedicatedServer() ? EOS_TRUE : EOS_FALSE;
- PlatformOptions.Reserved = nullptr;
-
- double timeout = 90;
- PlatformOptions.TaskNetworkTimeoutSeconds = &timeout;
-
- //..............
- }
-
Hello, the double is declared in the function. Once this function executes, it will go out of scope. Therefore TaskNetworkTimeoutSeconds will be pointing to an invalid pointer. Try declaring it as a class member variable rather than a variable in this function.