Files
Alexa 6ee1d6f9b3 fix: presence, profile edits, outfit menu and RecNetResult writes for the 2023 client
Every change below was checked against the 2023-03-21 client disassembly;
file:line evidence is in the code comments and in
docs/recroom-2023-client-api-complete.md.

Presence
- matchmake/none means "online, in no room" (its only caller is
  TryGoToOfflineRoom, which ignores the reply). The server used to keep the
  old room or invent a dorm, so the next heartbeat looked out of sync and
  the client cancelled its load to chase that room.
- The join watchdog no longer clears presence 30 s into a long room load;
  it is a 3 minute backstop that drops the room only.
- One fan-out (PresenceBroadcastService) for every transition: deferred
  joins, matchmake/none, logout, failed joins, visibility changes, SignalR
  connect/disconnect. isOnline is sent on its own; pushes never go to the
  subject, because a self push moves the player.
- Online-status visibility (Public / Friends / Favorites / Appear offline)
  is stored and honoured by GET /player and by the live pushes.

Profile
- PUT account/me/{emoji,personalpronouns,identityflags,bannerimage} were
  404; added with the client's real form keys and persisted (new Players
  columns plus migration). Every account read now returns them, and edits
  push AccountUpdate to everyone.

Outfit menu
- Saved outfits kept OutfitSelectionsV2 and CustomAvatarItems, so loading a
  slot restores what was saved instead of a stale outfit.
- isCreationAllowedForAccount answers the {Success, Error} envelope the
  client parses; minPriceForPublicItem is a bare int; gifts/generate accepts
  form bodies; lockeditems returns the full owned-item shape; colourways no
  longer share their base item's AvatarItemId.

RecNetResult writes
- About 40 writes look status-only but parse the body as {Success, Error}.
  An empty 200 showed "Failed to ..." after the server applied the change,
  and a body without Success threw "Error message cannot be null". Clubs,
  announcements, keepsakes, comments/read, subscriptions, purchase offers
  and privacy settings now answer RecNetResult.
- Login token and device-code grants are real; remoteauth approves the
  device code; createlogintoken returns a bare string.
- New: incentivizedreferrals/referrals, account/bulk/{email,phone},
  GET strings, account/me/confirmphone, PlayMenuCarouselOrdering_1.
  Route inventory and coverage test extended to match.

README now describes the 2023 branch.
2026-10-15 14:08:11 +03:00

37 lines
1.7 KiB
C#

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