Files
Kayori 755c047693 Platform, plugin & account UX improvements
- Refactor handler dispatch to use a parsed GameModel instead of raw
  model strings (Handler.cs, HandlerService.cs, new GameModel.cs)
- Add a Unity asset-extraction subsystem (Abstractions/Extractors/Unity)
- Add WriteEventLogHandler, XrpcDouble serialization type
- Rename EaCoin*Handler -> *EaCoinHandler for naming consistency
- Add PIN/username update and forgot/reset password flows, with a
  console-logging IEmailSender until real email is wired up
- Add a settings page and a theming pass (theme tokens, tailwind config)
- Add plugin nav/route/UI-manifest frontend types
2026-09-06 15:12:50 +02:00

38 lines
1.5 KiB
C#

using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Abstractions.Extractors.Unity.Services;
namespace Abstractions.Extractors.Unity;
/// <summary>
/// Catch-all extractor: dumps the full typetree as JSON for any asset type with no dedicated
/// extractor. Also used internally by MeshExtractor/MaterialExtractor/AnimationExtractor/
/// MonoBehaviourExtractor as their own on-failure fallback.
/// </summary>
public sealed class FallbackExtractor : IAssetExtractor
{
public IReadOnlyCollection<string> HandledTypes { get; } = [];
public Task<bool> ExtractAsync(ExtractionContext context, CancellationToken cancellationToken = default) =>
WriteTypeTreeDumpAsync(context, cancellationToken);
/// <summary>Dumps the object's full typetree to "{output}.json"; if it can't be JSON-serialized
/// for some reason, falls back further to a plain-text dump ("{output}.txt").</summary>
public static async Task<bool> WriteTypeTreeDumpAsync(ExtractionContext context, CancellationToken cancellationToken = default)
{
var info = ObjectSerializer.ReadTypeTree(context.BaseField);
try
{
await ObjectSerializer.WriteJsonAsync(info, context.OutputPathNoExtension + ".json", cancellationToken);
return true;
}
catch
{
await ObjectSerializer.WriteTextAsync(info?.ToString() ?? "null", context.OutputPathNoExtension + ".txt", cancellationToken);
return true;
}
}
}