Skip to content

Stats storage and display - #718

Merged
leighmacdonald merged 24 commits into
masterfrom
hlstatx
Jun 27, 2026
Merged

leighmacdonald merged 24 commits into
masterfrom
hlstatx

Conversation

@leighmacdonald

Copy link
Copy Markdown
Owner

First and most significant half of stats support

  • Send demo file to demoparser, parse response.

  • Extracts chat & stats from response, writes to DB.

  • Several materialized views for querying summarized data.

  • Some initial frontend pages that moderators and admins can access if stats are enabled.

  • Change to pg18 in docker files (upgrade not required)

  • Frontend performance optimization pass.

    • Fix some re-renders.
    • Improve image sizes.
    • Improve chunking

Add database migration to restructure match and player statistics
into round-level tables with support for stat buckets. Refactor the
stats package to handle the new schema, update the demo parser to
use pointer types for class stats, and adjust the import flow to
pass demo ID and creation time explicitly. Apply formatting fixes
to shell.nix.
Align Match, MatchPlayer, and related structs with the new
database schema. Remove deprecated types and query options.
Add migration 000122 to create the player_class enum. Update
demo import logging to output the generated match ID instead
of demo metadata. Add ChargesVacc to demoparse stats.
Reformat SQL queries and rename variables for better readability. Use
slog to log transaction rollback errors. Add PreroundHealing field to
MatchRoundPlayer struct. Fetch players in Match function and calculate
match scores from round winners.
Implement StatsService.Match RPC endpoint to return detailed match statistics including rounds, players, weapons, and
classes. Update database migration 000122 to support new stats tables and materialized views. Add repository methods for
map lookup and generate Go/TypeScript protobuf bindings.
Implement backend stats service and repository to query PostgreSQL
materialized views for game statistics. Add corresponding frontend
route with a sortable table displaying kills, weapons, classes, and
other metrics grouped by time bucket.

Change all protobuf query response count fields from int64 to uint64
across chat, mge, person, and votes modules. Introduce PersonDisplay
message for lightweight player data in stats results. Update dev
environment to use pgcli and revise Zellij terminal layout.
Adds MatchesWithPlayer RPC to retrieve a player's match history.
Updates database schema to track postround kills, deaths, and healing.
Refactors stats variant enum names and adds frontend selector fields.
Extends demo parser with captures, shots, hits, and objective stats.
Implement backend QueryMatches and MapList RPCs with corresponding
frontend route, table, filtering, and pagination logic. Rename the
UserSettings protobuf message to Settings across proto definitions
and generated code. Fix PersonCell fallback to correctly display
persona name when available and update SteamID validation check.
Extract match data processing logic into a dedicated module and
implement new table components for overall statistics, round breakdowns,
and player weapon details. Update the match detail page to render these
components along with team scorecards. Also fix a typo in the
PlayerMatchHistory proto field and clean up unused time utilities.
Implement a custom pgtype codec for gofrs/uuid/v5 to handle UUID
encoding and scanning, eliminating the need for pgx-gofrs-uuid.
Update golang-migrate to use the pgx5 driver. Merge frontend, docs,
and sourcemod justfiles into the root justfile using [working-directory]
directives. Clean up unused dependencies in go.mod.
Restrict stats access to moderators

Enforce moderator privilege on stats and matches routes, while hiding
the homepage link for non-moderators.

Also includes:
- Add mge_enabled configuration flag (proto, Go, TypeScript)
- Switch database UUID codec to pgx-gofrs-uuid
- Fix server editor modal payload and login loader sync issue
- Refactor sourcemod script includes and alignment
- Separate demo info loading to simplify main query joins
- Change default sort order to createdOn descending
- Add covering and partial indexes for person_messages
- Update PostGIS image to 18-3.6 and fix docker volume path
- Improve docker dump/restore justfile tasks
Fetch start_time in matches query and allow ordering by it
Enable manual filtering, sorting, and pagination for server-side handling
Comment out points column in overall stats table
@leighmacdonald
leighmacdonald merged commit 9aebbdd into master Jun 27, 2026
4 of 5 checks passed
@leighmacdonald
leighmacdonald deleted the hlstatx branch July 21, 2026 22:08
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