From 0691e7f0ff01abbd3d71d599e18b5b0d9c047fd8 Mon Sep 17 00:00:00 2001 From: Ralph Sennhauser Date: Sun, 25 Jan 2026 21:01:11 +0100 Subject: [PATCH] Workaround renamed property in gamereport The gendered citizen feature changed stat counter names in 3592814aa8e150c4b6234ba861a2940800b17e80 which are submitted to echelon for rated games with the game report, the change in name for the property means it no longer matches the database column name effectively breaking rated games. Translate the property name on the fly. Fixes: #8687 Signed-off-by: Ralph Sennhauser --- source/lobby/XmppClient.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/source/lobby/XmppClient.cpp b/source/lobby/XmppClient.cpp index 56a9a8c494..97b08f3b8a 100644 --- a/source/lobby/XmppClient.cpp +++ b/source/lobby/XmppClient.cpp @@ -390,11 +390,21 @@ void XmppClient::SendIqGameReport(const ScriptRequest& rq, JS::HandleValue data) // Iterate through all the properties reported and add them to the stanza. std::vector properties; Script::EnumeratePropertyNames(rq, data, true, properties); + + // https://gitea.wildfiregames.com/0ad/0ad/issues/8687 + const std::map mappings{ + { "civilianUnitsLost", "femaleCitizenUnitsLost" }, + { "civilianUnitsTrained", "femaleCitizenUnitsTrained" }, + { "enemyCivilianUnitsKilled", "enemyFemaleCitizenUnitsKilled"} + }; for (const std::string& p : properties) { std::wstring value; Script::GetProperty(rq, data, p.c_str(), value); - report->addAttribute(p, utf8_from_wstring(value)); + if (mappings.contains(p)) + report->addAttribute(mappings.at(p), utf8_from_wstring(value)); + else + report->addAttribute(p, utf8_from_wstring(value)); } // Add stanza to IQ