|
group2 0.1.0
CSE 125 Group 2
|
Classes | |
| struct | ShotResolution |
| Per-shot record for the server-side shot-resolution log. More... | |
Functions | |
| void | openIfRequested () |
| Open the log file from GROUP2_SERVER_SHOTS_CSV if set, write the CSV header, and remember the FILE* for subsequent recordShotResolution calls. | |
| void | recordShotResolution (const ShotResolution &shot) |
| Append one shot-resolution row. | |
| void | close () noexcept |
| Flush + close the log file. Called from ServerGame::shutdown. | |
Variables | |
| constexpr std::uint16_t | k_missClientId = 0xFFFFu |
| Sentinel hitClientId value meaning "shot missed all
targets". | |
|
noexcept |
Flush + close the log file. Called from ServerGame::shutdown.
| void group2::perf::shotlog::openIfRequested | ( | ) |
Open the log file from GROUP2_SERVER_SHOTS_CSV if set, write the CSV header, and remember the FILE* for subsequent recordShotResolution calls.
Idempotent — second call is a no-op so callers don't need to gate on first-init.
| void group2::perf::shotlog::recordShotResolution | ( | const ShotResolution & | shot | ) |
Append one shot-resolution row.
Thread-safe — the implementation guards the file with an internal mutex so multiple game-thread weapon-system call sites can write without colliding. No-op when the log isn't open (env var unset, or open failed).
|
inlineconstexpr |
Sentinel hitClientId value meaning "shot missed all targets".
We use 0xFFFF instead of 0 because ClientId 0 is a legitimate connected client (the first one to join).