37 lines
1.6 KiB
C#
37 lines
1.6 KiB
C#
using System.Collections.Frozen;
|
|
|
|
namespace ICRebuild.Core;
|
|
|
|
public static class ValidationCatalog
|
|
{
|
|
public const string ClientVersion="2026.10.06.0000.0000";
|
|
public const string BaselineClientVersion="2026.09.15.0000.0000";
|
|
public static bool IsAuditedVersion(string? version) => version is ClientVersion or BaselineClientVersion;
|
|
// Explicit user confirmation, 2026-10-11. This is not inferred from compilation or hook startup.
|
|
public static readonly FrozenSet<int> UserConfirmed = new[] {1,2,3,9,10,11,13,14,15,16,17,19,27,28,29}.ToFrozenSet();
|
|
public static void Apply(ModuleManager modules,string clientVersion)
|
|
{
|
|
if(!IsAuditedVersion(clientVersion)) return;
|
|
foreach(var id in UserConfirmed)
|
|
if(modules.Status.TryGetValue(id,out var state) && state.HasImplementation) state.Adaptation=Adaptation.Verified;
|
|
}
|
|
}
|
|
|
|
public static class StatusPresentation
|
|
{
|
|
public static string Summary(ModuleStatus state)
|
|
{
|
|
var validation=state.Adaptation switch
|
|
{
|
|
Adaptation.Verified=>"已实测有效",
|
|
Adaptation.KnownBroken=>"已知问题",
|
|
_ when !state.HasImplementation=>"暂不可用",
|
|
_ when state.Feature.Id==14=>"待复测",
|
|
_=>"待实测"
|
|
};
|
|
var running=state.State switch {ModuleState.Enabled=>"已开启",ModuleState.Failed=>"运行异常",_=>"已关闭"};
|
|
return $"{validation} · {running}";
|
|
}
|
|
public static bool ShowDetail(ModuleStatus state) => !state.HasImplementation || state.State==ModuleState.Failed || state.Adaptation==Adaptation.KnownBroken;
|
|
}
|