mirror of
https://github.com/osukey/osukey.git
synced 2025-07-03 01:09:57 +09:00
Move token saving logic to APIAccess
This commit is contained in:
@ -16,7 +16,7 @@ using osu.Game.Users;
|
||||
|
||||
namespace osu.Game.Online.API
|
||||
{
|
||||
public class APIAccess : IAPIProvider
|
||||
public class APIAccess : IAPIProvider, IDisposable
|
||||
{
|
||||
private readonly OsuConfigManager config;
|
||||
private readonly OAuth authentication;
|
||||
@ -27,7 +27,7 @@ namespace osu.Game.Online.API
|
||||
|
||||
private ConcurrentQueue<APIRequest> queue = new ConcurrentQueue<APIRequest>();
|
||||
|
||||
public Scheduler Scheduler = new Scheduler();
|
||||
public readonly Scheduler Scheduler = new Scheduler();
|
||||
|
||||
/// <summary>
|
||||
/// The username/email provided by the user when initiating a login.
|
||||
@ -310,6 +310,23 @@ namespace osu.Game.Online.API
|
||||
{
|
||||
Scheduler.Update();
|
||||
}
|
||||
|
||||
private void dispose()
|
||||
{
|
||||
config.Set(OsuSetting.Token, config.Get<bool>(OsuSetting.SavePassword) ? Token : string.Empty);
|
||||
config.Save();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
dispose();
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
~APIAccess()
|
||||
{
|
||||
dispose();
|
||||
}
|
||||
}
|
||||
|
||||
public enum APIState
|
||||
|
Reference in New Issue
Block a user