Repository navigation
[minor] Add the live progression site - #3
Merged
Merged
Conversation
Combine took whole rows in arrival order, so a late stale batch could lower the overlay. It now takes the larger value field by field. Set PackageProjectUrl on the site so the container image url label builds.
The site serves the public pages, JSON APIs, and an SSE stream on 8080, and takes plugin batches on 8081 only. A middleware checks the port the connection arrived on, so the Host header can't reach ingest from 8080. SiteOptions now binds Core's DatabaseSettings, and an empty host falls back to the in-memory store. JSON sent to browsers writes 64-bit numbers as strings. A failed feed history write no longer escapes LiveState.Apply.
LiveState takes an ILogger and warns, with the path and the exception, the first time a feed history write fails. It logs again only after a write succeeds and a later one fails. The batch stays applied in memory, so a disk fault can't block live updates, and the warning shows why the history won't survive a restart. FeedStore exposes its path for the message.
Add the live, ranks, and player pages in the game HUD style, with one shared stylesheet and script and no front-end build step. Every value from the API goes into the page as text, and player links are built only from well-formed SteamID64s. The site project now copies wwwroot to the build and publish output, because Microsoft.NET.Sdk doesn't do that on its own.
The ranks page refetches on any progress event, and on a snapshot that shows a human player the page doesn't list yet. The live page replaces the scoreboard with an offline message while the server is offline, merges the fetched feed with entries already streamed, and leaves the weapon off weapon level-up rows, whose title already names it.
The MySQL connection string sets DateTimeKind to Utc, so first seen and last seen load with a UTC kind and serialize with a Z. The plugin writes DateTime.UtcNow, and the rankings query no longer needs its own SpecifyKind.
ProgressReader runs at most four store queries at once, and callers that miss the cache for the same player or for the rankings share one in-flight query. The ranks and player endpoints pass the request's cancellation token, so an aborted request stops waiting while a shared query runs on for the others.
A full resend carries every connected player's rows, which can pass 1 MiB on a full server.
SiteReporter.Collect logs any failure through Log.EventFailed and skips that batch, so a fault in the optional site never reaches the game timer. The README lists Site__Database__RequireTls, says the /data volume must be writable by UID 1654, and says the health probe uses port 8080.
Comment on lines
+60
to
+62
| catch (OperationCanceledException) when (cancellationToken.IsCancellationRequested) | ||
| { | ||
| } |
Comment on lines
+63
to
+65
| catch (IOException) when (httpContext.RequestAborted.IsCancellationRequested) | ||
| { | ||
| } |
Comment on lines
+45
to
+47
| catch (OperationCanceledException) when (stoppingToken.IsCancellationRequested) | ||
| { | ||
| } |
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




Summary
Adds a public, read-only live site for the server's progression, built to run at cs2-progression.ktsu.dev.
Site.Urlset, the plugin sends a batch every 2 seconds. A batch holds the server snapshot, new skill shot and milestone feed entries, and the lifetime rows that changed. With no URL set, it behaves exactly as before.CounterStrikeProgression.Site): an ASP.NET Core app.ghcr.io/ktsu-dev/counterstrikeprogression-site:<version>and:lateston release.The design is in
docs/superpowers/specs/2026-10-17-progression-site-design.md, and the plan is indocs/superpowers/plans/2026-10-17-progression-site.md.Test plan
🤖 Generated with Claude Code