Fellow managers are named on the match sheet while the match runs

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
MichaelandClaude Fable 5.2 committed 2026-11-16 23:16:04 +01:00
1 parent 20b8406763
commit 08fccd6663
1 file changed
+9
+9
View File
@@ -298,6 +298,15 @@ Json engine_live_progress(const Json &previous, const Json &state, const Json &b
int portrait = int(out.at("owners").size());
Json team = m.at(side); team["role"] = role;
std::string name = own ? bundle.at("desktop").at("data").at("manager").value("name", std::string("Manager")) : std::string("Manager");
// the fellow players' names stand in the session's list of managers
if (!own) try {
for (const auto &person : bundle.at("session").at("data").at("managers")) {
if (person.at("id") != manager) continue;
const auto &value = person.at("name");
const std::string found = value.is_string() ? value.get<std::string>() : value.value("text", std::string());
if (!found.empty()) name = found;
}
} catch (const std::exception &) {}
out["owners"].push_back({{"id", manager}, {"portrait", portrait}, {"name", name}, {"team", team}, {"match_id", id},
{"view", {{"ok", true}, {"engine", true}, {"rows", own ? roster : Json::array()}, {"field_count", 11}}}});
owners.push_back(manager);