Track online-enable and network-service settings per-account instead of globally

This commit is contained in:
Exzap 2024-05-06 18:18:42 +02:00
parent 065fb7eb58
commit 3f8722f0a6
8 changed files with 164 additions and 102 deletions

View file

@ -131,7 +131,12 @@ uint32 ActiveSettings::GetPersistentId()
bool ActiveSettings::IsOnlineEnabled()
{
return GetConfig().account.online_enabled && Account::GetAccount(GetPersistentId()).IsValidOnlineAccount() && HasRequiredOnlineFiles();
if(!Account::GetAccount(GetPersistentId()).IsValidOnlineAccount())
return false;
if(!HasRequiredOnlineFiles())
return false;
NetworkService networkService = static_cast<NetworkService>(GetConfig().GetAccountNetworkService(GetPersistentId()));
return networkService == NetworkService::Nintendo || networkService == NetworkService::Pretendo || networkService == NetworkService::Custom;
}
bool ActiveSettings::HasRequiredOnlineFiles()
@ -139,8 +144,9 @@ bool ActiveSettings::HasRequiredOnlineFiles()
return s_has_required_online_files;
}
NetworkService ActiveSettings::GetNetworkService() {
return static_cast<NetworkService>(GetConfig().account.active_service.GetValue());
NetworkService ActiveSettings::GetNetworkService()
{
return GetConfig().GetAccountNetworkService(GetPersistentId());
}
bool ActiveSettings::DumpShadersEnabled()