Fix cases where stk connects to the internet while the user forbid it, see #3319

This commit is contained in:
auria.mg 2018-11-22 20:32:38 -05:00
parent 8995027d42
commit 3ff0724cb4
2 changed files with 13 additions and 2 deletions

View File

@ -122,7 +122,8 @@ namespace Online
// current player would not be defined at this stage.
PlayerProfile *player = PlayerManager::getCurrentPlayer();
if (player && player->wasOnlineLastTime() &&
!UserConfigParams::m_always_show_login_screen)
!UserConfigParams::m_always_show_login_screen &&
UserConfigParams::m_internet_status != RequestManager::IPERM_NOT_ALLOWED)
{
PlayerManager::resumeSavedSession();
}
@ -164,6 +165,12 @@ namespace Online
*/
void RequestManager::addRequest(Request *request)
{
if (UserConfigParams::m_internet_status == RequestManager::IPERM_NOT_ALLOWED)
{
Log::error("RequestManager", "addRequest called, but internet connections are forbidden");
return;
}
assert(request->isPreparing());
request->setBusy();
m_request_queue.lock();

View File

@ -257,7 +257,11 @@ void BaseUserScreen::selectUser(int index)
}
// Now last use was with online --> Display the saved data
m_online_cb->setState(true);
if (UserConfigParams::m_internet_status == Online::RequestManager::IPERM_NOT_ALLOWED)
m_online_cb->setState(false);
else
m_online_cb->setState(true);
makeEntryFieldsVisible();
m_username_tb->setActive(profile->getLastOnlineName().size() == 0);