From 4d159d92e1bcf2b8ac71464080a665d2a1307fcd Mon Sep 17 00:00:00 2001 From: JoKeRZH429 <83122870+JoKeRZH429@users.noreply.github.com> Date: Fri, 19 Jun 2026 17:58:35 +0500 Subject: [PATCH] fix(stats): Pass resolved side in game outcome payload --- .../OnlineServices_StatsInterface.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/GeneralsMD/Code/GameEngine/Source/GameNetwork/GeneralsOnline/OnlineServices_StatsInterface.cpp b/GeneralsMD/Code/GameEngine/Source/GameNetwork/GeneralsOnline/OnlineServices_StatsInterface.cpp index 6aee04b3b22..b64c5ca6745 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameNetwork/GeneralsOnline/OnlineServices_StatsInterface.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameNetwork/GeneralsOnline/OnlineServices_StatsInterface.cpp @@ -437,6 +437,18 @@ void NGMP_OnlineServices_StatsInterface::CommitMyOutcome(ScoreKeeper* pScoreKeep uint64_t currentMatchID = pLobbyInterface->GetCurrentMatchID(); + int resolvedSide = -1; + NGMPGame* myGame = pLobbyInterface->GetCurrentGame(); + + if (myGame != nullptr) + { + GameSlot* pLocalSlot = myGame->getSlot(myGame->getLocalSlotNum()); + if (pLocalSlot != nullptr) + { + resolvedSide = pLocalSlot->getPlayerTemplate(); + } + } + nlohmann::json j; j["buildings_built"] = buildingsBuilt; j["buildings_killed"] = buildingsDestroyed; @@ -447,6 +459,7 @@ void NGMP_OnlineServices_StatsInterface::CommitMyOutcome(ScoreKeeper* pScoreKeep j["total_money"] = totalMoney; j["won"] = bWon; j["match_id"] = currentMatchID; + j["side"] = resolvedSide; std::string strPostData = j.dump();