Prefix current room name with ^ in player presence

The 2020.12 watch's PlayerPresence.FriendlyPresence shows roomInstance.name
verbatim and defaults to the literal "^DormRoom" — it expects a player's
current room name to carry a leading ^. Serialize the RoomInstance wire
"name" as "^"+Name and strip it on deserialize (presence round-trips the
DTO through Redis), keeping the C# Name raw so the photonRoomId stays
single-^ and invite messages keep the plain name.
This commit is contained in:
Alexa
2026-05-29 23:21:09 +03:00
parent b8f1ab91fe
commit dfd0d44641
@@ -1039,9 +1039,30 @@ public class RoomInstanceDto
[JsonPropertyName("eventId")] [JsonPropertyName("eventId")]
public long EventId { get; set; } = 0; public long EventId { get; set; } = 0;
[JsonPropertyName("name")] // Raw room name (NO leading "^"). Kept clean because server-side code
// derives other values from it — most importantly
// PrivateInstanceService builds the photonRoomId as "^{baseName}_…"
// from this, and MessagesController uses it verbatim as the invite
// message's display name (the "just the event name" case, no "^").
[JsonIgnore]
public string Name { get; set; } = string.Empty; public string Name { get; set; } = string.Empty;
// Wire "name" field. The 2020.12 watch's PlayerPresence.FriendlyPresence
// (EFAJBHGDIDD.JDICJBJBMMI → BaseAccountModel.get_FriendlyPresence) shows
// roomInstance.name VERBATIM and its built-in default is the literal
// "^DormRoom" — i.e. a player's current room is expected to carry a
// leading "^". So we prefix on serialize and strip on deserialize
// (PlayerPresenceService round-trips this DTO through Redis), keeping the
// C# Name raw. Empty stays empty so the watch falls back to its own
// "^DormRoom" default. Invite MESSAGES keep the plain name — that's a
// separate field built from the raw Name in MessagesController.
[JsonPropertyName("name")]
public string NameWire
{
get => string.IsNullOrEmpty(Name) || Name.StartsWith('^') ? Name : "^" + Name;
set => Name = !string.IsNullOrEmpty(value) && value.StartsWith('^') ? value[1..] : value;
}
// 2020.12 added these keys to RoomInstance.Deserialize. Verified via // 2020.12 added these keys to RoomInstance.Deserialize. Verified via
// Cpp2IL ISIL on CIIBGMBOFEI.PPGFHEDFBEA (the obfuscated RoomInstance // Cpp2IL ISIL on CIIBGMBOFEI.PPGFHEDFBEA (the obfuscated RoomInstance
// class). Missing → "Malformed Response" in matchmaking. // class). Missing → "Malformed Response" in matchmaking.