mirror of
https://github.com/ppy/osu.git
synced 2025-01-30 03:42:56 +08:00
Make config the definitive status value
This commit is contained in:
parent
20108e3b74
commit
b7a9b77efe
@ -211,7 +211,7 @@ namespace osu.Game.Configuration
|
|||||||
SetDefault(OsuSetting.LastProcessedMetadataId, -1);
|
SetDefault(OsuSetting.LastProcessedMetadataId, -1);
|
||||||
|
|
||||||
SetDefault(OsuSetting.ComboColourNormalisationAmount, 0.2f, 0f, 1f, 0.01f);
|
SetDefault(OsuSetting.ComboColourNormalisationAmount, 0.2f, 0f, 1f, 0.01f);
|
||||||
SetDefault<UserStatus?>(OsuSetting.UserOnlineStatus, null);
|
SetDefault(OsuSetting.UserOnlineStatus, UserStatus.Online);
|
||||||
|
|
||||||
SetDefault(OsuSetting.EditorTimelineShowTimingChanges, true);
|
SetDefault(OsuSetting.EditorTimelineShowTimingChanges, true);
|
||||||
SetDefault(OsuSetting.EditorTimelineShowBreaks, true);
|
SetDefault(OsuSetting.EditorTimelineShowBreaks, true);
|
||||||
|
@ -73,8 +73,6 @@ namespace osu.Game.Online.API
|
|||||||
|
|
||||||
private Bindable<UserActivity> activity { get; } = new Bindable<UserActivity>();
|
private Bindable<UserActivity> activity { get; } = new Bindable<UserActivity>();
|
||||||
|
|
||||||
private Bindable<UserStatus?> configStatus { get; } = new Bindable<UserStatus?>();
|
|
||||||
|
|
||||||
protected bool HasLogin => authentication.Token.Value != null || (!string.IsNullOrEmpty(ProvidedUsername) && !string.IsNullOrEmpty(password));
|
protected bool HasLogin => authentication.Token.Value != null || (!string.IsNullOrEmpty(ProvidedUsername) && !string.IsNullOrEmpty(password));
|
||||||
|
|
||||||
private readonly CancellationTokenSource cancellationToken = new CancellationTokenSource();
|
private readonly CancellationTokenSource cancellationToken = new CancellationTokenSource();
|
||||||
@ -110,7 +108,7 @@ namespace osu.Game.Online.API
|
|||||||
authentication.TokenString = config.Get<string>(OsuSetting.Token);
|
authentication.TokenString = config.Get<string>(OsuSetting.Token);
|
||||||
authentication.Token.ValueChanged += onTokenChanged;
|
authentication.Token.ValueChanged += onTokenChanged;
|
||||||
|
|
||||||
config.BindWith(OsuSetting.UserOnlineStatus, configStatus);
|
config.BindWith(OsuSetting.UserOnlineStatus, Status);
|
||||||
|
|
||||||
if (HasLogin)
|
if (HasLogin)
|
||||||
{
|
{
|
||||||
@ -332,8 +330,6 @@ namespace osu.Game.Online.API
|
|||||||
Debug.Assert(ThreadSafety.IsUpdateThread);
|
Debug.Assert(ThreadSafety.IsUpdateThread);
|
||||||
|
|
||||||
localUser.Value = me;
|
localUser.Value = me;
|
||||||
Status.Value = configStatus.Value ?? UserStatus.Online;
|
|
||||||
|
|
||||||
state.Value = me.SessionVerified ? APIState.Online : APIState.RequiresSecondFactorAuth;
|
state.Value = me.SessionVerified ? APIState.Online : APIState.RequiresSecondFactorAuth;
|
||||||
failureCount = 0;
|
failureCount = 0;
|
||||||
};
|
};
|
||||||
@ -371,8 +367,6 @@ namespace osu.Game.Online.API
|
|||||||
{
|
{
|
||||||
Username = ProvidedUsername
|
Username = ProvidedUsername
|
||||||
};
|
};
|
||||||
|
|
||||||
Status.Value = configStatus.Value ?? UserStatus.Online;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Perform(APIRequest request)
|
public void Perform(APIRequest request)
|
||||||
@ -597,7 +591,7 @@ namespace osu.Game.Online.API
|
|||||||
password = null;
|
password = null;
|
||||||
SecondFactorCode = null;
|
SecondFactorCode = null;
|
||||||
authentication.Clear();
|
authentication.Clear();
|
||||||
configStatus.Value = UserStatus.Online;
|
Status.Value = UserStatus.Online;
|
||||||
|
|
||||||
// Scheduled prior to state change such that the state changed event is invoked with the correct user and their friends present
|
// Scheduled prior to state change such that the state changed event is invoked with the correct user and their friends present
|
||||||
Schedule(() =>
|
Schedule(() =>
|
||||||
|
Loading…
Reference in New Issue
Block a user