GameServer.Leaderboards.Leaderboard (GameServer v1.0.509)
Ecto schema for the leaderboards table.
A leaderboard is a self-contained scoreboard that can be permanent or time-limited. Each leaderboard has its own settings for sort order and score operator.
Slug
The slug is a human-readable identifier (e.g., "weekly_kills") that can be reused
across multiple leaderboard instances (seasons). Use the slug to always target the
currently active leaderboard, or use the integer id for a specific instance.
Sort Order
:desc— Higher scores rank first (default):asc— Lower scores rank first (e.g., fastest time)
Operators
:set— Always replace with new score:best— Only update if new score is better (default):incr— Add to existing score:decr— Subtract from existing score
Summary
Functions
Returns true if the leaderboard is currently active (not ended).
Changeset for creating a new leaderboard.
Returns true if the leaderboard has ended.
Changeset for updating an existing leaderboard. Does not allow changing slug, sort_order, or operator after creation.
Types
@type operator() :: :set | :best | :incr | :decr
@type sort_order() :: :desc | :asc
Functions
Returns true if the leaderboard is currently active (not ended).
Changeset for creating a new leaderboard.
Returns true if the leaderboard has ended.
Changeset for updating an existing leaderboard. Does not allow changing slug, sort_order, or operator after creation.