Stats storage and display - #718
Merged
Merged
Conversation
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
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.
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.