mirror of
https://github.com/DorkSquadRR/DorkNet.git
synced 2026-10-25 23:18:44 -07:00
feat: Update notification handling to prevent account DTO issues; add SystemNotificationService for event notifications
This commit is contained in:
@@ -332,17 +332,13 @@ public class AvatarGiftsController(
|
||||
gift.ConsumedAt = DateTime.UtcNow;
|
||||
await db.SaveChangesAsync();
|
||||
|
||||
// Profile-update push so the watch's wallet readout refreshes
|
||||
// without waiting for the next /balance poll. Mirrors what
|
||||
// /api/admin/v1/players/{id}/gift does after the inbox push so
|
||||
// the toast number animates up the moment the box closes.
|
||||
if (gift.CurrencyType > 0 || gift.Xp > 0 || gift.Level > 0)
|
||||
{
|
||||
await notifications.NotifyAsync(pid,
|
||||
PushNotificationId.SubscriptionUpdateProfile,
|
||||
new { Reason = "GiftConsumed", gift.CurrencyType, gift.Currency, gift.Xp, gift.Level });
|
||||
}
|
||||
|
||||
// The wallet readout refreshes off the StorefrontBalanceUpdate that
|
||||
// GrantCurrencyAsync (above) already pushes for currency gifts. Do
|
||||
// NOT also push SubscriptionUpdateProfile ("AccountUpdate") with a
|
||||
// {Reason,Currency,…} blob: the 2023 client deserialises that channel
|
||||
// as its Account DTO, so a non-account payload decodes to a blank
|
||||
// account (accountId 0) → "Orphan player account (0) found" spam
|
||||
// (audited 2026-07-12).
|
||||
return Ok(ToWire(gift));
|
||||
}
|
||||
|
||||
|
||||
@@ -1054,11 +1054,12 @@ public class RoomsController(
|
||||
EncryptVoiceChat = currentPresence.EncryptVoiceChat,
|
||||
},
|
||||
isOnline = true,
|
||||
// 2023.03.21 client build version (baked "20230317"). MUST match
|
||||
// the joining client's own version or it reports a version
|
||||
// mismatch and refuses to join. Was a stale December-2020 value
|
||||
// (20201210) carried over when this branch forked.
|
||||
appVersion = 20230317,
|
||||
// 2023.03.21 client build version. MUST be the STRING
|
||||
// "20230317" — the client's presence DTO reads appVersion
|
||||
// with a string reader, so an int crashes the SignalR
|
||||
// message ("expected:'String Begin Token'") and aborts the
|
||||
// update. Must also match the joining client's version.
|
||||
appVersion = "20230317",
|
||||
};
|
||||
await notifications.NotifyAsync(playerId, PushNotificationId.SubscriptionUpdatePresence, presencePayload);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user