Add the base read queries for the new UI; fix ages and save limits

- ModernSession::read(request): status, leagues, table, fixtures and
  squad as JSON with the same club/player/league objects everywhere
  (docs/new_engine/ui-abfragen.md); the statistics answer through it.
  Further queries follow per menu once the GUI is finished.
- Ages: data set 1.3 gives ages only for the 840 added players (birth
  dates); the 2574 original players carry the placeholder 16 and now
  get their age drawn as in the original (human squad 20-25) instead
  of all being 16. Birth dates for all players go into data 1.4.
- Saves of Modern matchdays with more than six match groups (nine
  leagues on one day) were refused on loading; Classic keeps six.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ClaudeandClaude Opus 5.5 committed 2026-10-24 10:52:44 +02:00
1 parent f92be693af
commit 4639fe5a91
12 files changed
+344 -8

No files matched your search

+12
View File
@@ -606,6 +606,18 @@ int main(int argc, char** argv) {
ask({{"kind", "player_stats"}, {"competition", g.world_league_id.empty() ? "league:0" : g.world_league_id[0]},
{"sort", "yellow"}, {"limit", 3}});
ask({{"kind", "player_stats"}, {"competition", "x"}, {"sort", "dribbles"}});
// the read queries of the new interface (docs/new_engine/ui-abfragen.md)
const auto read = [&](const cli::Json::Object& request) {
std::string answer = cli::dump_json(session.read(request));
if (answer.size() > 8000) answer = answer.substr(0, 8000) + " ...";
std::printf("read %s\n -> %s\n", cli::dump_json(request).c_str(), answer.c_str());
};
read({{"kind", "status"}});
read({{"kind", "leagues"}});
read({{"kind", "table"}, {"league", 0}});
read({{"kind", "fixtures"}, {"league", 0}, {"matchday", 1}});
read({{"kind", "squad"}});
read({{"kind", "table"}, {"league", 42}});
}
if (std::getenv("SIM_ADVERTISING")) std::printf("%d advertising contracts accepted (SIM_ADVERTISING=1)\n", ad_contracts);
if (std::getenv("SIM_CAMP")) std::printf("%d training camp stays (SIM_CAMP=%s)\n", camp_stays, std::getenv("SIM_CAMP"));