fix(arena-colosseum): tips + colosseum_id wiring + round-aware time derivation

Three fixups the Phase 1-3 work missed (would bite the first time an admin
flipped on a real event):

* IsDisplayTips + TipsId added to ColosseumSeasonConfig. Drives
  Wizard/ColosseumEntryInfoTask.cs:129 (NeedsFirstTips = is_display_tips == 1).
  The wire DTO already had the properties; the season config didn't carry
  them, so admins had no way to gate the first-time tutorial tip popup.
* colosseum_id is now emitted from SeasonId. Wire field was always-absent
  before (DTO had the property but builder never set it); client fell back
  to 0 and couldn't disambiguate cups.
* ColosseumLobbyInfoBuilder.Build now takes ColosseumRoundsConfig + nowUtc
  and derives the wire is_round_period / now_round / next_round / start_time
  / end_time from the rounds schedule against the current clock. Previous
  hardcode (is_round_period: true, now_round: 1, event-window dates) would
  have shown "Round 1 ends 2026-07-31" instead of the actual round's end.
  Per the client parser at ColosseumEntryInfoTask.cs:111-126:
    - inside a round → emit that round's window + is_round_period=true
    - between rounds → emit next round's start as start_time + next_round
    - pre-event → next_round=1, start_time=event start
    - post-event → anchor to last round so the client doesn't NRE
    - no rounds configured → fall back to event-level window

Why these were missed: I implemented ColosseumSeasonConfig from the plan's
explicit field list rather than cross-checking against the captured
colosseum.json wire shape; I added ColosseumId to the wire DTO without
wiring the builder side; and no test exercised a mid-event scenario with
realistic dates — Phase 2's E2E hand-edits run.RoundId via
PromoteRunToRoundAsync instead of letting the controller derive it.

* 10 new builder unit tests cover off-season / mid-round / between-rounds /
  pre-event / post-event / empty-rounds-fallback + the new field surfacing.
  Full suite: 1355/1355 (was 1345 + 10).
This commit is contained in:
gamer147
2026-06-13 13:44:10 -04:00
parent 43a3665775
commit ba7040580f
5 changed files with 278 additions and 13 deletions

View File

@@ -58,6 +58,14 @@ public class ColosseumSeasonConfig
/// <summary>Number of strategies offered per pick in 2-Pick Chaos mode.</summary>
public int StrategyPickNum { get; set; }
/// <summary>Drives the client's first-time tutorial tip popup for this cup
/// (<c>Wizard/ColosseumEntryInfoTask.cs:129</c>: <c>NeedsFirstTips = (is_display_tips == 1)</c>).
/// Server emits wire int 0/1.</summary>
public bool IsDisplayTips { get; set; }
/// <summary>Tutorial tip content id, paired with <see cref="IsDisplayTips"/>. Wire int.</summary>
public int TipsId { get; set; }
public DateTime SalesPeriodStart { get; set; }
public DateTime SalesPeriodEnd { get; set; }