From 1c79ebff9f82a988ce95c51b6655c0d7700ccaad Mon Sep 17 00:00:00 2001 From: Andrey Zavadskiy Date: Wed, 21 Dec 2016 01:51:01 +0300 Subject: [PATCH] Fix loggining on start even after logout and exit --- osu.Game/OsuGameBase.cs | 2 ++ osu.Game/Overlays/Options/General/LoginOptions.cs | 11 ++--------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/osu.Game/OsuGameBase.cs b/osu.Game/OsuGameBase.cs index 3deb447a9f..0be9c3b1dd 100644 --- a/osu.Game/OsuGameBase.cs +++ b/osu.Game/OsuGameBase.cs @@ -117,6 +117,8 @@ namespace osu.Game //refresh token may have changed. if (Config != null && API != null) { + Config.Set(OsuConfig.Username, Config.Get(OsuConfig.SaveUsername) ? API.Username : string.Empty); + Config.Set(OsuConfig.Password, Config.Get(OsuConfig.SavePassword) ? API.Password : string.Empty); Config.Set(OsuConfig.Token, Config.Get(OsuConfig.SavePassword) ? API.Token : string.Empty); Config.Save(); } diff --git a/osu.Game/Overlays/Options/General/LoginOptions.cs b/osu.Game/Overlays/Options/General/LoginOptions.cs index e5de055f32..a5e21e2c47 100644 --- a/osu.Game/Overlays/Options/General/LoginOptions.cs +++ b/osu.Game/Overlays/Options/General/LoginOptions.cs @@ -26,12 +26,6 @@ namespace osu.Game.Overlays.Options.General { api?.Register(this); this.api = api; - } - - private void performLogout() - { - api.Logout(); - //TODO: set null strings in username, password, token } public void APIStateChanged(APIAccess api, APIState state) @@ -73,7 +67,7 @@ namespace osu.Game.Overlays.Options.General { RelativeSizeAxes = Axes.X, Text = "Sign out", - Action = performLogout + Action = api.Logout } }; break; @@ -101,7 +95,6 @@ namespace osu.Game.Overlays.Options.General AutoSizeAxes = Axes.Y; RelativeSizeAxes = Axes.X; Spacing = new Vector2(0, 5); - // TODO: Wire things up Children = new Drawable[] { new SpriteText { Text = "Username" }, @@ -137,7 +130,7 @@ namespace osu.Game.Overlays.Options.General { RelativeSizeAxes = Axes.X, Text = "Register", - //Action = performLogin + //Action = registerLink } }; }