feat(engine,server): XP toast on win + display_name max-length validation

ProgressPlugin now fires XpAwardedEvent on every win. AnimationPlugin
shows a "+N XP" toast so players see XP feedback immediately after
winning. Server leaderboard opt-in endpoint also now validates that
display_name is at most 32 characters.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
root
2026-04-27 03:02:59 +00:00
parent e3ac494e85
commit de840fb006
5 changed files with 33 additions and 5 deletions
+7
View File
@@ -80,3 +80,10 @@ pub struct NewGameConfirmEvent;
/// a short string to the player, e.g. "Locked — reach level 5".
#[derive(Event, Debug, Clone)]
pub struct InfoToastEvent(pub String);
/// Fired by `ProgressPlugin` immediately after awarding XP for a win so the
/// animation layer can display a "+N XP" toast alongside the win cascade.
#[derive(Event, Debug, Clone, Copy)]
pub struct XpAwardedEvent {
pub amount: u64,
}