From b98d8361bd6556d7c98fcea48bf98de0f5d46d20 Mon Sep 17 00:00:00 2001 From: Michael Manis Date: Sun, 21 Jan 2018 23:59:35 -0500 Subject: [PATCH 1/6] Use obtained value for displayed name. --- osu.Game/Overlays/Toolbar/ToolbarUserButton.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Overlays/Toolbar/ToolbarUserButton.cs b/osu.Game/Overlays/Toolbar/ToolbarUserButton.cs index c2dfea9a08..16586adc0c 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarUserButton.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarUserButton.cs @@ -55,7 +55,7 @@ namespace osu.Game.Overlays.Toolbar avatar.User = new User(); break; case APIState.Online: - Text = api.Username; + Text = api.LocalUser.Value.Username; avatar.User = api.LocalUser; break; } From 19321ca880c40b2647284e6642141c817b4c6546 Mon Sep 17 00:00:00 2001 From: Michael Manis Date: Mon, 22 Jan 2018 00:16:38 -0500 Subject: [PATCH 2/6] Save the obtained username when online. --- osu.Game/OsuGameBase.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/OsuGameBase.cs b/osu.Game/OsuGameBase.cs index ef02f1a7ec..fad0c8c3d9 100644 --- a/osu.Game/OsuGameBase.cs +++ b/osu.Game/OsuGameBase.cs @@ -200,7 +200,7 @@ namespace osu.Game switch (state) { case APIState.Online: - LocalConfig.Set(OsuSetting.Username, LocalConfig.Get(OsuSetting.SaveUsername) ? API.Username : string.Empty); + LocalConfig.Set(OsuSetting.Username, LocalConfig.Get(OsuSetting.SaveUsername) ? API.LocalUser.Value.Username : string.Empty); break; } } From c4252ee022635332a3f1c62c26f1b6ed5ad379f3 Mon Sep 17 00:00:00 2001 From: Michael Manis Date: Sun, 21 Jan 2018 23:59:35 -0500 Subject: [PATCH 3/6] Use obtained value for displayed name. --- osu.Game/Overlays/Toolbar/ToolbarUserButton.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Overlays/Toolbar/ToolbarUserButton.cs b/osu.Game/Overlays/Toolbar/ToolbarUserButton.cs index c2dfea9a08..16586adc0c 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarUserButton.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarUserButton.cs @@ -55,7 +55,7 @@ namespace osu.Game.Overlays.Toolbar avatar.User = new User(); break; case APIState.Online: - Text = api.Username; + Text = api.LocalUser.Value.Username; avatar.User = api.LocalUser; break; } From 87ec36060d2eca78491d08f5d42940a9a29faf02 Mon Sep 17 00:00:00 2001 From: Michael Manis Date: Mon, 22 Jan 2018 00:16:38 -0500 Subject: [PATCH 4/6] Save the obtained username when online. --- osu.Game/OsuGameBase.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/OsuGameBase.cs b/osu.Game/OsuGameBase.cs index ef02f1a7ec..fad0c8c3d9 100644 --- a/osu.Game/OsuGameBase.cs +++ b/osu.Game/OsuGameBase.cs @@ -200,7 +200,7 @@ namespace osu.Game switch (state) { case APIState.Online: - LocalConfig.Set(OsuSetting.Username, LocalConfig.Get(OsuSetting.SaveUsername) ? API.Username : string.Empty); + LocalConfig.Set(OsuSetting.Username, LocalConfig.Get(OsuSetting.SaveUsername) ? API.LocalUser.Value.Username : string.Empty); break; } } From 64d7868c035e6330a525eda5e3ef2fc2ef9e54d1 Mon Sep 17 00:00:00 2001 From: Michael Manis Date: Mon, 22 Jan 2018 01:19:22 -0500 Subject: [PATCH 5/6] Update APi.Username in APIAccess intead of ignoring it. --- osu-framework | 2 +- osu.Game/Online/API/APIAccess.cs | 1 + osu.Game/OsuGameBase.cs | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/osu-framework b/osu-framework index 26c01ca606..8f36ddab94 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 26c01ca6069296621f76d8ffbfe31ecf8074c687 +Subproject commit 8f36ddab946ff538620081ede7719461d4732b79 diff --git a/osu.Game/Online/API/APIAccess.cs b/osu.Game/Online/API/APIAccess.cs index 5559aadeb4..1d657b8664 100644 --- a/osu.Game/Online/API/APIAccess.cs +++ b/osu.Game/Online/API/APIAccess.cs @@ -126,6 +126,7 @@ namespace osu.Game.Online.API userReq.Success += u => { LocalUser.Value = u; + Username = LocalUser.Value.Username; failureCount = 0; //we're connected! diff --git a/osu.Game/OsuGameBase.cs b/osu.Game/OsuGameBase.cs index fad0c8c3d9..ef02f1a7ec 100644 --- a/osu.Game/OsuGameBase.cs +++ b/osu.Game/OsuGameBase.cs @@ -200,7 +200,7 @@ namespace osu.Game switch (state) { case APIState.Online: - LocalConfig.Set(OsuSetting.Username, LocalConfig.Get(OsuSetting.SaveUsername) ? API.LocalUser.Value.Username : string.Empty); + LocalConfig.Set(OsuSetting.Username, LocalConfig.Get(OsuSetting.SaveUsername) ? API.Username : string.Empty); break; } } From 6dfd0b5cc244387e2f59355d6038465419b5763f Mon Sep 17 00:00:00 2001 From: Michael Manis Date: Tue, 23 Jan 2018 10:54:42 -0500 Subject: [PATCH 6/6] Unnecessary because of prior commit. --- osu.Game/Overlays/Toolbar/ToolbarUserButton.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Overlays/Toolbar/ToolbarUserButton.cs b/osu.Game/Overlays/Toolbar/ToolbarUserButton.cs index 16586adc0c..c2dfea9a08 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarUserButton.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarUserButton.cs @@ -55,7 +55,7 @@ namespace osu.Game.Overlays.Toolbar avatar.User = new User(); break; case APIState.Online: - Text = api.LocalUser.Value.Username; + Text = api.Username; avatar.User = api.LocalUser; break; }