Modern UI contract: envelope, career and manager ids, session and desktop reads

First engine delivery for the Modern interface handoff (docs/new_ui/integration,
issue #15): ModernSession::ui_read answers in the draft envelope with careerId,
worldId, stateRevision, date, season, scope and Money in minor units. Careers and
human managers get persistent ids (saved in state/modern.json, older saves get
them on load). Reads: session and desktop. Engine decisions on the P0 points in
docs/new_engine/ui-anbindung.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ClaudeandClaude Opus 5.5 committed 2026-10-27 08:17:18 +01:00
1 parent 9061123c7e
commit 3336d01004
9 files changed
+342 -2

No files matched your search

+7
View File
@@ -742,6 +742,13 @@ int main(int argc, char** argv) {
read({{"kind", "fixtures"}, {"league", 0}, {"matchday", 1}});
read({{"kind", "squad"}});
read({{"kind", "table"}, {"league", 42}});
// the interface contract (docs/new_engine/ui-anbindung.md)
for (const char* kind : {"session", "desktop", "nonsense"}) {
const auto request = cli::Json::Object{{"kind", kind}, {"requestId", std::string("request:sim-") + kind}};
std::printf("ui_read %s\n -> %s\n", kind, cli::dump_json(session.ui_read(request, revision)).c_str());
}
std::printf("ui_read wrong manager\n -> %s\n",
cli::dump_json(session.ui_read(cli::Json::Object{{"kind", "desktop"}, {"managerId", "manager:99"}}, revision)).c_str());
}
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"));