|
group2 0.1.0
CSE 125 Group 2
|
PR-2b (server-perf): bulk-snapshot every connected client's last-reported network state in one (mostly lock-free) operation. More...
#include <Server.hpp>
Public Attributes | |
| ClientId | id |
| uint16_t | rttMs |
| uint8_t | interpDelaySnapshots |
PR-2b (server-perf): bulk-snapshot every connected client's last-reported network state in one (mostly lock-free) operation.
PR-12 expanded this from "just RTT" to "RTT + interp-delay" so the game thread's updateLagCompTargets can compute the rewind formula targetServerTick = currentServerTick − (RTT/2 + interp) from a single snapshot. At 100 bots × 128 Hz, the per-client form was ~13 k mutex ops/sec on stateMutex_, contending hard with the network thread; bulk snapshot collapses to 1 op/tick (PR-4 atomic publish makes the read itself lock-free).
| out | Cleared and filled with ClientNetState records in unspecified order. Caller is expected to reuse the same vector across ticks to avoid allocation churn. |
| ClientId Server::ClientNetState::id |
| uint8_t Server::ClientNetState::interpDelaySnapshots |
| uint16_t Server::ClientNetState::rttMs |