|
| 1 | +/* |
| 2 | +** Command & Conquer Generals(tm) |
| 3 | +** Copyright 2026 TheSuperHackers |
| 4 | +** |
| 5 | +** This program is free software: you can redistribute it and/or modify |
| 6 | +** it under the terms of the GNU General Public License as published by |
| 7 | +** the Free Software Foundation, either version 3 of the License, or |
| 8 | +** (at your option) any later version. |
| 9 | +** |
| 10 | +** This program is distributed in the hope that it will be useful, |
| 11 | +** but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | +** GNU General Public License for more details. |
| 14 | +** |
| 15 | +** You should have received a copy of the GNU General Public License |
| 16 | +** along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 17 | +*/ |
| 18 | + |
| 19 | +// TheSuperHackers @feature hrich 10/03/2026 Game stats JSON exporter. |
| 20 | + |
| 21 | +#pragma once |
| 22 | + |
| 23 | +class AsciiString; |
| 24 | + |
| 25 | +/// Export game statistics as a JSON file alongside the replay file. |
| 26 | +/// @param replayDir Directory containing replays (e.g. "[UserDataPath]/Replays/") |
| 27 | +/// @param replayFileName Replay filename with extension (e.g. "LastReplay.rep") |
| 28 | +void ExportGameStatsJSON(const AsciiString& replayDir, const AsciiString& replayFileName); |
| 29 | + |
| 30 | +/// Collect a time-series snapshot of all players' stats (called every game logic frame). |
| 31 | +/// Snapshots are taken every 30 frames (~1 second) and stored in memory. |
| 32 | +void StatsExporterCollectSnapshot(); |
| 33 | + |
| 34 | +/// Clear all stored time-series snapshots (called at game start/reset). |
| 35 | +void StatsExporterClearSnapshots(); |
0 commit comments