Skip to content

feat(race): minimum player enforcement, late-join rejection, and DNF handling #170

@TheMeinerLP

Description

@TheMeinerLP

Description

Race Mode requires a minimum number of players before the countdown can start. Once the map is running, late joiners are rejected or spectated. Players who exceed the time limit without finishing are marked DNF.

Acceptance Criteria

  • Minimum player count is configurable (per-server config, default: 2)
  • Lobby phase blocks countdown start until the minimum is met; displays a waiting message
  • After countdown begins, new connections are either rejected or forced into spectator mode (configurable)
  • A per-map time limit is configurable (default: 150% of reference time)
  • Players who do not finish within the time limit are automatically marked DNF
  • DNF players receive 0 map points and their result is flagged as DNF in persistence
  • DNF is stored as a distinct state from a legitimate 0-point finish (e.g. `ResultType` enum: `FINISH`, `DNF`)
  • The end phase waits for all players to either finish or DNF before advancing
  • Unit tests cover: countdown blocked, countdown unblocked, late-join rejection, DNF timeout

Technical Details

  • `ResultType` enum follows the Enum DSL pattern (cached `VALUES`, `byName()`)
  • Time limit enforcement runs in the game phase tick loop, not a separate thread
  • Spectator behavior for late joiners must not allow ring collision or scoring
  • DB migration adds `result_type` column to `game_results` (non-null, default `FINISH`)

Dependencies

Estimate

M

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestgameplayGameplay mechanics

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions