From 0d1cdc0eaaa22f0e59261e123b1d7988294aeb2d 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 (cherry picked from commit 0691e7f0ff01abbd3d71d599e18b5b0d9c047fd8) Signed-off-by: phosit --- 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 646b86b942..4641821462 100644 --- a/source/lobby/XmppClient.cpp +++ b/source/lobby/XmppClient.cpp @@ -394,11 +394,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