Merge branch 'DisableInternetConnection'
This commit is contained in:
@@ -2355,11 +2355,14 @@ static void cleanSuperTuxKart()
|
||||
}
|
||||
#endif
|
||||
|
||||
if(!Online::RequestManager::get()->waitForReadyToDeleted(5.0f))
|
||||
if (Online::RequestManager::get()->waitForReadyToDeleted(5.0f))
|
||||
{
|
||||
Log::info("Thread", "Request Manager not aborting in time, aborting.");
|
||||
Online::RequestManager::deallocate();
|
||||
}
|
||||
else
|
||||
{
|
||||
Log::warn("Thread", "Request Manager not aborting in time, proceeding without cleanup.");
|
||||
}
|
||||
Online::RequestManager::deallocate();
|
||||
|
||||
if (!SFXManager::get()->waitForReadyToDeleted(2.0f))
|
||||
{
|
||||
|
||||
@@ -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,13 @@ namespace Online
|
||||
*/
|
||||
void RequestManager::addRequest(Request *request)
|
||||
{
|
||||
if (UserConfigParams::m_internet_status == RequestManager::IPERM_NOT_ALLOWED
|
||||
&& request->getType() != Request::RT_QUIT)
|
||||
{
|
||||
Log::error("RequestManager", "addRequest called, but internet connections are forbidden");
|
||||
return;
|
||||
}
|
||||
|
||||
assert(request->isPreparing());
|
||||
request->setBusy();
|
||||
m_request_queue.lock();
|
||||
|
||||
@@ -152,9 +152,17 @@ void OptionsScreenGeneral::eventCallback(Widget* widget, const std::string& name
|
||||
{
|
||||
CheckBoxWidget* internet = getWidget<CheckBoxWidget>("enable-internet");
|
||||
assert( internet != NULL );
|
||||
UserConfigParams::m_internet_status =
|
||||
internet->getState() ? RequestManager::IPERM_ALLOWED
|
||||
: RequestManager::IPERM_NOT_ALLOWED;
|
||||
|
||||
// If internet is being activated, enable immediately. If it's being disabled,
|
||||
// we'll disable later after logout.
|
||||
if (internet->getState())
|
||||
{
|
||||
UserConfigParams::m_internet_status = RequestManager::IPERM_ALLOWED;
|
||||
|
||||
if (!RequestManager::isRunning())
|
||||
RequestManager::get()->startNetworkThread();
|
||||
}
|
||||
|
||||
// If internet gets enabled, re-initialise the addon manager (which
|
||||
// happens in a separate thread) so that news.xml etc can be
|
||||
// downloaded if necessary.
|
||||
@@ -182,6 +190,10 @@ void OptionsScreenGeneral::eventCallback(Widget* widget, const std::string& name
|
||||
if (profile != NULL && profile->isLoggedIn())
|
||||
profile->requestSignOut();
|
||||
}
|
||||
|
||||
// Deactivate internet after 'requestSignOut' so that the sign out request is allowed
|
||||
if (!internet->getState())
|
||||
UserConfigParams::m_internet_status = RequestManager::IPERM_NOT_ALLOWED;
|
||||
}
|
||||
else if (name=="enable-hw-report")
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user