group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
PlayerMatchStats Struct Reference

ECS component: per-player scoreboard statistics for the current match. More...

#include <PlayerMatchStats.hpp>

Public Attributes

int score = 0
 Player's current score.
int kills = 0
 Number of kills achieved this match.
int deaths = 0
 Number of deaths this match.
bool hasWon = false
 True if the player reached the kill threshold.
uint16_t rttMs = 0
 Last RTT this player's client reported to the server (ms).

Detailed Description

ECS component: per-player scoreboard statistics for the current match.

Replicated to every client (it's in RegistrySerialization::Synced), which is what makes per-player ping work in the scoreboard HUD: the server stamps rttMs from each client's Connection::lastReportedRttMs each tick, and every receiving client reads the target's rttMs from this component instead of its own local NetworkStats::rttMs.

Member Data Documentation

◆ deaths

int PlayerMatchStats::deaths = 0

Number of deaths this match.

◆ hasWon

bool PlayerMatchStats::hasWon = false

True if the player reached the kill threshold.

◆ kills

int PlayerMatchStats::kills = 0

Number of kills achieved this match.

◆ rttMs

uint16_t PlayerMatchStats::rttMs = 0

Last RTT this player's client reported to the server (ms).

Source: the 2-byte rttMs prefix on every INPUT packet, which carries the client's smoothed NetworkStats::avgRttMs. Server copies it out of Connection::lastReportedRttMs into this component once per tick (in updateLagCompTargets), so it rides the existing snapshot stream to every client. 0 until the player's first INPUT arrives.

◆ score

int PlayerMatchStats::score = 0

Player's current score.


The documentation for this struct was generated from the following file: