mirror of
https://github.com/DorkSquadRR/DorkNet.git
synced 2026-10-25 15:08:47 -07:00
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.
This commit is contained in:
@@ -24,6 +24,7 @@ public class MatchPlayerController(
|
||||
RoomService rooms,
|
||||
PrivateInstanceService privateInstances,
|
||||
JoinTimeoutService joinTimeouts,
|
||||
PresenceBroadcastService presenceFanout,
|
||||
IConfiguration config,
|
||||
DorkNetDbContext db,
|
||||
ILogger<MatchPlayerController> log) : ControllerBase
|
||||
@@ -87,13 +88,20 @@ public class MatchPlayerController(
|
||||
/// <summary>
|
||||
/// POST /player/logout — fires when the client gives up on a session
|
||||
/// (e.g. Photon connection couldn't be established, client aborts).
|
||||
/// Clear the cached presence so the next /goto starts fresh.
|
||||
/// Clear the cached presence so the next /goto starts fresh, and tell
|
||||
/// friends right away — otherwise they keep seeing the player in their
|
||||
/// last room until a bulk poll happens to notice.
|
||||
/// </summary>
|
||||
[HttpPost("/player/logout")]
|
||||
public IActionResult PlayerLogout()
|
||||
public async Task<IActionResult> PlayerLogout()
|
||||
{
|
||||
var playerId = TryGetCurrentPlayerId();
|
||||
if (playerId != 0) presence.Clear(playerId);
|
||||
if (playerId != 0)
|
||||
{
|
||||
joinTimeouts.Cancel(playerId, "logout");
|
||||
presence.Clear(playerId);
|
||||
await presenceFanout.PublishOfflineAsync(playerId);
|
||||
}
|
||||
return Ok(new { success = true, error = "" });
|
||||
}
|
||||
|
||||
@@ -178,7 +186,15 @@ public class MatchPlayerController(
|
||||
public async Task<ActionResult<PresenceDto>> SetStatusVisibility([FromForm(Name = "statusVisibility")] int? value)
|
||||
{
|
||||
var playerId = TryGetCurrentPlayerId();
|
||||
if (value is int v) await SetPlayerPrefAsync(playerId, PrefStatusVisibility, v.ToString());
|
||||
if (value is int v)
|
||||
{
|
||||
await SetPlayerPrefAsync(playerId, PrefStatusVisibility, v.ToString());
|
||||
// Friends only. The client does not apply this response to its own
|
||||
// cached presence, and a PresenceUpdate about the local player runs
|
||||
// the same apply-and-rejoin path as an out-of-sync heartbeat
|
||||
// (Matchmaking.EGPABEDPEJO -> FLAOOBNJAAD, Matchmaking.txt:6917), so no self push.
|
||||
await presenceFanout.PublishCurrentAsync(playerId);
|
||||
}
|
||||
var room = await GetPresenceRoomForResponseAsync(playerId);
|
||||
return Ok(new PresenceDto
|
||||
{
|
||||
@@ -212,7 +228,7 @@ public class MatchPlayerController(
|
||||
// back in the response and was then dropped, so the setting reverted on the
|
||||
// next heartbeat and never survived a restart. They live in PlayerSettings
|
||||
// (no schema change needed) and are read back wherever presence is built.
|
||||
private const string PrefStatusVisibility = "pref:statusVisibility";
|
||||
private const string PrefStatusVisibility = PresenceBroadcastService.StatusVisibilityPrefKey;
|
||||
private const string PrefVrMovementMode = "pref:vrMovementMode";
|
||||
private const string PrefAvoidJuniors = "pref:avoidJuniors";
|
||||
|
||||
@@ -395,6 +411,21 @@ public class MatchPlayerController(
|
||||
|
||||
if (room is null)
|
||||
{
|
||||
// The player went to the offline room (matchmake/none). Their
|
||||
// client now holds RoomInstanceId -1, which the heartbeat compare
|
||||
// treats as "no room" (HCHDEHIGEBE.GIICPDHJOOH, sign bit of the id;
|
||||
// RecNet.Runtime/RecNet/Matchmaking.txt:18415-18437) and is only in
|
||||
// sync with a null roomInstance. The dorm fallback below would
|
||||
// read as out-of-sync and drag the player out of the offline room.
|
||||
if (presence.IsInNoRoom(playerId))
|
||||
{
|
||||
presence.TouchNoRoom(playerId);
|
||||
log.LogInformation(
|
||||
"[player-heartbeat] player={PlayerId} online in no room (left via matchmake/none); returning null roomInstance",
|
||||
playerId);
|
||||
return null;
|
||||
}
|
||||
|
||||
if (presence.IsBootDormGraceActive(playerId))
|
||||
{
|
||||
log.LogInformation(
|
||||
@@ -426,6 +457,7 @@ public class MatchPlayerController(
|
||||
playerId, fallback.RoomId, fallback.DataBlob);
|
||||
presence.SetRoom(playerId, fallback);
|
||||
presence.MarkActive(playerId);
|
||||
await presenceFanout.PublishCurrentAsync(playerId);
|
||||
return fallback;
|
||||
}
|
||||
log.LogInformation("[player-heartbeat] player={PlayerId} room=null", playerId);
|
||||
|
||||
Reference in New Issue
Block a user