namespace DorkNet.Server.Compat;
/// Identifies a specific Rec Room client build.
///
/// is the wire-format identifier the client mod
/// stamps on every request via the X-DorkNet-Version header.
/// Format is {branch}_{semver}: march_2020_03_10,
/// december_2020_12_18. Keep it lowercase, underscore-separated;
/// it shows up in admin logs and error responses.
///
///
/// is the wire-format-compatibility group:
/// every version inside the same generation shares the same wire
/// shapes (JSON DTO casing, route names, etc.) and therefore the same
/// strategy implementations. Adding a new build that's protocol-compatible
/// with an existing generation = a one-line registration; only a new
/// generation entails new strategy code.
///
///
public sealed record ClientVersion(string Key, string Generation)
{
/// Sentinel returned when a request has no
/// X-DorkNet-Version header AND no
/// DorkNet:DefaultClientVersion is configured. Controllers
/// can branch on this to either fall through to a sensible default
/// or 426 the request.
public static readonly ClientVersion Unknown = new("unknown", "unknown");
}