mirror of https://github.com/ppy/osu
Update `OsuConfigManager` in line with `ConfigManager` logging changes
This commit is contained in:
parent
3fb3a18e68
commit
c86a75aa5f
|
@ -4,10 +4,8 @@
|
|||
#nullable disable
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using osu.Framework.Configuration;
|
||||
using osu.Framework.Configuration.Tracking;
|
||||
using osu.Framework.Extensions;
|
||||
|
@ -31,6 +29,12 @@ namespace osu.Game.Configuration
|
|||
[ExcludeFromDynamicCompile]
|
||||
public class OsuConfigManager : IniConfigManager<OsuSetting>
|
||||
{
|
||||
public OsuConfigManager(Storage storage)
|
||||
: base(storage)
|
||||
{
|
||||
Migrate();
|
||||
}
|
||||
|
||||
protected override void InitialiseDefaults()
|
||||
{
|
||||
// UI/selection defaults
|
||||
|
@ -172,12 +176,9 @@ protected override void InitialiseDefaults()
|
|||
SetDefault(OsuSetting.LastProcessedMetadataId, -1);
|
||||
}
|
||||
|
||||
public IDictionary<OsuSetting, string> GetLoggableState() =>
|
||||
new Dictionary<OsuSetting, string>(ConfigStore.Where(kvp => !keyContainsPrivateInformation(kvp.Key)).ToDictionary(kvp => kvp.Key, kvp => kvp.Value.ToString()));
|
||||
|
||||
private static bool keyContainsPrivateInformation(OsuSetting argKey)
|
||||
protected override bool CheckLookupContainsPrivateInformation(OsuSetting lookup)
|
||||
{
|
||||
switch (argKey)
|
||||
switch (lookup)
|
||||
{
|
||||
case OsuSetting.Token:
|
||||
return true;
|
||||
|
@ -186,12 +187,6 @@ private static bool keyContainsPrivateInformation(OsuSetting argKey)
|
|||
return false;
|
||||
}
|
||||
|
||||
public OsuConfigManager(Storage storage)
|
||||
: base(storage)
|
||||
{
|
||||
Migrate();
|
||||
}
|
||||
|
||||
public void Migrate()
|
||||
{
|
||||
// arrives as 2020.123.0
|
||||
|
|
Loading…
Reference in New Issue