mirror of
https://github.com/DorkSquadRR/DorkNet.git
synced 2026-10-26 07:28:45 -07:00
fix: notification pushes now match what the 2023 client reads
Most pushes were still shaped for the 2020 watch, so the 2023 client parsed them as empty or dropped them without any error. - RelationshipChanged carries the relationship row, to both players, on friend request / accept / remove / add and on favorite / mute / ignore. Friend requests and accepts also land in the notifications inbox. - ModerationKick uses the client's flat moderation block, with the reason in VoteKickReason (the only field the dialog shows). - Bans, account deletion, password resets and second-session takeover are a Logout with a numeric reason instead of a kick to the dorm; the old string reason failed the client's parse. - SubscribeToPlayers is honoured: each connection joins a presence group per subscribed player, and presence (only presence) reaches subscribers as well as friends. The hub allows 180 s of client silence, since the client reconnects at most 3 times per login. - Admin broadcast sends its text as a coach message and can start the client's own maintenance countdown; ServerMaintenance only reads StartsInMinutes. - ConsumableMapping, StorefrontBalance, gift, player event, level-up, RoomUpdate, profile-image and PlayerLeftChat pushes carry the client's DTOs. "Join rejected" is the client's RequestGameInvite message. Contract in docs/recroom-2023-notifications.md; push frames are checked by NotificationContractTests through a capturing hub context.
This commit is contained in:
@@ -41,6 +41,13 @@ public class LevelService(DorkNetDbContext db, NotificationService notifications
|
||||
player.Level = LevelForXp(player.XP);
|
||||
await db.SaveChangesAsync();
|
||||
|
||||
// Live level bar: "PlayerProgressionLevelUpdate" {PlayerId, Level, XP}
|
||||
// (handler PBOGNAPEBAI.txt:263, DTO DGFGIFIHCAJ) — the same values
|
||||
// api/players/v2/progression returns. Without it the watch kept the
|
||||
// level and XP it loaded at login until the next relog.
|
||||
await notifications.NotifyTypedAsync(playerId, "PlayerProgressionLevelUpdate",
|
||||
new { PlayerId = (int)playerId, player.Level, player.XP });
|
||||
|
||||
if (player.Level > oldLevel)
|
||||
{
|
||||
// Level-up grants a small currency reward. The wallet UI
|
||||
@@ -82,9 +89,13 @@ public class LevelService(DorkNetDbContext db, NotificationService notifications
|
||||
row.UpdatedAt = DateTime.UtcNow;
|
||||
await db.SaveChangesAsync();
|
||||
|
||||
// StorefrontBalanceUpdate "61" is BalanceResponseDTO {Balance,
|
||||
// CurrencyType, Platform}; the client sets that (CurrencyType,
|
||||
// Platform) bucket to Balance. Platform 0 matches every balance REST
|
||||
// response, so the buckets line up.
|
||||
await notifications.NotifyAsync(playerId,
|
||||
PushNotificationId.StorefrontBalanceUpdate,
|
||||
new { CurrencyType = currencyType, row.Balance, Reason = reason });
|
||||
new { row.Balance, CurrencyType = currencyType, Platform = 0 });
|
||||
return row.Balance;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user