Reduce the career's game options to the ones that matter; keep leagues in a running game

The game page of a Dreierpack career offers five options (winter
postponements and their cap, indoor tournaments, the two transfer-news
switches). The cells of the original's presentation, the multi-player and
autosave cells and the switches that take leagues out of a running game are
no longer shown, and settings.commit refuses them. The sound page and the
marking automation are hidden in a career. A mailbox text cut inside a
multi-byte character no longer breaks the news read. modern_live_dump can
commit options and reports their effect.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
MichaelandClaude Fable 5.2 committed 2026-11-14 09:32:01 +01:00
1 parent 6d70a48be8
commit 1de09ba8a6
7 files changed
+135 -12

No files matched your search

+18
View File
@@ -26,3 +26,21 @@ OBW/OBS, Matchlogik und Classic bleiben unverändert. Die Speicherrundreise prü
Die Session liefert `leagueGroups` für die ursprünglichen Ergebnis-/Auslosungsschalter A–E: jeweils ursprüngliche Zeile, tatsächliche Wettbewerbs-ID und deren aktuellen Namen. Die Zuordnung entspricht den fünf in der Engine unterstützten deutschen Ligaindizes; sie wird nicht aus Namen, Tabellenplatz oder künftigen Ligagrößen geraten. Unbekannte IDs/Namen bleiben ausdrücklich unbekannt und bekommen eine neutrale Gruppenbezeichnung.
Der native Adapter prüft vollständige, eindeutige Zuordnungen im selben Karriere-/Welt-/Revisionskontext. Er erstellt eine Präsentationskopie des Katalogs. Gruppenüberschriften und Suche verwenden beide diese Kopie; HTML-/Demo-Katalog und Geometrie bleiben erhalten. Andere ursprüngliche Wettbewerbsgruppen bleiben ihre belegten Schalterbereiche, insbesondere werden gemeinsame Länderbereiche nicht in erfundene getrennte Regler zerlegt. Rohzellen, Grenzen, Speicherwege und Spielregeln ändern sich nicht.
## Gekürzte Spieloptionen der Karriere · 14. November 2026
Die Karriere bietet unter „Spiel“ nur noch Optionen an, die den Ablauf der Saison oder die Meldungen an den Manager ändern:
| Zelle | Anzeige | Wirkung |
|---|---|---|
| P5 | Spielausfälle im Winter | schaltet die Winterausfälle der deutschen Ligen ab oder an |
| J8 | Höchstens ausgefallene Spiele je Liga und Spieltag | Obergrenze der Ausfälle, 0 bis 9 |
| Q5 | Hallenturniere in der Winterpause | Hallenturniere finden statt oder nicht; während der Hallensaison gesperrt |
| H6 | Alle Transfers melden | jeder Vereinswechsel erscheint im Postfach |
| I6 | Nur Transfers der Tabellennachbarn melden | nur Wechsel der Tabellennachbarn erscheinen |
Alle übrigen Zellen des ursprünglichen Rasters steuern Anzeigen der Originaloberfläche (Übertragungsarten, Sportschau, Animations- und Anzeigezeiten, Tafeln je Wettbewerb, Desktopdarstellung) und haben in dieser Oberfläche keine Wirkung; sie bleiben im Spielstand unverändert erhalten, werden aber nicht mehr gezeigt. Nicht mehr angeboten werden außerdem die Schalter, die im laufenden Spiel Ligen aus der Berechnung nehmen (R5 „Europäische Ligen führen“ und die Wettbewerbszeilen A–E, R–T), die Mehrspieler-Optionen (F6, H8) und das Autosave-Intervall (K8; vor jedem Anstoß entsteht ohnehin eine Sicherung). `settings.commit` lehnt jede andere Zelle mit „Diese Einstellung wird nicht angeboten.“ ab.
Der Reiter „Sound“ entfällt in der Karriere, solange kein Ton angebunden ist. Unter „Automatik“ entfällt die Manndeckung, die nur der Reality-Modus des Originals verwendet.
Geprüft mit `modern_live_dump` (`MODERN_DUMP_SET`): Q5 aus ergibt keine Hallenturniere; P5 aus beziehungsweise J8 = 0 ergibt keine eigenen Nachholspiele; H6 an füllt das Postfach mit Transfermeldungen (40 statt 30 Nachrichten bis Ende Februar), I6 an ergibt 31. Über die Oberfläche umgeschaltete Werte (P5, H6) stehen nach „Anwenden“ im Session-Read, mit genau einer Revision.
+20
View File
@@ -8658,6 +8658,21 @@ std::vector<std::pair<std::string, ui::MailboxMessage>> ui_mailbox(const ModernS
std::snprintf(key, sizeof key, "message:%u-%08x", unsigned(m.date_counter), hash);
std::string id = key;
if (const int n = seen[id]++; n > 0) id += "-" + std::to_string(n + 1);
// A mailbox entry has a fixed size: a long text can end inside a multi-byte character of
// a world name. Such a tail (and any other ill-formed byte) is dropped, so the read
// always carries valid UTF-8; the id above stays the one of the stored bytes.
std::string clean;
clean.reserve(m.text.size());
for (size_t i = 0; i < m.text.size();) {
const unsigned char c = static_cast<unsigned char>(m.text[i]);
const size_t length = c < 0x80 ? 1 : (c >> 5) == 0x6 ? 2 : (c >> 4) == 0xe ? 3 : (c >> 3) == 0x1e ? 4 : 0;
bool whole = length != 0 && i + length <= m.text.size();
for (size_t k = 1; whole && k < length; ++k)
whole = (static_cast<unsigned char>(m.text[i + k]) & 0xc0) == 0x80;
if (whole) clean.append(m.text, i, length), i += length;
else ++i;
}
m.text = std::move(clean);
out.emplace_back(std::move(id), std::move(m));
}
return out;
@@ -10630,6 +10645,11 @@ cli::Json ModernSession::ui_command(const cli::Json& request, uint64_t& revision
const auto code = ui_text(edit, "code");
const auto *value = ui_field(edit, "value");
const int index = ui_setting_index(code);
// The interface offers only the options of the season itself; the original's
// presentation cells and the switches that take leagues out of a running game
// are not changed through this command.
static const std::set<std::string> offered{"P5", "Q5", "J8", "H6", "I6"};
if (!offered.contains(code)) throw FormatError("Diese Einstellung wird nicht angeboten.");
if (index < 0 || !seen.insert(index).second || !value || !value->integer() || *value->integer() < 0 || *value->integer() > 255)
throw FormatError("invalid_setting_edit");
const auto address = ::bmh::layout::LeaguePresentationOptions + uint32_t(index);
+1 -1
View File
@@ -39,7 +39,7 @@ Json engine_settings_projection(const Json &bundle) {
"Ungültige Wettbewerbszuordnung.");
titles[row] = name.is_null() ? "Wettbewerb " + row : name.get<std::string>();
}
Json catalogue = live_settings_catalogue();
Json catalogue = career_settings_catalogue();
for (auto &group : catalogue.at("groups"))
if (group.contains("competitions"))
for (auto &competition : group["competitions"]) {
+3 -3
View File
@@ -18,7 +18,7 @@ void App::settings_after_render() {
if (auto *label = element("settings-search-count"))
label->SetInnerRML(std::to_string(count) + (settings_query_.empty()
? " Optionen"
: " von "+std::to_string(live_settings_option_count())+" Optionen"));
: " von "+std::to_string(engine_mode_ ? career_settings_option_count() : live_settings_option_count())+" Optionen"));
}
if (settings_restore_scroll_) {
context_->Update();
@@ -113,12 +113,12 @@ void App::settings_filter() {
if (auto *label = element("settings-search-count"))
label->SetInnerRML(std::to_string(count) + (settings_query_.empty()
? " Optionen"
: " von "+std::to_string(live_settings_option_count())+" Optionen"));
: " von "+std::to_string(engine_mode_ ? career_settings_option_count() : live_settings_option_count())+" Optionen"));
if (auto *select = dynamic_cast<Rml::ElementFormControlSelect *>(
element("settings-jump"))) {
std::string choices;
std::string first;
for (const auto &g : live_settings_catalogue().at("groups")) {
for (const auto &g : settings_catalogue_view().at("groups")) {
const auto id = g.at("id").get<std::string>();
const bool shown = element("settings-group-" + id) != nullptr;
if (shown && first.empty())
+43
View File
@@ -51,7 +51,50 @@ inline const Json &live_settings_catalogue() {
}();
return view;
}
// The game options of a Dreierpack career: only switches that change how the season is
// played or what the manager is told. The stored cells of the original's presentation
// (broadcast panels, animation timings, result boards per competition) have no effect in
// this interface and are not offered; neither is switching leagues off in a running game.
inline const Json &career_settings_catalogue() {
static const Json view = [] {
const auto &all = settings_catalogue();
const auto find = [&](const std::string &code) -> Json {
for (const auto &group : all.at("groups"))
if (group.contains("options"))
for (const auto &row : group.at("options"))
if (row.value("code", "") == code) return row;
throw editor::Error("Unbekannte Spieloption.");
};
const auto option = [&](const char *code, const char *label, const char *help) {
Json row = find(code);
row["label"] = label; row["help"] = help;
return row;
};
Json out = Json::object();
out["groups"] = Json::array(
{{{"id", "rules"}, {"title", "Spielablauf"},
{"options", Json::array({option("P5", "Spielausfälle im Winter", "Bei schlechtem Wetter fallen Spiele aus und werden nachgeholt."),
option("J8", "Höchstens ausgefallene Spiele je Liga und Spieltag", "0 bis 9."),
option("Q5", "Hallenturniere in der Winterpause", "Kann während der Hallensaison nicht umgestellt werden.")})}},
{{"id", "transfers"}, {"title", "Nachrichten"},
{"options", Json::array({option("H6", "Alle Transfers melden", "Jeder Vereinswechsel erscheint in den Nachrichten."),
option("I6", "Nur Transfers der Tabellennachbarn melden", "")})}}});
out["sound"] = Json::array();
Json automation = Json::array();
for (const auto &row : all.at("automation"))
if (row[0] != "marking") automation.push_back(row);
out["automation"] = std::move(automation);
return out;
}();
return view;
}
inline int career_settings_option_count() {
int total = 0;
for (const auto &group : career_settings_catalogue().at("groups")) total += int(group.at("options").size());
return total;
}
inline int live_settings_option_count() {
int total = 0;
for (const auto &group : live_settings_catalogue().at("groups")) {
if (group.contains("options"))
+9 -8
View File
@@ -196,8 +196,9 @@ std::string App::render_settings() {
{"game", "Spiel"},
{"automation", "Automatik"}}};
for (const auto &[id, label] : categories)
if (!settings_global_only() || std::string(id) == "display" ||
std::string(id) == "sound")
if ((!settings_global_only() || std::string(id) == "display" ||
std::string(id) == "sound") &&
!(engine_mode_ && std::string(id) == "sound")) // a career has no sound options yet
nav += btn("settings-category", "<span>" + std::string(label) + "</span>",
settings_category_ == id ? "active" : "",
"id=\"settings-tab-" + std::string(id) +
@@ -207,10 +208,10 @@ std::string App::render_settings() {
const std::map<std::string, std::pair<std::string, std::string>> captions = {
{"display", {"Anzeige", "Bildschirm und Sprache"}},
{"sound", {"Sound", "Lautstärke, Effekte und Spielton"}},
{"game", {"Spiel", "Spielablauf und Live-Ticker"}},
{"game", {"Spiel", engine_mode_ ? "Spielablauf und Nachrichten" : "Spielablauf und Live-Ticker"}},
{"automation",
{"Automatik",
"Aufstellung, Wechsel, Taktik, Manndeckung und Training"}}};
engine_mode_ ? "Aufstellung, Wechsel, Taktik und Training" : "Aufstellung, Wechsel, Taktik, Manndeckung und Training"}}};
std::string head = "<div><h2>" + captions.at(settings_category_).first +
"</h2><p>" + captions.at(settings_category_).second +
"</p></div>";
@@ -324,10 +325,10 @@ std::string App::render_settings() {
settings_switch("automation-all", "automation", "all",
total > 0 && on == total, on > 0 && on < total)) +
"</div><div class=\"settings-group\"><h3>Aufgaben an den Co-Trainer "
"abgeben</h3><p class=\"settings-group-help\">Die fünf "
"Automatikfunktionen des Originals. Änderungen werden erst mit "
"„Anwenden“ übernommen.</p>";
for (const auto &o : live_settings_catalogue().at("automation")) {
"abgeben</h3><p class=\"settings-group-help\">" +
std::string(engine_mode_ ? "" : "Die fünf Automatikfunktionen des Originals. ") +
"Änderungen werden erst mit „Anwenden“ übernommen.</p>";
for (const auto &o : settings_catalogue_view().at("automation")) {
const auto key = o[0].get<std::string>();
pane += settings_row("automation-" + key, o[1].get<std::string>(),
o[2].get<std::string>(),
+41
View File
@@ -26,6 +26,28 @@ int main(int argc, char **argv) {
const bool live = std::getenv("MODERN_DUMP_LIVE") != nullptr, steps = std::getenv("MODERN_DUMP_STEPS") != nullptr,
quiet = std::getenv("MODERN_DUMP_QUIET") != nullptr;
Json expiry = Json::object();
size_t postponed = 0;
// MODERN_DUMP_SET="P5=0,J8=1": game options committed before the first kickoff
if (const char *wanted_settings = std::getenv("MODERN_DUMP_SET")) {
Json edits = Json::array();
std::string text = wanted_settings;
for (size_t at = 0; at < text.size();) {
const size_t end = std::min(text.find(',', at), text.size());
const std::string item = text.substr(at, end - at);
const size_t eq = item.find('=');
if (eq != std::string::npos) edits.push_back({{"code", item.substr(0, eq)}, {"value", std::stoi(item.substr(eq + 1))}});
at = end + 1;
}
const auto bundle = link->snapshot();
const auto &meta = bundle.at("desktop").at("meta");
const Json commit = {{"messageType", "command"}, {"contractVersion", meta.at("contractVersion")}, {"requestId", "request:dump-settings"},
{"careerId", meta.at("careerId")}, {"expectedRevision", meta.at("stateRevision")},
{"owner", {{"managerId", meta.at("scope").at("managerId")}}},
{"kind", "settings.commit"}, {"payload", {{"edits", edits}}}};
const auto answer = link->command(commit);
std::cout << "settings " << edits.dump() << ": " << answer.value("messageType", "?") << " " << answer.value("code", "")
<< " " << (answer.contains("message") && answer.at("message").is_object() ? answer.at("message").value("text", std::string()) : std::string()) << std::endl;
}
for (int step = 0; step < 400 && found < wanted; ++step) {
const auto bundle = link->snapshot();
const auto &meta = bundle.at("desktop").at("meta");
@@ -88,6 +110,11 @@ int main(int argc, char **argv) {
std::cout << " | " << fixture.value("date", std::string()) << " " << m.at("home").at("name").get<std::string>() << " - "
<< m.at("away").at("name").get<std::string>() << " (" << m.value("competition", std::string()) << ")";
std::cout << std::endl;
if (fixture.value("ok", false)) {
// every match of the kickoff that was a replay of a postponed one
const std::string all = fixture.dump();
for (size_t at = all.find("Verlegte Spiele"); at != std::string::npos; at = all.find("Verlegte Spiele", at + 1)) ++postponed;
}
if (quiet) { if (fixture.value("ok", false)) ++found; continue; }
if (!fixture.value("ok", false)) continue;
@@ -97,6 +124,20 @@ int main(int argc, char **argv) {
write("lineup-" + tag + ".json", link->read({{"kind", "lineup"}}));
write("tactics-" + tag + ".json", link->read({{"kind", "tactics"}}));
}
{
const auto news = link->read({{"kind", "news"}});
size_t messages = 0, transfers = 0;
if (news.contains("data") && news.at("data").contains("messages"))
for (const auto &m : news.at("data").at("messages")) {
++messages;
const std::string text = m.dump();
if (text.find("Transfer") != std::string::npos || text.find("wechselt") != std::string::npos ||
text.find("verpflichtet") != std::string::npos) ++transfers;
}
const auto desk = link->snapshot().at("desktop").at("meta");
std::cout << "summary: date " << desk.at("date").get<std::string>() << ", mentions of replayed postponed matches " << postponed
<< ", mailbox messages " << messages << ", of them about transfers " << transfers << std::endl;
}
std::cout << found << " recordings written\n";
return found ? 0 : 1;
} catch (const std::exception &e) { std::cerr << e.what() << "\n"; return 1; }