group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
ShotLog.hpp File Reference

PR-18b — server-side shot-resolution log for the netsync framework. More...

#include <cstdint>
Include dependency graph for ShotLog.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  group2::perf::shotlog::ShotResolution
 Per-shot record for the server-side shot-resolution log. More...

Namespaces

namespace  group2
namespace  group2::perf
namespace  group2::perf::shotlog

Functions

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.
void group2::perf::shotlog::recordShotResolution (const ShotResolution &shot)
 Append one shot-resolution row.
void group2::perf::shotlog::close () noexcept
 Flush + close the log file. Called from ServerGame::shutdown.

Variables

constexpr std::uint16_t group2::perf::shotlog::k_missClientId = 0xFFFFu
 Sentinel hitClientId value meaning "shot missed all targets".

Detailed Description

PR-18b — server-side shot-resolution log for the netsync framework.

Each call to recordShotResolution appends one CSV row with the shot's authoritative outcome (shooter, the input tick the client stamped on the firing input, hit target if any, hit point in world space). The companion offline analyzer (scripts/netsync-analyze.py --shots) joins this with the existing bot-side observation log to compute hit-rate vs network conditions and surface lag-comp regressions deterministically.

Keyed by (shooterClientId, shotInputTick) — the same pair the client used to stamp the input — so future bot-side shot-intent logs (PR-18c) can match without any extra wire-format changes.

File path comes from GROUP2_SERVER_SHOTS_CSV. No-op when env var unset; load tests stay free of disk I/O cost.