Skip to content

API: profile tiers and gaps, avatars after runs, flags from server GeoIP - #16

Merged
github-actions[bot] merged 2 commits into
sourcejump:u/zasbufrom
zasbu:api/profile-and-flags
Nov 7, 2026
Merged

github-actions[bot] merged 2 commits into
sourcejump:u/zasbufrom
zasbu:api/profile-and-flags

Conversation

@zasbu

@zasbu zasbu commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

API only; the website on main is untouched apart from the generated types.

  • Recent runs return a total and take an offset (pager shows the last page).
  • A player's Steam profile is fetched after each new run, so avatars fill in without a sign-in.
  • Personal bests carry tier and world_record_time; profiles carry tier_count.
  • Runs may carry player.country_code from the game server's GeoIP; it becomes the player's flag, ahead of their own pick and Steam's. The IP never reaches the API; unknown codes are ignored. Migration 0052 adds players.country_from_server. The priority is a proposal for you to accept or change.

Plugin, for flags: on each run, GetClientIP(client, ip, sizeof(ip)); if GeoipCode2(ip, code) succeeds, add "country_code": code to the run's player object, else leave it out.

Deploy: merge, then just deploy beta.

  • Servers activity: peak_players per point and per range, the most players online at once across listed servers (5-minute samples; a daily peak table for the year, migration 0053, back-filled from the 30-day log). The range peak counts up to now, so a shorter range never reads higher than a longer one.
  • Avatars: GET /v1/players/{player}/avatar redirects to the stored Steam avatar, fetches it on the spot when missing (4 at once, 4 s), or draws initials, so every player shown has their avatar, signed in or not.

- Recent runs: a total and an offset, for a pager with a last page.
- A player's Steam profile is fetched after each new run, so avatars fill in.
- Personal bests carry their board's tier and record time; profiles, tier_count.
- Runs may carry player.country_code from the game server's GeoIP; it becomes
  the player's flag ahead of their own pick and Steam's. Never the IP.

API only: no web change beyond the generated types.
@github-actions
github-actions Bot changed the base branch from main to u/zasbu November 7, 2026 08:08
@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown

Couldn't merge into u/zasbu, most likely because of a conflict. Update your branch from u/zasbu and push again.

Each activity point and each range carries the most players online at once
across listed servers; the range's peak counts up to now, so a shorter range
never reads higher than a longer one. A year reads a daily peak kept at each
heartbeat (migration 0053, back-filled from the 30-day log).
@github-actions
github-actions Bot merged commit 0eb8608 into sourcejump:u/zasbu Nov 7, 2026
3 checks passed
@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown

Merged into u/zasbu. It'll be live at https://zasbu-sj.okwhiteli.st in a few minutes.

zasbu added a commit to zasbu/sourcejump2web-dev that referenced this pull request Nov 8, 2026
PR sourcejump#16 and the migration numbering, akanora's PRs and the plugin's new key
requirement, the API options that would end the web's shortcuts, and the
style-order question.
zasbu added a commit to zasbu/sourcejump2web-dev that referenced this pull request Nov 8, 2026
…ejump

Map personal bests for servers in one request (now keyed), sign out
everywhere (401 without a session), your own place pinned under a map
board, one view for the tier in force (migration 0054, after PR sourcejump#16's
0052 and 0053), link previews and an error page, and the Windows build.
The map board's rows keep this branch's phone layout inside sourcejump#25's
EntryRow; design-system.md keeps both sides within its budget.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant