mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 16:59:53 +09:00
Add proper user data retrieval on connect.
This commit is contained in:
@ -16,12 +16,14 @@ using osu.Game.Database;
|
||||
using osu.Game.Graphics.Cursor;
|
||||
using osu.Game.Graphics.Processing;
|
||||
using osu.Game.IPC;
|
||||
using osu.Game.Online;
|
||||
using osu.Game.Online.API;
|
||||
using osu.Game.Overlays;
|
||||
using osu.Game.Online.API.Requests;
|
||||
|
||||
namespace osu.Game
|
||||
{
|
||||
public class OsuGameBase : BaseGame
|
||||
public class OsuGameBase : BaseGame, IOnlineComponent
|
||||
{
|
||||
internal OsuConfigManager Config;
|
||||
|
||||
@ -43,7 +45,7 @@ namespace osu.Game
|
||||
Dependencies.Cache(this);
|
||||
Dependencies.Cache(Config);
|
||||
Dependencies.Cache(new BeatmapDatabase(Host.Storage, Host));
|
||||
|
||||
|
||||
//this completely overrides the framework default. will need to change once we make a proper FontStore.
|
||||
Dependencies.Cache(Fonts = new FontStore { ScaleAdjust = 0.01f }, true);
|
||||
|
||||
@ -74,12 +76,12 @@ namespace osu.Game
|
||||
Token = Config.Get<string>(OsuConfig.Token)
|
||||
});
|
||||
|
||||
API.OnStateChange += apiStateChanged;
|
||||
API.Register(this);
|
||||
}
|
||||
|
||||
private void apiStateChanged(APIState oldState, APIState newState)
|
||||
public void APIStateChanged(APIAccess api, APIState state)
|
||||
{
|
||||
switch (newState)
|
||||
switch (state)
|
||||
{
|
||||
case APIState.Online:
|
||||
Config.Set(OsuConfig.Username, Config.Get<bool>(OsuConfig.SaveUsername) ? API.Username : string.Empty);
|
||||
|
Reference in New Issue
Block a user