Disable online/login widget while login/logout are in progress (to
avoid race conditions, i.e. a new login arriving at server before previous logout was processed).
This commit is contained in:
@@ -144,6 +144,20 @@ void MainMenuScreen::init()
|
||||
void MainMenuScreen::onUpdate(float delta)
|
||||
|
||||
{
|
||||
if(CurrentUser::get()->getUserState()==CurrentUser::US_GUEST ||
|
||||
CurrentUser::get()->getUserState()==CurrentUser::US_SIGNED_IN)
|
||||
{
|
||||
m_online->setActivated();
|
||||
m_online->setLabel( _("Online"));
|
||||
}
|
||||
else if(CurrentUser::get()->getUserState()==CurrentUser::US_SIGNED_OUT)
|
||||
{
|
||||
m_online->setActivated();
|
||||
m_online->setLabel( _("Login" ));
|
||||
}
|
||||
else // now must be either logging in or logging out
|
||||
m_online->setDeactivated();
|
||||
|
||||
m_online->setLabel(CurrentUser::get()->getID() ? _("Online")
|
||||
: _("Login" ) );
|
||||
IconButtonWidget* addons_icon = getWidget<IconButtonWidget>("addons");
|
||||
|
||||
Reference in New Issue
Block a user