The assert could be triggered when a new sign-in request was sent before the first one was resolved, usually when using the enter key to request the sign in. Since it can happen in normal operations to have the player profile status different from signing out or signed out, an assert is incorrect.

Also fix server-only compilation for the previous commit.
This commit is contained in:
Alayan 2024-04-28 21:43:42 +02:00
parent 01d62be5de
commit e64e2d8cd5
No known key found for this signature in database
2 changed files with 7 additions and 5 deletions

View File

@ -107,7 +107,6 @@ namespace Online
m_online_state = OS_SIGNED_OUT;
m_token = "";
m_profile = NULL;
} // OnlinePlayerProfile
// ------------------------------------------------------------------------
@ -136,10 +135,11 @@ namespace Online
void OnlinePlayerProfile::requestSignIn(const core::stringw &username,
const core::stringw &password)
{
// If the player changes the online account, there can be a
// logout stil happening.
assert(m_online_state == OS_SIGNED_OUT ||
m_online_state == OS_SIGNING_OUT);
// Avoid multiple sign in requests from happening at once,
// this can occur for example when using the enter key to request a sign-in.
if (m_online_state != OS_SIGNED_OUT && m_online_state != OS_SIGNING_OUT)
return;
auto request = std::make_shared<PrivateRequest::SignInRequest>();
// We can't use setUserDetail here, since there is no token yet

View File

@ -933,6 +933,7 @@ void OptionsScreenVideo::eventCallback(Widget* widget, const std::string& name,
} // scale_rtts
else if (name == "benchmarkCurrent")
{
#ifndef SERVER_ONLY
// TODO - Add the possibility to benchmark more tracks and define replay benchmarks in
// a config file
const std::string bf_bench("benchmark_black_forest.replay");
@ -961,6 +962,7 @@ void OptionsScreenVideo::eventCallback(Widget* widget, const std::string& name,
{
startBenchmark();
}
#endif
} // benchmarkCurrent
// TODO - Add a standard benchmark testing multiple presets
/*else if (name == "benchmarkStandard")