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

33 lines
1.5 KiB
C#

using System.Linq;
namespace Abstractions.Handlers;
// Every /eamuse request carries its `model` as "model:dest:spec:rev:ext" (e.g.
// "XIF:J:A:A:2025070800" - confirmed against real captured traffic AND against a real cabinet's
// own prop/ea3-ident.xml, which names these same five fields <model>/<dest>/<spec>/<rev>/<ext>).
// GameCode/Version below are named for what the rest of this codebase already calls them
// (HandlerGameCode, IMedusaPlugin.GameCode, and every handler's version-gating) rather than
// the raw wire names "model"/"ext" - GameCode is model, Version is ext.
//
// Parsed once here instead of each handler doing its own model.Split(...): a wrong separator or
// index there doesn't fail loudly, it just silently mis-parses (or throws FormatException on
// every real request while looking fine against a hand-built test value).
public readonly record struct GameModel(string GameCode, string Dest, string Spec, string Rev, long Version)
{
public static GameModel Parse(string model)
{
var parts = model.Split(':');
var version = parts.Length > 4 ? string.Join(string.Empty, parts.Skip(4)) : "";
return new GameModel(
parts.Length > 0 ? parts[0] : "",
parts.Length > 1 ? parts[1] : "",
parts.Length > 2 ? parts[2] : "",
parts.Length > 3 ? parts[3] : "",
string.IsNullOrEmpty(version) ? 0 : long.Parse(version));
}
public override string ToString() => $"{GameCode}:{Dest}:{Spec}:{Rev}:{Version}";
}