Auto signing in, happens in the background on startup now.

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/uni@13505 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
unitraxx 2013-08-18 23:42:44 +00:00
parent 2428a5f3b0
commit 0c4780a39e
5 changed files with 5 additions and 6 deletions

View File

@ -93,7 +93,7 @@ namespace Online{
}
// ============================================================================
const CurrentUser::SignInRequest * CurrentUser::requestSavedSession()
void CurrentUser::requestSavedSession()
{
SignInRequest * request = NULL;
if(getUserState() != US_SIGNED_IN && UserConfigParams::m_saved_session)
@ -106,7 +106,6 @@ namespace Online{
HTTPManager::get()->addRequest(request);
setUserState (US_SIGNING_IN);
}
return request;
}
CurrentUser::SignInRequest * CurrentUser::requestSignIn( const irr::core::stringw &username,

View File

@ -134,7 +134,7 @@ namespace Online{
static CurrentUser * get();
static void deallocate();
const SignInRequest * requestSavedSession();
void requestSavedSession();
SignInRequest * requestSignIn( const irr::core::stringw &username,
const irr::core::stringw &password,
bool save_session,

View File

@ -57,6 +57,7 @@ namespace Online{
{
http_singleton = new HTTPManager();
http_singleton->startNetworkThread();
CurrentUser::get()->requestSavedSession();
}
return http_singleton;
} // get

View File

@ -75,7 +75,9 @@ namespace Online{
bool HTTPRequest::isAllowedToAdd()
{
if (!Request::isAllowedToAdd() || m_url.size() < 5 || ( m_url.substr(0, 5) != "http:"))
{
return false;
}
return true;
}

View File

@ -57,9 +57,6 @@ DEFINE_SCREEN_SINGLETON( OnlineScreen );
OnlineScreen::OnlineScreen() : Screen("online/main.stkgui")
{
m_recorded_state = CurrentUser::US_SIGNED_OUT;
const CurrentUser::SignInRequest * request = CurrentUser::get()->requestSavedSession();
if(request != NULL)
m_requests.push_back(request);
} // OnlineScreen
// ----------------------------------------------------------------------------