using DorkNet.Models.Auth; using Microsoft.AspNetCore.Mvc; namespace DorkNet.Server.Controllers; /// /// Bodies for the 2023 client's RecNetResult writes. /// /// A lot of the client's fire-and-forget writes look status-only from their /// signature (they return LDGADANDBIO, the untyped promise), but they /// are not: they go through BFDGEKKNAPB.PEFKBAEAOPD /// (RecNet.Runtime/BFDGEKKNAPB.txt:353, "ExpandRecNetResult"), which /// deserialises the body as DJMHAFPGLLN = {Success, Error} /// (formatter RecNet.Runtime/LMCCNLLHLCJ.txt:191-218 registers /// Success/success and Error/error) and then runs /// the <ExpandRecNetResult>b__2_0 lambda /// (RecNet.Runtime/BFDGEKKNAPB_NestedType___c.txt:61): /// /// body null (an empty 200 or null — COLNKALCBOK.txt /// JIKCMNMKNPH returns default for both) → NullReferenceException, the write /// shows "Failed to …" although the server applied it; /// Success missing/false → Promise.Rejected(Error); with no /// Error key that throws ArgumentException: Error message cannot be /// null (seen in Player.log as an unobserved task exception). /// /// So every such endpoint must answer {"success":true,"error":""} on /// success, and carry a non-null error on a 200 failure. /// public static class RecNetResults { public static IActionResult Ok() => new OkObjectResult(new RecNetResult { Success = true, Error = string.Empty }); public static IActionResult Fail(string error) => new OkObjectResult(new RecNetResult { Success = false, Error = error }); }