Add statistics queries for the Modern game statistics menu

ModernSession::read_statistics answers JSON requests evaluated from the
almanac: the competitions with results, the winners of every
competition by season, and player statistics per competition and season
or all-time (goals, assists, yellow, second yellow and red cards,
appearances). Replays of postponed league matches are now recorded as
matches of their league and original matchday. Engine texts with code
page 437 umlauts convert to UTF-8.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ClaudeandClaude Opus 5.5 committed 2026-10-24 09:16:10 +02:00
1 parent 7c08e39607
commit 7742d014f9
9 files changed
+375 -3

No files matched your search

+4
View File
@@ -18,6 +18,7 @@
#include <array>
#include <cstdint>
#include <map>
#include <string_view>
#include <string>
#include <utility>
#include <vector>
@@ -170,6 +171,9 @@ struct AlmanacDate { int year = 0, month = 0, day = 0; };
// The calendar date of a day counter (day 0 = 1 July of display_start_year), as the desk shows it.
AlmanacDate almanac_date(uint32_t counter, int display_start_year);
// Original single-byte text (ISO 646-DE) as UTF-8, the form the almanac keeps names in.
std::string almanac_utf8(std::string_view original);
// Binary form of a season (format version 1, little-endian; docs/new_engine/almanach.md).
std::string encode_almanac_season(const AlmanacSeason& season);
// Throws FormatError when the bytes are not an almanac season of a known version.